arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2208.08014cs.SE
收藏

AUGER:使用预训练模型自动生成评审意见

AUGER: Automatically Generating Review Comments with Pre-training Models

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

摘要:

代码审查是最佳实践之一,是软件质量的有力保障。在实践中,高级或高技能的评审员检查源代码并提供建设性的评论,考虑作者可能忽略的内容,例如一些特殊情况。贡献者之间的协作验证导致代码高度合格,错误的机会更少。然而,由于个人知识的有限性和多样性,代码审查实践的效率和有效性值得进一步提高。事实上,提出有用的审查意见仍然需要作出巨大和耗时的努力。本文探讨了多个实际的审查意见,以加强代码审查的协同作用,并提出了AUGER(自动生成审查意见):一个审查意见生成器与预训练模型。我们首先从11个著名的Java项目中收集经验性的评审数据,并构建了一个包含10,882个代码更改的数据集。通过利用文本到文本传输Transformer(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.

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

↑