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

📄 arXiv: 2607.02469 📥 PDF

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

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

发布日期: 2026-07-05


💡 一句话要点

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

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

关键词: 测试生成 代码更新 共同演化 基准测试 软件工程 自动化测试 开源项目

📋 核心要点

  1. 现有的测试生成和更新基准往往将测试与代码变更隔离,无法验证测试的可执行性。
  2. 本文提出TestEvo-Bench,旨在通过真实提交历史和环境配置来评估测试与代码的共同演化。
  3. 实验结果显示,使用先进的代理模型,测试生成成功率高达77.5%,测试更新成功率为74.6%。

📝 摘要(中文)

软件测试与代码是共同演化的:代码变更后应有新的或更新的测试以记录软件的新行为。然而,现有的测试生成和更新基准往往将测试与代码变更隔离,依赖静态元数据,无法验证测试的可执行性或与代码变更的语义关联性。为此,本文提出了TestEvo-Bench,这是一个从软件仓库中挖掘的测试与代码共同演化任务基准,包含测试生成和测试更新两个轨道。每个任务都与真实的提交历史相结合,并配备环境配置,以支持基于执行的度量标准,如通过率、覆盖率和变异分数。TestEvo-Bench还具有实时基准的特点,定期挖掘新任务,以减少数据泄漏风险。当前快照包含746个测试生成任务和509个测试更新任务,来自152个开源Java项目的59,950个候选共同演化记录。

🔬 方法详解

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

核心思路:TestEvo-Bench通过挖掘真实的代码提交历史,结合环境配置,创建测试生成和更新任务,以便更好地评估测试自动化代理对代码变更的理解和响应。

技术框架:整体架构包括任务挖掘、环境配置、执行评估和实时更新四个主要模块。任务挖掘从开源项目中提取共同演化记录,环境配置确保测试的可执行性,执行评估使用多种度量标准来评估测试效果。

关键创新:TestEvo-Bench的创新在于其实时性和动态任务挖掘能力,能够持续更新基准任务,避免数据泄漏,并确保测试与代码变更的紧密关联。

关键设计:在实验中,采用了多种先进的代理模型(如Claude Code和Gemini CLI),并设置了适当的评估指标,如通过率和覆盖率,以全面评估测试生成和更新的效果。实验还考虑了任务的时间戳,以确保评估的准确性。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,使用TestEvo-Bench的先进代理模型在测试生成任务中成功率高达77.5%,而在测试更新任务中成功率为74.6%。然而,在最新的基准任务中,成功率显著降低,尤其是在每个任务的成本有限的情况下,这表明了当前方法在应对新任务时的挑战。

🎯 应用场景

TestEvo-Bench可广泛应用于软件开发和测试领域,尤其是在持续集成和持续交付(CI/CD)环境中。通过提供实时的测试与代码共同演化评估,开发者可以更有效地维护和更新测试套件,提高软件质量和开发效率。未来,该基准可能推动更智能的测试自动化工具的发展,提升软件工程的整体水平。

📄 摘要(原文)

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.