论文标题

螺旋钻:使用预训练模型自动生成评论评论

AUGER: Automatically Generating Review Comments with Pre-training Models

论文作者

Li, Lingwei, Yang, Li, Jiang, Huaxi, Yan, Jun, Luo, Tiejian, Hua, Zihan, Liang, Geng, Zuo, Chun

论文摘要

代码审查是对软件质量的强大保障措施的最佳实践之一。在实践中,高级或高科技审稿人会检查源代码并提供建设性的评论,例如作者可能会忽略哪些特殊情况。贡献者之间的协作验证导致代码具有很高的资格,并且错误的机会更少。但是,由于个人知识是有限的,并且有所不同,因此代码审查实践的效率和有效性值得进一步改进。实际上,仍需要巨大且耗时的努力来提供有用的评论评论。本文探讨了多次实用评论的协同作用,以增强代码审查并提出了螺旋钻(自动生成评论评论):带有预训练模型的评论评论生成器。我们首先从11个著名Java项目中收集经验审查数据,并构建一个10,882代码更改的数据集。通过利用文本到文本传输变压器(T5)模型,该框架在训练阶段综合了有价值的知识,并在Rouge-L中有效地超过了37.38%。根据先前的研究,我们有29%的自动审查评论被认为是有用的。该推论仅在20秒内生成,也可以进一步培训。此外,在案例研究中彻底分析时,性能也得到了改善。

Code review is one of the best practices as a powerful safeguard for software quality. In practice, senior or highly skilled reviewers inspect source code and provide constructive comments, considering what authors may ignore, for example, some special cases. The collaborative validation between contributors results in code being highly qualified and less chance of bugs. However, since personal knowledge is limited and varies, the efficiency and effectiveness of code review practice are worthy of further improvement. In fact, it still takes a colossal and time-consuming effort to deliver useful review comments. This paper explores a synergy of multiple practical review comments to enhance code review and proposes AUGER (AUtomatically GEnerating Review comments): a review comments generator with pre-training models. We first collect empirical review data from 11 notable Java projects and construct a dataset of 10,882 code changes. By leveraging Text-to-Text Transfer Transformer (T5) models, the framework synthesizes valuable knowledge in the training stage and effectively outperforms baselines by 37.38% in ROUGE-L. 29% of our automatic review comments are considered useful according to prior studies. The inference generates just in 20 seconds and is also open to training further. Moreover, the performance also gets improved when thoroughly analyzed in case study.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源