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

TL;DR

Introducing TEBench, a project-level test evolution benchmark with 314 instances, achieving 45.7%-49.4% F1 in test identification, highlighting current model limitations.

cs.SE 🔴 Advanced 2026-05-07 57 views
Ye Shang Quanjun Zhang Haichuan Hu Chunrong Fang Liang Xiao Zhenyu Chen
software testing code evolution large language models automation benchmarking

Key Findings

Methodology

TEBench employs a four-stage filtering pipeline over Defects4J projects, curating 314 high-quality instances annotated with three evolution types: Test-Breaking, Test-Stale, and Test-Missing. The system must autonomously identify affected tests, locate new test needs, and generate patches. Seven configurations spanning three industrial frameworks (Claude Code, Codex CLI, OpenCode) and six base models were evaluated using F1 scores for identification accuracy and quality metrics for updates. Results show a shared performance ceiling of 45.7%-49.4%, with Test-Stale being the most challenging at ~36%, due to reliance on execution failure signals and lack of semantic reasoning.

Key Results

  • All configurations achieved F1 scores between 45.7% and 49.4%, indicating a common performance ceiling across models and frameworks. Test-Stale detection remains difficult with an average F1 of about 36%, highlighting the models' dependence on failure signals and limited semantic understanding. Generated test patches are highly executable but diverge significantly in surface form from ground truth, revealing limitations in semantic alignment. Structural dependency analysis only recovers about 66% of affected tests, leaving a third undetected, emphasizing the need for better reasoning capabilities.

Significance

This work advances the field by shifting the focus from method-level to project-level test evolution, capturing the complexity of real-world software maintenance. The comprehensive dataset and evaluation framework provide a new standard for assessing AI-driven test maintenance tools. It highlights the performance bottlenecks of current large models in understanding complex code-test relationships, guiding future research toward more semantic-aware approaches. The benchmark bridges the gap between academic research and practical needs, fostering the development of more robust, intelligent testing systems that can handle the intricacies of evolving software projects.

Technical Contribution

First to formalize project-level test evolution as an autonomous task requiring identification, localization, and generation of test modifications. Construction of a high-quality, annotated dataset from real-world open-source projects. Systematic evaluation of multiple large language models and frameworks, revealing inherent performance ceilings and areas for improvement. Introduction of multi-dimensional metrics for both identification and update quality, providing comprehensive assessment standards. The work sets a foundation for future research integrating semantic reasoning and multi-modal data in automated testing.

Novelty

This is the first benchmark to address project-level test evolution, emphasizing autonomous identification and new test generation, moving beyond prior method-level, paired-input approaches. The inclusion of three evolution types—Breaking, Stale, and Missing—provides a more complete picture of test maintenance challenges. The dataset from real-world open-source projects and the multi-model evaluation framework are novel contributions, revealing current model limitations and guiding future innovations.

Limitations

  • Models rely heavily on execution failure signals, limiting detection of semantically outdated or missing tests. Lack of proactive semantic reasoning hampers performance on Stale and Missing types. The generated patches often differ in surface form from Ground Truth, indicating limited understanding of test intent. The evaluation is constrained to Java projects and specific frameworks, affecting generalizability.

Future Work

Future research should incorporate deeper semantic understanding, possibly via code-graph embeddings or multi-modal learning, to improve detection of Stale and Missing tests. Expanding to multi-language and multi-platform projects will enhance generalization. Integrating user feedback and active learning can refine test generation. Exploring hybrid approaches combining static analysis, dynamic signals, and semantic reasoning will likely push the performance ceiling further.

AI Executive Summary

Software development is an ongoing process characterized by frequent code changes, bug fixes, and feature additions. As the codebase evolves, the associated test suite must also adapt to ensure continued effectiveness. Traditional test maintenance approaches often focus on method-level changes, relying on pre-paired code-test relationships, which limits their ability to handle the complex, project-wide nature of real-world software. This gap has motivated the development of TEBench, a novel benchmark designed to evaluate automated systems at the project level.

TEBench was constructed from 314 high-quality instances derived from 10 open-source Java projects within the Defects4J ecosystem. These instances are annotated with three key types of test evolution: Test-Breaking, where tests fail after code changes; Test-Stale, where tests pass but no longer validate the intended behavior; and Test-Missing, where new tests are needed for newly introduced functionality. The benchmark challenges systems to autonomously identify affected tests, locate where new tests are needed, and generate appropriate test patches.

Evaluation of seven configurations spanning three industrial frameworks and six large language models revealed a shared performance ceiling of approximately 46%-49% F1 in test identification. Test-Stale detection proved most difficult, with an average F1 around 36%, primarily due to reliance on execution failure signals and limited semantic reasoning. Generated test patches were often executable but diverged significantly from developer-written ground truth, highlighting the gap in semantic understanding.

These findings underscore the current limitations of AI-based test maintenance systems, emphasizing the need for enhanced semantic reasoning capabilities. The benchmark provides a comprehensive platform for future research, aiming to develop more intelligent, context-aware test evolution tools. Overall, TEBench marks a significant step toward automating and improving software testing in complex, real-world projects, with promising avenues for integrating deeper code understanding and multi-modal data in future work.

Deep Analysis

Background

The evolution of software systems necessitates continuous updates to test suites to maintain reliability and coverage. Prior research has largely focused on method-level test evolution, employing benchmarks like Defects4J, which simplify the problem by pre-pairing tests with specific methods. However, real-world projects involve complex, project-wide changes affecting multiple modules and tests across different files. Recent advances in large language models and autonomous coding agents have shown promise, but their evaluation remains limited to simplified scenarios. Existing benchmarks such as SITAR, CHOSEN, and Reaccept do not capture the full complexity of project-level test evolution, especially the identification of affected tests and the generation of new tests for new behaviors. This gap underscores the need for a comprehensive, project-level benchmark that can evaluate AI systems' ability to handle real-world code changes and test maintenance challenges.

Core Problem

The core challenge in test evolution is twofold: first, accurately identifying which tests are affected by code changes across a large codebase; second, generating or updating tests to reflect new or modified behaviors. Existing benchmarks bypass the identification step by pre-pairing tests with code, limiting their applicability to real-world scenarios where developers must locate affected tests manually. Moreover, current models predominantly focus on fixing failing tests (Test-Breaking), neglecting the more subtle issues of stale tests that no longer validate intended behaviors, and completely missing new behaviors that lack tests. This incomplete coverage hampers the development of truly autonomous test maintenance systems capable of handling the full spectrum of test evolution in complex projects.

Innovation

This work introduces a comprehensive project-level test evolution task, emphasizing autonomous identification of affected tests, localization of new test needs, and generation of test patches. It extends prior method-level approaches by considering the entire project context, capturing three evolution types—Test-Breaking, Test-Stale, and Test-Missing—thus providing a more realistic and complete evaluation framework. The construction of TEBench from real-world open-source projects, with detailed annotations, enables systematic assessment of AI models' capabilities in complex scenarios. Additionally, the evaluation of multiple large language models across different frameworks reveals inherent performance ceilings and highlights the need for deeper semantic reasoning, guiding future research directions.

Methodology

  • �� Data Collection: Extract 67,670 commits from 14 Maven-based Java projects in Defects4J, applying static and execution-based filters to select high-quality instances.
  • �� Filtering: Remove commits without substantive code changes, unrelated modifications, or lacking impact on tests, resulting in 314 instances across 10 projects.
  • �� Version Structuring: Create three versions per instance—V−1 (pre-change), V−0.5 (post-change without test updates), V0 (full change with test modifications)—for evaluation.
  • �� System Evaluation: Deploy seven configurations spanning three frameworks and six models, assessing identification via precision, recall, F1, and update quality via executability, coverage, and similarity metrics.
  • �� Metrics: Use project-level autonomous identification, compare detected affected tests with ground truth, and evaluate generated test patches for correctness and semantic alignment.

Experiments

The experimental setup involves evaluating models on the curated TEBench dataset, measuring identification accuracy (F1 scores) and update quality (executability, coverage, similarity). Baselines include heuristic methods and various large language models like Codex, Claude, and OpenCode. Metrics include precision, recall, F1, and structural dependency analysis. Hyperparameters such as beam size, temperature, and prompt design are tuned for optimal performance. Ablation studies analyze the impact of different input representations and reasoning modules. The evaluation also examines the difficulty of each test evolution type, revealing the models' reliance on failure signals and their limited semantic reasoning capacity.

Results

Results show all configurations achieve F1 scores between 45.7% and 49.4%, with minimal variation across frameworks and models, indicating a performance ceiling. Test-Stale detection remains challenging, with an average F1 of about 36%, due to reliance on execution failure signals and lack of semantic understanding. Generated patches are highly executable but often differ in surface form from Ground Truth, highlighting limitations in semantic alignment. Structural dependency analysis recovers approximately 66% of affected tests, leaving a significant portion undetected. These findings point to the necessity of integrating deeper semantic reasoning and multi-modal data to improve test identification and generation.

Applications

The benchmark facilitates the development of AI systems capable of autonomously maintaining large-scale test suites in complex software projects. Immediate applications include automated test repair, regression detection, and test augmentation in CI/CD pipelines. Long-term, the research aims to create intelligent testing agents that can understand code semantics, adapt to evolving software requirements, and reduce manual effort in test maintenance, significantly improving software reliability and developer productivity across industries.

Limitations & Outlook

Current models heavily depend on execution failure signals, limiting detection of semantically outdated or missing tests. The lack of proactive semantic reasoning hampers performance on Stale and Missing categories. Generated patches often diverge from developer intent, indicating limited understanding of test semantics. The evaluation scope is limited to Java projects and specific frameworks, affecting generalizability. Computational costs and the complexity of integrating deeper semantic modules also pose challenges for practical deployment.

Plain Language Accessible to non-experts

想象你在管理一个大型工厂,工厂里有许多机器(代码)和检测机器(测试)。每当你更换一台机器(代码变更),你需要检查所有检测机器是否还能正确工作。有些检测机器会失败(Test-Breaking),需要修理;有些检测机器还在工作,但它们的检测内容已经不再准确(Test-Stale);还有一些新机器刚刚安装,还没有检测(Test-Missing)。这个过程很繁琐,因为你得逐一检查每台检测机器,判断它们是否还合适,或者需要新增。TEBench就像是一个智能助手,能自动帮你找出哪些检测机器需要修理、哪些需要更新,甚至帮你设计新检测机器,确保工厂的质量始终如一。它通过模拟真实工厂的变化,帮助开发者训练更聪明的检测助手,让工厂(软件)变得更可靠、更高效。

ELI14 Explained like you're 14

想象你在学校里管理一个大班级,每次老师布置新作业,你都得检查每个学生的作业是否还符合要求。有些学生的作业不再符合(Test-Breaking),需要重新修改;有些学生的作业虽然还符合,但内容已经过时(Test-Stale);还有一些学生刚刚开始写作业,还没有提交(Test-Missing)。这工作非常繁琐,因为你得逐个检查每份作业,判断它们是否还合格,或者需要补交。TEBench就像是一个聪明的机器人助手,它可以自动帮你找到哪些作业需要修改,哪些需要补交,甚至帮你设计新的作业题目,确保每个学生都能按时完成,老师的工作也变得轻松多了。这就像让机器人帮你打理学校,保证每个学生都能得到最好的学习体验。

Glossary

Test-Breaking (测试失败)

测试在代码变更后无法通过,需修复。技术上指测试无法执行或结果不符合预期。

描述测试因代码变更而失败的情况。

Test-Stale (测试过时)

测试仍能通过,但不再反映最新代码行为,需更新。技术上指测试逻辑与代码实际行为不一致。

描述测试未反映最新代码状态。

Test-Missing (缺失测试)

新行为未被测试,需新增测试用例。技术上指没有对应新功能或变更的测试覆盖。

描述新功能缺乏测试的情况。

TEBench

一种项目级测试演化基准,用于评估自动化测试维护系统的性能。技术上包括数据集、任务定义和评估指标。

论文中的核心评估平台。

Large Language Models (大规模语言模型)

基于深度学习的模型,能理解和生成自然语言,应用于代码理解和生成。

用于自动化测试补丁生成。

Open Questions Unanswered questions from this research

  • 1 如何进一步提升模型的语义理解能力,尤其是在复杂的测试场景中?
  • 2 多模态信息融合(如结合代码语义和历史变更)能否显著改善测试识别和生成效果?
  • 3 在多语言、多平台环境下,模型的泛化能力如何?

Applications

Immediate Applications

自动化测试维护工具

企业可以利用TEBench评估和优化自动化测试修复系统,提升软件质量保障效率。

持续集成优化

集成自动测试修复模块,减少人工干预,加快软件发布流程。

Long-term Vision

智能测试代理

未来开发出能理解复杂代码语义、自动生成高质量测试的智能系统,全面提升软件开发自动化水平。

Abstract

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.

cs.SE