Leveraging Reviewer Experience in Code Review Comment Generation

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Lin, Hong Yi, Thongtanunam, Patanamon, Treude, Christoph, Godfrey, Michael W., Liu, Chunhua, Charoenwet, Wachiraphan
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866918124530434048
author Lin, Hong Yi
Thongtanunam, Patanamon
Treude, Christoph
Godfrey, Michael W.
Liu, Chunhua
Charoenwet, Wachiraphan
author_facet Lin, Hong Yi
Thongtanunam, Patanamon
Treude, Christoph
Godfrey, Michael W.
Liu, Chunhua
Charoenwet, Wachiraphan
contents Modern code review is a ubiquitous software quality assurance process aimed at identifying potential issues within newly written code. Despite its effectiveness, the process demands large amounts of effort from the human reviewers involved. To help alleviate this workload, researchers have trained deep learning models to imitate human reviewers in providing natural language code reviews. Formally, this task is known as code review comment generation. Prior work has demonstrated improvements in this task by leveraging machine learning techniques and neural models, such as transfer learning and the transformer architecture. However, the quality of the model generated reviews remain sub-optimal due to the quality of the open-source code review data used in model training. This is in part due to the data obtained from open-source projects where code reviews are conducted in a public forum, and reviewers possess varying levels of software development experience, potentially affecting the quality of their feedback. To accommodate for this variation, we propose a suite of experience-aware training methods that utilise the reviewers' past authoring and reviewing experiences as signals for review quality. Specifically, we propose experience-aware loss functions (ELF), which use the reviewers' authoring and reviewing ownership of a project as weights in the model's loss function. Through this method, experienced reviewers' code reviews yield larger influence over the model's behaviour. Compared to the SOTA model, ELF was able to generate higher quality reviews in terms of accuracy, informativeness, and comment types generated. The key contribution of this work is the demonstration of how traditional software engineering concepts such as reviewer experience can be integrated into the design of AI-based automated code review models.
format Preprint
id arxiv_https___arxiv_org_abs_2409_10959
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Leveraging Reviewer Experience in Code Review Comment Generation
Lin, Hong Yi
Thongtanunam, Patanamon
Treude, Christoph
Godfrey, Michael W.
Liu, Chunhua
Charoenwet, Wachiraphan
Software Engineering
Machine Learning
Modern code review is a ubiquitous software quality assurance process aimed at identifying potential issues within newly written code. Despite its effectiveness, the process demands large amounts of effort from the human reviewers involved. To help alleviate this workload, researchers have trained deep learning models to imitate human reviewers in providing natural language code reviews. Formally, this task is known as code review comment generation. Prior work has demonstrated improvements in this task by leveraging machine learning techniques and neural models, such as transfer learning and the transformer architecture. However, the quality of the model generated reviews remain sub-optimal due to the quality of the open-source code review data used in model training. This is in part due to the data obtained from open-source projects where code reviews are conducted in a public forum, and reviewers possess varying levels of software development experience, potentially affecting the quality of their feedback. To accommodate for this variation, we propose a suite of experience-aware training methods that utilise the reviewers' past authoring and reviewing experiences as signals for review quality. Specifically, we propose experience-aware loss functions (ELF), which use the reviewers' authoring and reviewing ownership of a project as weights in the model's loss function. Through this method, experienced reviewers' code reviews yield larger influence over the model's behaviour. Compared to the SOTA model, ELF was able to generate higher quality reviews in terms of accuracy, informativeness, and comment types generated. The key contribution of this work is the demonstration of how traditional software engineering concepts such as reviewer experience can be integrated into the design of AI-based automated code review models.
title Leveraging Reviewer Experience in Code Review Comment Generation
topic Software Engineering
Machine Learning
url https://arxiv.org/abs/2409.10959