Automating code review activities by large-scale pre-training
Zhiyu Li, Shuai Lu, Daya Guo, Nan Duan, Shailesh Jannu, Grant Jenks, Deep Majumder, Jared Green, Alexey Svyatkovskiy, Shengyu Fu, Neel Sundaresan
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.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
40 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- CodeBERT: A Pre-Trained Model for Programming and Natural Languages cites Learning and Evaluating Contextual Embedding of Source Code
- Learning and Evaluating Contextual Embedding of Source Code cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- CCT5: A Code-Change-Oriented Pre-trained Model cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- CCT5: A Code-Change-Oriented Pre-trained Model cites GraphCodeBERT: Pre-training Code Representations with Data Flow
- Multilingual Code Co-evolution using Large Language Models cites Using Pre-Trained Models to Boost Code Review Automation
- Multilingual Code Co-evolution using Large Language Models cites Language Models are Few-Shot Learners
- Exploring the Potential of ChatGPT in Automated Code Refinement: An Empirical Study cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Exploring the Potential of ChatGPT in Automated Code Refinement: An Empirical Study cites Using Pre-Trained Models to Boost Code Review Automation
- Exploring the Potential of ChatGPT in Automated Code Refinement: An Empirical Study cites GraphCodeBERT: Pre-training Code Representations with Data Flow
- Exploring the Potential of ChatGPT in Automated Code Refinement: An Empirical Study cites Language Models are Few-Shot Learners
- Gamma: Revisiting Template-Based Automated Program Repair Via Mask Prediction cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Gamma: Revisiting Template-Based Automated Program Repair Via Mask Prediction cites Language Models are Few-Shot Learners
Cited by top-tier papers40
- Exploring the Potential of ChatGPT in Automated Code Refinement: An Empirical StudyQi Guo, Junming Cao, Xiaofei Xie, Shangqing Liu et al.ICSE 2024 · 107 citations
- NExT: Teaching Large Language Models to Reason about Code ExecutionAnsong Ni, Miltiadis Allamanis, Arman Cohan, Yinlin Deng et al.ICML 2024 · 73 citations
- CCT5: A Code-Change-Oriented Pre-trained ModelBo Lin, Shangwen Wang, Zhongxin Liu, Yepang Liu et al.FSE 2023 · 69 citations
- Gamma: Revisiting Template-Based Automated Program Repair Via Mask PredictionQuanjun Zhang, Chunrong Fang, Tongke Zhang, Bowen Yu et al.ASE 2023 · 44 citations
- Multilingual Code Co-evolution using Large Language ModelsJiyang Zhang, Pengyu Nie, Junyi Jessy Li, Milos GligoricFSE 2023 · 34 citations
Builds on9
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan et al.EMNLP Findings 2020 · 2,828 citations
- GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng et al.ICLR 2021 · 1,644 citations
- Learning and Evaluating Contextual Embedding of Source CodeAditya Kanade, Petros Maniatis, Gogul Balakrishnan, Kensen ShiICML 2020 · 438 citations
- Using Pre-Trained Models to Boost Code Review AutomationRosalia Tufano, Simone Masiero, Antonio Mastropaolo, Luca Pascarella et al.ICSE 2022 · 149 citations
Related papers
- CoditT5: Pretraining for Source Code and Natural Language EditingJiyang Zhang, Sheena Panthaplackel, Pengyu Nie, Junyi Jessy Li et al.ASE 2022 · 81 citations
- Towards Automating Code Review ActivitiesRosalia Tufano, Luca Pascarella, Michele Tufano, Denys Poshyvanyk et al.ICSE 2021 · 4 citations
- Improving the Learning of Code Review Successive Tasks with Cross-Task Knowledge DistillationOussama Ben Sghaier, Houari A. SahraouiFSE 2024 · 9 citations
- AUGER: automatically generating review comments with pre-training modelsLingwei Li, Li Yang, Huaxi Jiang, Jun Yan et al.FSE 2022 · 56 citations
- CodeReviewQA: The Code Review Comprehension Assessment for Large Language ModelsHong Yi Lin, Chunhua Liu, Haoyu Gao, Patanamon Thongtanunam et al.ACL Findings 2025 · 7 citations
