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

Review4Repair:代码评审辅助的自动程序修复

Review4Repair: Code Review Aided Automatic Program Repairing

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

摘要:

内容:基于学习的自动程序修复技术有望为软件源代码中检测到的错误提供质量修复建议。这些工具主要利用错误和修复代码更改的历史数据,并且在应用于新代码时严重依赖错误定位器。随着代码审查的日益普及,对bug定位器的依赖可以减少。此外,基于代码评审的错误定位更值得信赖,因为评审员的专业知识和经验反映在这些建议中。目的:评审评论中的自然语言说明是关于bug的性质和预期解决方案的大量信息来源。然而,据我们所知,没有一个基于学习的工具利用评审注释来修复编程错误。在这项研究中,我们调查的性能改善修复技术使用代码审查意见。方法:我们对55,060个代码评审和相关的代码变更进行了序列到序列模型的训练。我们还介绍了新的标记化和预处理方法,这些方法有助于实现对最先进的基于学习的修复技术的显着改进。结果:我们将前1名的准确率提高了20.33%,前10名的准确率提高了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.

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

↑