| 引用本文: | 王路桥,周洋涛,李青山,王铭康,徐子轩,崔笛,王璐,罗懿行.基于大语言模型的多智能体协作代码评审人推荐.软件学报,2025,36(6):2558-2575 |
| |
|
| |
|
|
| 本文已被:浏览 3249次 下载 2701次 |
 码上扫一扫! |
|
|
| 基于大语言模型的多智能体协作代码评审人推荐 |
|
王路桥1,2, 周洋涛1,2, 李青山1,2, 王铭康1,2, 徐子轩1,2, 崔笛1,2, 王璐1,2, 罗懿行3
|
|
1.西安电子科技大学 计算机科学与技术学院, 陕西 西安 710126;2.西安市智能软件工程重点实验室, 陕西 西安 710126;3.北京控制工程研究所, 北京 100094
|
|
| 摘要: |
| 基于拉取请求(pull request, PR)的软件开发机制是开源软件中的重要实践. 合适的代码评审人能够通过代码审查帮助贡献者及时发现PR中的潜在错误, 为持续开发和集成过程提供质量保障. 然而, 代码变更内容的复杂性以及评审行为固有的多样性增加了评审人推荐的难度. 现有方法主要聚焦于从PR中挖掘变更代码的语义信息, 或基于审查历史构建评审人画像, 并通过多种静态策略组合进行推荐. 这些研究受限于模型训练语料的丰富性以及交互类型的复杂性, 导致推荐性能不佳. 鉴于此, 提出一种基于智能体间相互协作的代码评审人推荐方法. 该方法利用先进的大语言模型, 精确捕捉PR和评审人丰富的文本语义信息. 此外, AI智能体强大的规划、协作和决策能力使其能够集成不同交互类型的信息, 具有高度的灵活性和适应性. 基于真实数据集进行实验分析, 与基线评审人推荐方法相比, 所提方法性能提升4.45%–26.04%. 此外, 案例研究证明, 所提方法在可解释性方面表现突出, 进一步验证了其在实际应用中的有效性和可靠性. |
| 关键词: 代码评审人推荐 基于智能体的软件工程 大型语言模型 代码审查 |
| DOI:10.13328/j.cnki.jos.007326 |
| 分类号: |
| 基金项目:国家自然科学基金(U21B2015, 62372351, 62402038); 陕西省科协青年人才托举计划(20220113); 江苏省自然科学基金(BK20232028); 西安电子科技大学杭州研究院概念验证基金(XJ2023230039) |
|
| Multi-agent Collaborative Code Reviewer Recommendation Based on Large Language Model |
|
WANG Lu-Qiao1,2, ZHOU Yang-Tao1,2, LI Qing-Shan1,2, WANG Ming-Kang1,2, XU Zi-Xuan1,2, CUI Di1,2, WANG Lu1,2, LUO Yi-Xing3
|
|
1.School of Computer Science and Technology, Xidian University, Xi’an 710126, China;2.Key Laboratory of Intelligent Software Engineering of Xi’an, Xi’an 710126, China;3.Beijing Institute of Control Engineering, Beijing 100094, China
|
| Abstract: |
| The pull request (PR)-based software development mechanism is of great significance in the practice of open-source software. Appropriate code reviewers can assist contributors in detecting potential errors in PRs through code review, thus providing quality assurance for the continuous development and integration process. However, the complexity of code change content and the inherent diversity of review behaviors enhance the difficulty of reviewer recommendation. The existing methods mainly concentrate on mining the semantic information of changed codes from PRs or constructing reviewer portraits based on review history and then making recommendations through various static strategy combinations. These studies are restricted by the richness of model training corpora and the complexity of interaction types, leading to unsatisfactory recommendation performance. Given this, this study proposes a novel code reviewer recommendation method based on inter-agent collaboration. This method utilizes advanced large language models to accurately capture the rich textual semantics information of PRs and reviewers. Moreover, the powerful planning, collaboration, and decision-making capabilities of AI agents enable the integration of information from different interaction types, possessing high flexibility and adaptability. The experimental analysis based on real datasets shows that compared with the baseline reviewer recommendation methods, the performance of the proposed method is improved by 4.45% to 26.04%. In addition, the case study proves that the proposed method has outstanding performance in interpretability, further verifying its effectiveness and reliability in practical applications. |
| Key words: code reviewer recommendation agent-based software engineering large language model (LLM) code review |
|
|
|
|