论文标题

Review4Repair:代码评论帮助自动程序维修

Review4Repair: Code Review Aided Automatic Program Repairing

论文作者

Huq, Faria, Hasan, Masum, Pantho, Mahim Anzum Haque, Mahbub, Sazan, Iqbal, Anindya, Ahmed, Toufique

论文摘要

上下文:基于学习的自动程序维修技术显示出有望为软件源代码中检测到的错误提供质量修复建议。这些工具大多利用了错误和固定代码更改的历史数据,并且在应用于新代码的同时很大程度上取决于错误本地化。随着代码综述的日益普及,可以减少对错误本地化的依赖性。此外,基于代码审查的错误本地化更为值得信赖,因为这些建议反映了审阅者的专业知识和经验。 目的:评论评论上脚本的自然语言指令是有关该错误性质和预期解决方案的巨大信息来源。但是,据我们所知,基于学习的工具都没有利用评论评论来修复编程错误。在这项研究中,我们使用代码审核评论研究了维修技术的性能提高。 方法:我们在55,060个代码审查和相关代码更改上训练序列到序列模型。我们还介绍了新的混合化和预处理方法,有助于对基于最先进的学习维修技术实现重大改进。 结果:我们将TOP-1的准确性提高了20.33%,前十名的精度提高了34.82%。我们可以为先前技术未解决的文体和非代码错误提供建议。 结论:我们认为,自动修复建议以及我们的方法生成的代码审查将有助于开发人员快速,正确地解决评论评论,从而节省他们的时间和精力。

Context: Learning-based automatic program repair techniques are showing promise to provide quality fix suggestions for detected bugs in the source code of the software. These tools mostly exploit historical data of buggy and fixed code changes and are heavily dependent on bug localizers while applying to a new piece of code. With the increasing popularity of code review, dependency on bug localizers can be reduced. Besides, the code review-based bug localization is more trustworthy since reviewers' expertise and experience are reflected in these suggestions. Objective: The natural language instructions scripted on the review comments are enormous sources of information about the bug's nature and expected solutions. However, none of the learning-based tools has utilized the review comments to fix programming bugs to the best of our knowledge. In this study, we investigate the performance improvement of repair techniques using code review comments. Method: We train a sequence-to-sequence model on 55,060 code reviews and associated code changes. We also introduce new tokenization and preprocessing approaches that help to achieve significant improvement over state-of-the-art learning-based repair techniques. Results: We boost the top-1 accuracy by 20.33% and top-10 accuracy by 34.82%. We could provide a suggestion for stylistics and non-code errors unaddressed by prior techniques. Conclusion: We believe that the automatic fix suggestions along with code review generated by our approach would help developers address the review comment quickly and correctly and thus save their time and effort.

扫码加入交流群

加入微信交流群

微信交流群二维码

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