用智能监督取代人工,让代码生成器自动写出更全面的测试用例。
SCATE: Learning to Supervise Coding Agents for Cost-Effective Test Generation

- 将监督任务建模为上下文相关强化学习,动态选择最优测试动作。
- 在GEMINI-CLI上提升32.3%行覆盖率和30.9%分支覆盖率。
- 无需人工干预,适配不同生成器,尤其适合自动化测试研发者。
尽管自主代码生成器显著推进了自动化测试生成,但其仍受制于‘惰性生成’问题——即生成器过早终止任务并系统性回避复杂逻辑,导致代码覆盖率不足。当前缓解该问题需持续的人工介入,形成效率瓶颈。本文提出SCATE框架,实现对代码生成器的自适应、自动化监督,替代人工干预。通过将监督建模为上下文多臂赌博机问题,SCATE基于当前覆盖率与类可测性指标,学习选择最具潜力的测试动作,以最大化覆盖增益并最小化无效生成。实验表明,SCATE可无缝集成于多种生成器;应用于GEMINI-CLI时,相较仅使用生成器的基线,行覆盖率提升32.3%,分支覆盖率提升30.9%。与CLAUDE CODE对比显示,该框架能动态适配各生成器的独特优势。此外,SCATE在所有指标上均优于现有非生成式方法。
原文摘要 · Abstract (English)
While autonomous coding agents have significantly advanced automated test generation, they remain fundamentally limited by lazy generation, a phenomenon where agents prematurely terminate tasks and systematically avoid complex programmatic logic, resulting in inadequate code coverage. Currently, mitigating this premature termination requires continuous human-in-the-loop supervision. This heavy reliance on human intuition creates a bottleneck that negates the efficiency gains of automated generation. We propose SCATE, a framework for adaptive, automated supervision of coding agents that replaces human intervention during test generation. By formulating supervision as a contextual bandit problem, SCATE learns to select the most promising testing actions based on the current coverage and class testability metrics, maximizing coverage gains while minimizing wasted generation effort. Our empirical evaluation demonstrates that SCATE integrates seamlessly with different coding agents. When applied to GEMINI-CLI, it achieves 32.3% higher line coverage and 30.9% higher branch coverage than the agent-only baseline. A comparison with CLAUDE CODE confirms the framework dynamically adapts its policy to optimize each agent's unique strengths. SCATE also consistently outperforms state-of-the-art non-agentic approaches across all metrics.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。