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

打破、过时或缺失?基于项目级测试演变的基准测试

Breaking, Stale, or Missing? Benchmarking Coding Agents on Project-Level Test Evolution

State Key Laboratory for Novel Software Technology, Nanjing University(南京大学软件新技术国家重点实验室);Nanjing University of Science and Technology(南京理工大学)

Ye Shang, Quanjun Zhang, Haichuan Hu, Chunrong Fang, Liang Xiao, Zhenyu Chen

AI总结:

本文提出TEBenchmark,首个项目级测试演变基准,评估系统自主识别需修改的测试、确定新测试需求并生成测试补丁的能力,揭示测试演变任务的性能上限。

摘要:

随着生产代码的演变,测试套件必须共同进化以保持有效性。现有的测试演变基准在方法级粒度上操作,使用预配对的输入,绕过了从完整项目中定位受影响测试的任务,并完全排除了新测试的需求。我们提出了TEBenchmark,首个项目级测试演变基准。给定一个项目仓库和一个代码变更提交,TEBenchmark要求系统自主识别需要修改的测试,确定需要新测试的位置,并生成相应的测试补丁。我们通过四个阶段的管道处理Defects4J项目,从10个项目中精选出314个任务实例,每个实例标注了三种演变类型之一:测试-打破(失败的测试)、测试-过时(通过但不再有意义地验证更新行为)和测试-缺失(需要新测试来验证引入的行为)。我们评估了七个配置,涵盖三个工业代理框架(Claude Code、Codex CLI、OpenCode)和六个基础模型,以及一个启发式基线。所有七个配置在识别F1上达到45.7%到49.4%,揭示了在两个框架和基础模型上的共同性能上限。测试-过时是最具挑战性的类型,平均F1约为36%,因为配置依赖于执行失败信号并缺乏主动语义推理。在更新任务中,配置生成高度可执行的测试修改,其表面形式与地面真实值有显著差异。轨迹分析揭示了反应性的“执行-失败-修复”循环,该循环在打破测试上成功,但结构上无法解决过时或缺失的测试。TEBenchmark可在https://github.com/iSEngLab/TEBench上获得,包含一个排行榜在https://tebench-leadership.vercel.app。

英文摘要:

As production code evolves, the test suite must co-evolve to remain effective. Existing benchmarks for test evolution operate at method-level granularity with pre-paired inputs, bypassing the task of locating affected tests from the full project and excluding the need for new tests entirely. We present TEBench, the first project-level benchmark for test evolution. Given a project repository and a code-changing commit, TEBench requires systems to autonomously identify tests requiring modification, determine where new tests are needed, and produce the corresponding test patch. We construct TEBench through a four-stage pipeline over Defects4J projects, curating 314 task instances from 10 projects with developer-written ground truth. Each instance is annotated with one or more of three evolution types: Test-Breaking (tests that fail), Test-Stale (tests that pass but no longer meaningfully validate updated behavior), and Test-Missing (new tests needed for introduced behavior). We evaluate seven configurations spanning three industrial agent frameworks (Claude Code, Codex CLI, OpenCode) and six base models, alongside a heuristic baseline. All seven configurations converge on an identification F1 of 45.7% to 49.4%, revealing a shared performance ceiling across both frameworks and base models. Test-Stale is the most challenging type, averaging F1 around 36%, since configurations rely on execution failure signals and lack proactive semantic reasoning. On the update task, configurations produce highly executable test modifications whose surface form diverges substantially from ground truth. Trajectory analysis reveals a reactive "execute-fail-fix" loop that succeeds for breaking tests but structurally cannot address stale or missing tests. TEBench is available at https://github.com/iSEngLab/TEBench with a leaderboard at https://tebench-leadership.vercel.app.

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

↑