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} 访问。