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

使用预训练的模型来提高代码审查自动化

Using Pre-Trained Models to Boost Code Review Automation

Rosalia Tufano, Simone Masiero, Antonio Mastropaolo, Luca Pascarella, Denys Poshyvanyk, Gabriele Bavota

摘要:

代码审查是开源和工业项目中广泛采用的一种做法。考虑到这样一个过程的不可忽视的成本,研究人员开始研究自动化特定代码审查任务的可能性。我们最近提出了深度学习(DL)模型,目标是两个任务的自动化:第一个模型将提交供审查的代码作为输入,并在其中实现可能由审查者推荐的更改;第二个模型将提交的代码和以自然语言发布的审查者评论作为输入,并自动实现审查者所需的更改。虽然我们取得的初步结果是令人鼓舞的,这两个模型都在相当简单的代码审查场景中进行了测试,大大简化了目标问题。这也是由于我们在设计技术和实验时所做的选择。在本文中,我们在这项工作的基础上,通过证明预先训练的文本到文本传输Transformer(T5)模型可以优于以前的DL模型来自动执行代码审查任务。此外,我们在更大、更现实(也更有挑战性)的代码评审活动数据集上进行了实验。

英文摘要:

Code review is a practice widely adopted in open source and industrial projects. Given the non-negligible cost of such a process, researchers started investigating the possibility of automating specific code review tasks. We recently proposed Deep Learning (DL) models targeting the automation of two tasks: the first model takes as input a code submitted for review and implements in it changes likely to be recommended by a reviewer; the second takes as input the submitted code and a reviewer comment posted in natural language and automatically implements the change required by the reviewer. While the preliminary results we achieved are encouraging, both models had been tested in rather simple code review scenarios, substantially simplifying the targeted problem. This was also due to the choices we made when designing both the technique and the experiments. In this paper, we build on top of that work by demonstrating that a pre-trained Text-To-Text Transfer Transformer (T5) model can outperform previous DL models for automating code review tasks. Also, we conducted our experiments on a larger and more realistic (and challenging) dataset of code review activities.

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

↑