arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2603.15911cs.SE
收藏

代理代码审查中的人工智能与人类协同

Human-AI Synergy in Agentic Code Review

Queen’s University(女王大学)

Suzhen Zhong, Shayan Noei, Ying Zou, Bram Adams

AI总结:

研究通过分析300个开源项目27.8万次代码审查对话,比较人类与AI在代码审查中的反馈差异及建议采纳效果,发现人类提供更全面的反馈,AI建议采纳率较低且导致代码复杂度增加。

摘要:

代码审查是软件工程中的关键实践,开发者在整合代码变更前审查以确保质量、检测缺陷并提高可维护性。近年来,能够理解代码上下文、规划审查动作并交互开发环境的AI代理已被越来越多地整合到代码审查流程中。然而,目前缺乏比较AI代理和人类审查员在协作工作流中有效性的实证证据。为填补这一空白,我们对300个开源GitHub项目中的278,790次代码审查对话进行了大规模实证分析。我们的研究旨在比较人类审查员和AI代理提供的反馈差异。我们调查了审查对话中的人工智能与人类协作模式,以了解交互如何塑造审查结果。此外,我们分析了人类审查员和AI代理提供的代码建议在代码库中的采用情况,以及采用的建议如何改变代码质量。我们发现,人类审查员比AI代理提供更多的反馈,包括理解、测试和知识转移。人类审查员在审查AI生成的代码时,与人类编写代码的审查轮次多11.8%。此外,AI代理提出的代码建议被纳入代码库的比率显著低于人类审查员提出的建议。超过一半未被采纳的AI建议要么是错误的,要么被开发人员通过替代修复解决。当被采纳时,AI代理提供的建议导致代码复杂度和代码大小显著增加,而人类审查员的建议则没有。我们的发现表明,尽管AI代理可以扩展缺陷筛查,但人类监督仍对确保建议质量和提供AI代理缺乏的上下文反馈至关重要。

英文摘要:

Code review is a critical software engineering practice where developers review code changes before integration to ensure code quality, detect defects, and improve maintainability. In recent years, AI agents that can understand code context, plan review actions, and interact with development environments have been increasingly integrated into the code review process. However, there is limited empirical evidence to compare the effectiveness of AI agents and human reviewers in collaborative workflows. To address this gap, we conduct a large-scale empirical analysis of 278,790 code review conversations across 300 open-source GitHub projects. In our study, we aim to compare the feedback differences provided by human reviewers and AI agents. We investigate human-AI collaboration patterns in review conversations to understand how interaction shapes review outcomes. Moreover, we analyze the adoption of code suggestions provided by human reviewers and AI agents into the codebase and how adopted suggestions change code quality. We find that human reviewers provide additional feedback than AI agents, including understanding, testing, and knowledge transfer. Human reviewers exchange 11.8% more rounds when reviewing AI-generated code than human-written code. Moreover, code suggestions made by AI agents are adopted into the codebase at a significantly lower rate than suggestions proposed by human reviewers. Over half of unadopted suggestions from AI agents are either incorrect or addressed through alternative fixes by developers. When adopted, suggestions provided by AI agents produce significantly larger increases in code complexity and code size than suggestions provided by human reviewers. Our findings suggest that while AI agents can scale defect screening, human oversight remains critical for ensuring suggestion quality and providing contextual feedback that AI agents lack.

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

↑