从以人为中心的代码审查到代理式代码审查:不同代际生成式人工智能技术对代码审查质量的影响
From Human-Centric to Agentic Code Review: The Impact of Different Generations of Generative AI Technology on Review Quality
摘要
代码审查有助于在代码整合之前保持软件质量,但也会给人工审核人员带来巨大的工作负担。随着生成式人工智能成为软件开发的一部分,代码审查已经从主要依赖人工审核的模式,转变为由大语言模型和人工智能代理参与的审核模式。不过,我们仍然缺乏关于这种转变对审核效率与质量影响的相关实证数据。本文研究了207个GitHub项目中的102万次代码审查记录,这些项目经历了三种不同的代码审查模式:以人为核心的审核、大语言模型辅助的审核以及由人工智能代理参与的审核。我们提出了三种人工智能审核应用模式:逐步引入人工智能、快速引入大语言模型以及快速引入人工智能代理。此外,我们将代码审查讨论过程视为审核人员之间的互动序列,从而能够了解人类、大语言模型和人工智能代理在审核过程中如何协作。研究结果表明,在逐步引入人工智能和快速引入人工智能代理的模式下,由人工智能代理发起或涉及多个人工智能代理的审核方式能够更快地做出审核决策。然而,这种效率提升并未带来更好的审核质量。我们还发现,无论处于哪种审核模式,代码审查活动和代码请求类型仍然非常重要;而一旦大语言模型和人工智能代理参与审核,人类与人工智能的协作模式就成为决定审核效率的关键因素。这些研究结果为设计能够提高效率而不降低审核质量的基于人工智能的代码审查模式提供了实证依据。
English Abstract
Code review helps maintain software quality before code integration, but it also imposes a substantial workload on human reviewers. As generative artificial intelligence becomes part of software development, code review is shifting from a primarily human review process toward AI-supported review processes in which large language model (LLM) reviewers and AI agent reviewers participate alongside human reviewers. However, we still lack empirical evidence on how this transition affects review efficiency and review quality. In this paper, we study 1.02 million reviewed pull requests from 207 GitHub projects that transition across three code review eras: human-centric review, LLM-assisted review, and agentic code review. We identify three AI reviewer adoption practices: Gradual AI Adoption, Rapid LLM Adoption, and Rapid AI Agent Adoption. We further model pull request review discussions as reviewer interaction sequences to characterize how human, LLM, and AI agent reviewers collaborate during the review process. Our results show that agent-involved collaboration patterns, especially reviews initiated by AI agents or involving multiple AI agents, are associated with faster review decisions under Gradual AI Adoption and Rapid AI Agent Adoption. However, these efficiency gains do not translate into better review quality. We also find that review activity and pull request type remain important across eras, while human-AI collaboration patterns become the strongest explanatory factor for review efficiency once LLM and AI agent reviewers participate. These findings provide empirical guidance for designing AI-supported code review processes that improve efficiency without weakening review quality.