paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Change And Cover: Last-Mile, Pull Request-Based Regression Test Augmentation

Change And Cover:基于 Pull Request 的最后一英里回归测试增强
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 3/10 · 该论文用 LLM 针对 PR 中未覆盖行增强回归测试,属于 LLM 辅助软件测试与覆盖分析,与用户关注的静态分析、形式化验证、浮点程序分析、贝叶斯程序分析均无直接交集;虽具备问题驱动和工业开源项目落地特征,但主题不在研究核心方向上。引用 3 inbox
Zitong Zhou, Matteo Paltenghi, Miryung Kim, Michael Pradel
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出 ChaCo,用 LLM 针对 PR 中未覆盖行增强回归测试,并友好集成到现有测试套件。

PR 中修改代码常留下“最后一英里”回归测试缺口,现有测试生成器多优化整体覆盖率而非 PR 未覆盖行。ChaCo 是基于 LLM 的测试增强方法:针对具体 PR 应用后的未覆盖行生成测试,提取相关测试函数、fixture 和数据生成器提供上下文,并匹配现有风格集成且生成审查摘要。在 SciPy、Qiskit、Pandas 的 145 个 PR 上,30% 实现完整补丁覆盖,成本 0.11 美元/PR;人工评价中测试值得加入 4.53、集成良好 4.20、与 PR 相关 4.70(均满分 5)。消融显示测试上下文可带来 2 倍覆盖;提交 12 个测试,8 个已合并,并发现并修复两个未知缺陷。

问题
PR 中新增或修改代码即使有大测试套件也可能未被覆盖,形成“最后一英里”回归测试缺口。
方法
ChaCo 用 LLM 针对特定 PR 的未覆盖行生成测试,提取相关测试上下文并友好集成到现有测试套件。
评估
在 SciPy、Qiskit、Pandas 的 145 个 PR 上评估覆盖率、成本、人工评分与消融效果,并向项目提交测试验证实用性。
原文摘要(Abstract)

Software is in constant evolution, with developers frequently submitting pull requests (PRs) to introduce new features or fix bugs. Testing newly added or modified code in PRs is critical to maintaining software quality. Yet, even in projects with extensive test suites, some of the code modified in PRs may remain untested, leaving a “last-mile” regression test gap. Existing automated test generators mostly focus on improving overall code coverage, but do not specifically target the uncovered lines in PRs. This paper presents Change And Cover (ChaCo), a novel, LLM-based test augmentation technique that specifically addresses the last-mile regression test gap in PRs. Our approach is enabled by three key contributions: (i) Instead of focusing on overall code coverage, ChaCo considers a specific PR and the lines left uncovered after applying the PR, offering developers augmented tests for code just when it is on the developers’ mind. (ii) We identify providing suitable test context as a crucial challenge for an LLM to generate useful tests, and present two techniques to extract relevant test content, such as existing test functions, fixtures, and data generators. (iii) To make augmented tests acceptable for developers, ChaCo carefully integrates them into the existing test suite, e.g., by matching the test’s structure and style with the existing tests, and generates a summary of the test addition for developer review. We evaluate ChaCo on 145 PRs from three popular, complex, and well-tested open-source projects—SciPy, Qiskit, and Pandas. The approach successfully helps 30% of PRs achieve full patch coverage, at the affordable cost of $0.11 per PR, demonstrating its effectiveness and feasibility. A qualitative assessment of the generated tests shows that human reviewers find the tests to be worth adding (4.53/5.0), well integrated (4.20/5.0), and relevant to the PR (4.70/5.0). Ablation studies show test context is crucial for context-aware test generation, leading to 2 × coverage. In a contribution study, we submitted 12 tests to these projects, of which 8 have already been merged, and two previously unknown bugs were discovered and fixed. We envision our approach to be integrated into CI workflows, automating the last mile of regression test augmentation.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{abs-2601-10942,
  title = {Change And Cover: Last-Mile, Pull Request-Based Regression Test Augmentation},
  author = {Zitong Zhou and Matteo Paltenghi and Miryung Kim and Michael Pradel},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3744916.3787768}
}