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

超越Bug修复:对代理生成拉取请求合并后代码质量问题的实证研究

Beyond Bug Fixes: An Empirical Investigation of Post-Merge Code Quality Issues in Agent-Generated Pull Requests

University of Saskatchewan(萨斯喀彻温大学)

Shamse Tasnim Cynthia, Al Muttakin, Banani Roy

AI总结:

本研究通过分析代理生成的bug修复PR合并后代码质量问题,发现代码异味主导,且合并成功不等于代码质量高,需系统化质量检查。

摘要:

随着AI编码代理的日益普及,越来越多的代理生成的拉取请求(PR)在缺乏或几乎没有人工干预的情况下被合并。尽管此类PR承诺带来生产率的提升,但其合并后的代码质量仍缺乏深入研究,因为先前的工作主要依赖于基准测试和受控任务,而非大规模的合并后分析。为填补这一空白,我们分析了AIDev数据集中来自Python仓库的1,210个已合并的代理生成的bug修复PR。使用SonarQube,我们对基础提交和合并提交进行差异分析,以识别由PR更改新引入的代码质量问题。我们检查了五个代理在问题频率、密度、严重程度和规则级普遍性方面的表现。我们的结果表明,代理之间原始问题计数的明显差异在通过代码变更率归一化后 largely消失,表明更高的问题计数主要由更大的PR驱动。在所有代理中,代码异味占主导地位,特别是在关键和严重级别,而bug则较少但往往严重。总体而言,我们的发现表明,合并成功并不能可靠地反映合并后的代码质量,突显了对代理生成的bug修复PR进行系统质量检查的必要性。

英文摘要:

The increasing adoption of AI coding agents has increased the number of agent-generated pull requests (PRs) merged with little or no human intervention. Although such PRs promise productivity gains, their post-merge code quality remains underexplored, as prior work has largely relied on benchmarks and controlled tasks rather than large-scale post-merge analyses. To address this gap, we analyze 1,210 merged agent-generated bug-fix PRs from Python repositories in the AIDev dataset. Using SonarQube, we perform a differential analysis between base and merged commits to identify code quality issues newly introduced by PR changes. We examine issue frequency, density, severity, and rule-level prevalence across five agents. Our results show that apparent differences in raw issue counts across agents largely disappear after normalizing by code churn, indicating that higher issue counts are primarily driven by larger PRs. Across all agents, code smells dominate, particularly at critical and major severities, while bugs are less frequent but often severe. Overall, our findings show that merge success does not reliably reflect post-merge code quality, highlighting the need for systematic quality checks for agent-generated bug-fix PRs.

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

↑