一句话:让 APR agent 在同一补丁中同时生成修复与 Bug 复现测试,在不降低修复质量的前提下减少流水线维护成本。
实际开发中开发者常随补丁一并提交 Bug 复现测试(BRT),但主流自动程序修复(APR)系统通常分开生成 BRT 与修复,最终补丁只含修复。本文研究 agentic APR 的“协同生成”:指示修复 agent 在同一补丁中同时产出修复与 BRT。作者在 Google 的 120 个人工报告缺陷上评估多种协同生成策略,刻画各策略对 agent 行为的影响,设计考虑测试变更的补丁选择器以选出修复与 BRT 均合理的补丁,并分析失败轨迹的根因。结果显示,协同生成至少能与专门的 BRT agent 覆盖同样多的缺陷,且不牺牲合理修复的生成率,从而降低大规模维护两条独立生成流水线的工程成本。
Bug Reproduction Tests (BRTs) have been used in many Automated Program Repair (APR) systems, primarily for validating fixes and aiding fix generation. In practice, when developers submit a patch, they often implement the BRT alongside the fix. Our experience deploying agentic APR reveals that developers desire a BRT within AI-generated patches to increase their confidence. However, canonical APR systems tend to generate BRTs and fixes separately, and focus on producing only the fix in the final patch. In this paper, we study agentic APR in the context of cogeneration, where the APR agent is instructed to generate both a fix and a BRT in the same patch. We evaluate the effectiveness of different cogeneration strategies on 120 human-reported bugs at Google and characterize different cogeneration strategies by their influence on APR agent behavior. We develop and evaluate patch selectors that account for test change to select patches with plausible fixes (and plausible BRTs). Finally, we analyze the root causes of failed cogeneration trajectories. We show that cogeneration allows the APR agent to generate BRTs for at least as many bugs as a dedicated BRT agent, without compromising the generation rate of plausible fixes, thereby reducing engineering effort in maintaining and coordinating separate generation pipelines for fix and BRT at scale.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{abs-2601-19066,
title = {Dynamic Cogeneration of Bug Reproduction Test in Agentic Program Repair},
author = {Runxiang Cheng and Michele Tufano and Jose Cambronero and Renyao Wei and Sherry Shi and Grant Uy and Pat Rondon and Franjo Ivancic},
booktitle = {FSE},
year = {2026},
doi = {10.1145/3803437.3805237}
}