arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.13065cs.SE
收藏

TestSuiteBench:编码智能体难以根据规范生成高质量测试套件

TestSuiteBench: Coding Agents Struggle to Generate Strong Test Suites from Specifications

ETH Zurich(苏黎世联邦理工学院)

Kazuki Egashira, Niels Mündler-Sasahara, Mark Niklas Müller, Martin Vechev

AI总结:

本研究推出TestSuiteBench基准,发现前沿编码智能体虽能生成有效代码,但难以根据规范生成高质量测试套件,凸显自主软件开发中代码与验证能力的缺口。

摘要:

编码智能体正越来越多地用于创建大型软件项目。尽管代码生成基准已相应扩展到完整应用程序,但测试生成基准仍局限于单个函数或漏洞修复。特别是,从头开始为复杂软件生成完整测试套件的研究仍未开展。为解决这一缺口,我们推出TestSuiteBench,这一基准包含165个开源应用程序,每个应用程序都有结构化且详细的预期行为规范、参考实现、参考测试套件,以及平均74个变异体。每个变异体由规范的单个需求生成并经过优化以隔离该行为:73%的变异体仅被一个参考测试杀死,平均仅被剩余测试的0.2%杀死。我们发现,即使是前沿编码智能体在给定我们的规范时也难以生成高质量测试套件,其变异分数低于60%,尽管它们生成的测试套件大多有效,且88%的测试在参考实现上通过。我们观察到,生成的测试套件往往缺乏相关输入组合,且比参考测试套件更小。与此同时,针对相同规范生成的实现通过了82%的参考测试。这些结果表明,智能体可以构建它们无法验证的软件,这一缺口直接限制了完全自主软件开发的实现。

英文摘要:

Coding agents are increasingly used to create large software projects. While code-generation benchmarks have scaled accordingly to full applications, test-generation benchmarks remain limited to individual functions or bug fixes. In particular, generating complete test suites for complex software from scratch remains unexplored. To address this gap, we introduce TestSuiteBench, a benchmark of 165 open-source applications, each with a structured and detailed specification of intended behavior, a reference implementation, a reference test suite, and on average 74 mutants. Each mutant is generated from a single requirement of the specification and refined to isolate that behavior: 73\% are killed by exactly one reference test and, on average, by only 0.2\% of the remaining tests. We find that even frontier coding agents struggle to generate strong test suites given our specifications, achieving mutation scores below 60\%, despite their suites being largely valid and 88\% of their tests passing on the reference implementation. We observe that generated test suites often lack relevant input combinations and are smaller than reference test suites. Meanwhile, implementations generated for the same specifications pass 82\% of the reference tests. These results show agents can build software they cannot verify, a gap that directly limits fully autonomous software development.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑