现代代码审查中合并与放弃代码更改的早期预测
Early Prediction for Merged vs Abandoned Code Changes in Modern Code Reviews
摘要:
现代代码评审过程是当前软件开发实践的一个组成部分。这里付出了相当大的努力来检查代码更改,发现缺陷,提出改进建议,并处理评审人员的建议。在代码审查过程中,通常会进行多次迭代,作者提交代码更改,审查者提供反馈,直到乐于接受更改。在大约12%的情况下,更改被放弃,最终浪费了所有的努力。在这项研究中,我们的目标是设计一个工具,可以预测代码更改是否会在早期阶段被合并或放弃,以减少所有利益相关者(例如,程序作者、评审员、项目管理人员等)涉案Fan等人的一项研究正式确定了现实世界对此类工具的需求。[1]。我们已经从三个大型和流行的开源软件的代码审查中挖掘了146,612个代码更改,并训练和测试了一套基于浅层和深度学习的监督机器学习分类器。在模型的训练和测试过程中,我们在每次代码更改中总共考虑了25个功能。性能最好的模型名为PredCR(预测代码审查),一个基于LightGBM的分类器平均达到约85%的AUC分数,并相对提高了14- 23%的最新技术水平。在我们对来自三个软件项目的146,612个代码更改的实证研究中,我们发现(1)PredCR中引入的审阅者维度等新功能信息量最大。(2)与基线相比,PredCR更有效地减少了对新开发者的偏见。(3)PredCR使用代码评审存储库中的历史数据,因此,随着软件系统使用新的和更多的数据而发展,PredCR的性能也会提高。
英文摘要:
The modern code review process is an integral part of the current software development practice. Considerable effort is given here to inspect code changes, find defects, suggest an improvement, and address the suggestions of the reviewers. In a code review process, usually, several iterations take place where an author submits code changes and a reviewer gives feedback until is happy to accept the change. In around 12% cases, the changes are abandoned, eventually wasting all the efforts. In this research, our objective is to design a tool that can predict whether a code change would be merged or abandoned at an early stage to reduce the waste of efforts of all stakeholders (e.g., program author, reviewer, project management, etc.) involved. The real-world demand for such a tool was formally identified by a study by Fan et al. [1]. We have mined 146,612 code changes from the code reviews of three large and popular open-source software and trained and tested a suite of supervised machine learning classifiers, both shallow and deep learning based. We consider a total of 25 features in each code change during the training and testing of the models. The best performing model named PredCR (Predicting Code Review), a LightGBM-based classifier achieves around 85% AUC score on average and relatively improves the state-of-the-art [1] by 14-23%. In our empirical study on the 146,612 code changes from the three software projects, we find that (1) The new features like reviewer dimensions that are introduced in PredCR are the most informative. (2) Compared to the baseline, PredCR is more effective towards reducing bias against new developers. (3) PredCR uses historical data in the code review repository and as such the performance of PredCR improves as a software system evolves with new and more data.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。