paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Automating code review activities by large-scale pre-training

通过大规模预训练自动化代码审查活动
FSE Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2022匹配度 3/10 · 该论文将预训练模型用于代码审查自动化,属于软件工程与机器学习的交叉,但与用户核心关注的静态分析、形式化验证、浮点程序分析、贝叶斯程序分析以及 Agentic 程序分析均无直接关系。其目标更偏向代码审查任务本身,而非用 LLM/Agent 改进静态分析或验证。引用 189 inbox
Zhiyu Li, Shuai Lu, Daya Guo, Nan Duan, Shailesh Jannu, Grant Jenks, Deep Majumder, Jared Green, Alexey Svyatkovskiy, Shengyu Fu, Neel Sundaresan
crossref: 2026-09-12

AI 速览

一句话:提出面向代码审查的预训练模型 CodeReviewer 与四个预训练任务,在变更质量估计、评论生成和代码精化上取得最优结果。

代码审查是保障软件质量的关键环节,但开发者需要查看、理解甚至运行代码来评估逻辑、功能、延迟和风格等,耗时巨大,因此自动化需求迫切。本文收集九种最流行编程语言开源项目中的大规模真实代码变更与审查数据,提出 CodeReviewer 预训练模型,并设计四个专门面向代码审查场景的预训练任务。为评估模型,作者围绕代码审查活动构建三个关键任务的高质量基准:代码变更质量估计、审查评论生成和代码精化,并进行全面实验。结果表明,该模型在所有任务上均优于此前的先进预训练方法;进一步分析显示,所提出的预训练任务与多语言预训练数据集有助于模型理解代码变更和审查。

问题
现代代码审查要求开发者投入大量时间理解代码变更并评估其质量、功能与风格,自动化代码审查流程具有强烈需求。
方法
收集九种流行语言开源项目的大规模真实代码变更与审查数据,提出 CodeReviewer 预训练模型,并设计四个面向代码审查场景的预训练任务。
评估
在代码变更质量估计、审查评论生成和代码精化三个任务上构建高质量基准并开展全面实验,结果显示模型在所有任务上均超越此前最先进的预训练方法,且预训练任务与多语言数据带来增益。
原文摘要(Abstract)

Code review is an essential part to software development lifecycle since it aims at guaranteeing the quality of codes. Modern code review activities necessitate developers viewing, understanding and even running the programs to assess logic, functionality, latency, style and other factors. It turns out that developers have to spend far too much time reviewing the code of their peers. Accordingly, it is in significant demand to automate the code review process. In this research, we focus on utilizing pre-training techniques for the tasks in the code review scenario. We collect a large-scale dataset of real-world code changes and code reviews from open-source projects in nine of the most popular programming languages. To better understand code diffs and reviews, we propose CodeReviewer, a pre-trained model that utilizes four pre-training tasks tailored specifically for the code review scenario. To evaluate our model, we focus on three key tasks related to code review activities, including code change quality estimation, review comment generation and code refinement. Furthermore, we establish a high-quality benchmark dataset based on our collected data for these three tasks and conduct comprehensive experiments on it. The experimental results demonstrate that our model outperforms the previous state-of-the-art pre-training approaches in all tasks. Further analysis show that our proposed pre-training tasks and the multilingual pre-training dataset benefit the model on the understanding of code changes and reviews.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot7144,
  title = {Automating code review activities by large-scale pre-training},
  author = {Zhiyu Li and Shuai Lu and Daya Guo and Nan Duan and Shailesh Jannu and Grant Jenks and Deep Majumder and Jared Green and Alexey Svyatkovskiy and Shengyu Fu and Neel Sundaresan},
  booktitle = {FSE},
  year = {2022},
  doi = {10.1145/3540250.3549081}
}