Code review is a heavily collaborative process, which aims at ensuring the overall quality and reliability of software. While it provides massive benefits, the implementation of code review in an organization faces several challenges that make its automation appealing. Automated code review tools have been around for a while and are now improving thanks to the adoption of novel AI models, which help can learn about standard practices and systematically check that the reviewed code adheres to them. Unfortunately, existing methods fall short: they often target a single input-output generative model, which cannot simulate the collaboration interactions in code review to account for various perspectives; they are also sub-performing on various critical code review sub-tasks. In this paper, we advance the state of the art in code review automation by introducing CodeAgent, a novel multi-agent-based system for code review. Fundamentally, CodeAgent is steered by QA-Checker (short for ``Question-Answer Checking"), a supervision agent, designed specifically to ensure that all agents' contributions remain relevant to the initial review question. CodeAgent is autonomous, multi-agent, and Large language model-driven. To demonstrate the effectiveness of CodeAgent, we performed experiments to assess its capabilities in various tasks including 1) detection of inconsistencies between code changes and commit messages, 2) detection of vulnerability introduction by commits, and 3) validation of adherence to code style. Our website is accessed in \url{https://code-agent-new.vercel.app/index.html}.
翻译:代码审查是一个高度协作的过程,旨在确保软件的整体质量和可靠性。尽管它能带来诸多益处,但在组织中实施代码审查仍面临若干挑战,这使得其自动化变得颇具吸引力。自动化代码审查工具已存在一段时间,并因采用新型AI模型而不断改进,这些模型能够学习标准实践并系统性地检查所审查的代码是否符合这些实践。遗憾的是,现有方法存在不足:它们通常针对单一输入输出生成模型,无法模拟代码审查中的协作交互以涵盖不同视角;同时,它们在多项关键代码审查子任务上表现欠佳。本文通过引入CodeAgent——一种新颖的基于多智能体的代码审查系统,推动了代码审查自动化的前沿发展。从根本上讲,CodeAgent由QA-Checker(“问答验证”的缩写)监督智能体引导,该监督智能体专门设计用于确保所有智能体的贡献与初始审查问题保持相关。CodeAgent是自主的、多智能体的,并由大型语言模型驱动。为证明CodeAgent的有效性,我们开展了实验评估其在多项任务中的能力,包括:1)检测代码变更与提交消息之间的不一致性,2)检测提交引入的漏洞,以及3)验证代码风格遵循情况。我们的网站访问地址为:\url{https://code-agent-new.vercel.app/index.html}。