arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.00517cs.SE
收藏

面向问题的基于智能体的自动化评审意见生成框架

Issue-Oriented Agent-Based Framework for Automated Review Comment Generation

Tianjin University(天津大学);The University of Melbourne(墨尔本大学);University of California Berkeley(加州大学伯克利分校)

Shuochuan Li, Dong Wang, Patanamon Thongtanunam, Zan Wang, Jiuqiao Yu, Junjie Chen

AI总结:

提出 RevAgent,一种基于智能体的面向问题的自动化代码评审意见生成框架,通过生成、判别、训练三阶段协同显著提升意见质量与问题识别准确率。

摘要:

代码审查(CR)是确保软件质量的关键实践。为简化这一劳动密集型过程,已有多种自动化评审意见生成技术被提出。然而,现有方法严重依赖单一模型来识别代码中的各类问题,限制了模型处理代码变更中多样化、特定问题性质的能力,导致生成的意见缺乏信息量,尤其在错误修复等复杂场景中更为明显。为解决这些局限性,我们提出了 RevAgent,一种新颖的基于智能体的面向问题框架,将任务分解为三个阶段:(1)生成阶段,五个特定类别的评论员智能体从不同问题视角分析代码变更并生成候选意见;(2)判别阶段,一个评论家智能体选择最合适的问题-意见对;(3)训练阶段,所有智能体在精选的特定类别数据上进行微调以增强任务专业化。评估结果显示,RevAgent 显著优于基于 PLM 和 LLM 的最先进基线,在 BLEU、ROUGE-L、METEOR 和 SBERT 上分别提升了 12.90%、10.87%、6.32% 和 8.57%。它还在问题类别识别上实现了相对更高的准确率,特别是在具有挑战性的场景中。人类评估进一步验证了 RevAgent 在生成准确、可读且具备上下文感知能力的评审意见方面的实用性。此外,RevAgent 在性能与效率之间实现了良好的权衡。

英文摘要:

Code review (CR) is a crucial practice for ensuring software quality. Various automated review comment generation techniques have been proposed to streamline the labor-intensive process. However, existing approaches heavily rely on a single model to identify various issues within the code, limiting the model's ability to handle the diverse, issue-specific nature of code changes and leading to non-informative comments, especially in complex scenarios such as bug fixes. To address these limitations, we propose RevAgent, a novel agent-based issue-oriented framework, decomposes the task into three stages: (1) Generation Stage, where five category-specific commentator agents analyze code changes from distinct issue perspectives and generate candidate comments; (2) Discrimination Stage, where a critic agent selects the most appropriate issue-comment pair; and (3) Training Stage, where all agents are fine-tuned on curated, category-specific data to enhance task specialization. Evaluation results show that RevAgent significantly outperforms state-of-the-art PLM- and LLM-based baselines, with improvements of 12.90\%, 10.87\%, 6.32\%, and 8.57\% on BLEU, ROUGE-L, METEOR, and SBERT, respectively. It also achieves relatively higher accuracy in issue-category identification, particularly for challenging scenarios. Human evaluations further validate the practicality of RevAgent in generating accurate, readable, and context-aware review comments. Moreover, RevAgent delivers a favorable trade-off between performance and efficiency.

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

↑