TestEvo-Bench: An Executable and Live Benchmark for Test and Code Co-Evolution

📄 arXiv: 2607.02469v1 📥 PDF

作者: Jiale Amber Wang, Kaiyuan Wang, Pengyu Nie

分类: cs.SE, cs.AI, cs.CL

发布日期: 2026-07-02

备注: TestEvo-Bench leaderboard and data explorer are hosted at https://www.testevo-bench.com


💡 一句话要点

提出TestEvo-Bench以解决测试与代码共同演化问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 测试生成 代码演化 基准测试 软件工程 自动化测试 开源项目 性能评估

📋 核心要点

  1. 现有的测试生成和更新基准往往将测试与代码变更隔离,无法验证测试的可执行性和语义关联性。
  2. 提出TestEvo-Bench基准,支持测试生成和更新任务,结合真实提交历史和执行环境配置。
  3. 实验结果显示,使用先进代理在测试生成和更新任务上分别达到77.5%和74.6%的成功率,但在最新任务上表现下降。

📝 摘要(中文)

软件测试与代码是相互演化的:代码变更后应有新的或更新的测试来记录软件的新行为。然而,现有的测试生成和更新基准往往将测试与代码变更隔离,依赖静态元数据,无法验证测试是否可执行或与代码变更语义相关。这使得评估测试自动化代理是否理解代码变更如何传播到测试套件变得困难。我们提出了TestEvo-Bench,这是一个从软件仓库中挖掘的测试与代码共同演化任务基准,包含两个轨道:在测试生成中,代理需要编写新测试以捕获新的软件行为;在测试更新中,代理需要调整现有失败测试以适应变更后的软件行为。每个任务都与真实的提交历史相结合,并配备环境配置,以支持基于执行的度量标准,如通过率、覆盖率和变异分数。TestEvo-Bench还是一个实时基准:每个任务记录测试和代码变更的时间戳,并通过我们的自动化管道定期挖掘新任务,从而减少数据泄漏风险。当前快照包含746个测试生成和509个测试更新任务,来自152个开源Java项目的59,950个候选共同演化记录。我们实验了四个最先进的代理,结果显示它们在测试生成上达到77.5%的成功率,在测试更新上达到74.6%。然而,在最新的基准任务上,成功率显著降低。

🔬 方法详解

问题定义:论文旨在解决现有测试生成和更新基准无法有效评估测试与代码变更之间关系的问题,现有方法依赖静态元数据,缺乏动态验证。

核心思路:通过引入TestEvo-Bench基准,结合真实的代码提交历史和执行环境,确保测试生成和更新任务的有效性和相关性。

技术框架:整体架构包括任务挖掘、环境配置和执行度量三个主要模块,任务挖掘从软件仓库中提取共同演化记录,环境配置确保测试可执行。

关键创新:TestEvo-Bench作为一个实时基准,定期更新任务,记录时间戳以减少数据泄漏风险,这是与现有方法的本质区别。

关键设计:在实验中使用了强大的代理模型,结合了Claude Code、Gemini CLI和SWE-Agent等强大框架,确保了测试生成和更新的高效性。实验设置中关注了通过率、覆盖率和变异分数等关键性能指标。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,所提出的基准在测试生成任务上取得了77.5%的成功率,在测试更新任务上达到74.6%。然而,在最新的基准任务上,成功率显著下降,显示出当前方法在应对新任务时的局限性。

🎯 应用场景

该研究的潜在应用领域包括软件开发和测试自动化,能够帮助开发者更有效地生成和更新测试用例,从而提高软件质量和开发效率。未来,TestEvo-Bench可能推动测试自动化工具的进一步发展,促进软件工程领域的创新。

📄 摘要(原文)

Software tests and code evolve together: a code change should be followed by new or updated tests that record the new software behavior. Yet existing test generation and update benchmarks often isolate the test from the code change, and rely on static metadata that does not verify whether a test is executable or semantically tied to the code change. This makes it difficult to evaluate whether a test automation agent understands how a code change should propagate into the test suite. We introduce TestEvo-Bench, a benchmark of test and code co-evolution tasks mined from software repositories, with two tracks: in test generation, the agent shall write new tests to capture the new software behavior; in test update, the agent shall adapt failing existing tests to the changed software behavior. Each task is anchored to a real commit history and packaged with environment configuration to support execution-grounded metrics such as pass rate, coverage, and mutation score. TestEvo-Bench is also a live benchmark: each task records the timestamp of the test and code changes, and new tasks are periodically mined by our automated pipeline, so evaluation can be restricted to tasks postdating a model's training cutoff to reduce data leakage risk. The current snapshot contains 746 test generation and 509 test update tasks, curated from 59,950 candidate co-evolution records across 152 open-source Java projects. We experiment with four state-of-the-art agents that combine strong harnesses (Claude Code, Gemini CLI, and SWE-Agent) with strong foundation models (Claude Opus 4.7 and Gemini 3.1 Pro). Results show that they achieve up to 77.5% success rate on test generation and 74.6% on test update. However, success rate is materially lower on the most recent benchmark tasks and drops significantly under limited per-task cost.