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