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

基于重构的拉式请求的实证研究

An Empirical Study on Refactoring-Inducing Pull Requests

Flávia Coelho, Nikolaos Tsantalis, Tiago Massoni, Everton L. G. Alves

摘要:

背景资料:基于拉式的开发塑造了现代代码审查(MCR)的实践,其中审查者可以通过拉式请求(PR)中的注释和提交来贡献代码改进,例如重构。过去的MCR研究统一对待所有的PR,不管它们是否引起重构。我们将PR定义为重构诱导,即在初始提交后执行重构编辑,这是审阅者之间讨论的结果,也是PR开发人员自发采取的行动。目的:这项混合研究(定量和定性)探讨了代码审查相关的方面,旨在表征重构诱导PR。方法:我们假设,重构诱导PR有不同的特点比非重构诱导的,因此值得特别关注和治疗的研究人员,从业者和工具建设者。为了研究我们的假设,我们从GitHub中挖掘了1,845个Apache合并PR的样本,挖掘了这些PR中的重构编辑,并对重构诱导PR和非重构诱导PR进行了比较研究。我们还手动检查了2,096条评论,并从228个重构诱导PR中检测到1,891个重构。结果如下:我们在我们的样本中发现了30.2%的重构诱导PR,它们在提交数量、代码流失、文件更改数量、审查评论数量、讨论长度和合并时间方面与非重构诱导PR有显著差异。然而,我们没有发现统计证据表明,评论者的数量与重构诱导有关。我们的定性分析显示,至少有一个重构编辑引起的审查133(58.3%)的重构诱导PR检查。结论:我们的研究结果为研究人员,从业者和工具构建者提供了方向,以改善基于拉式代码审查的实践。

英文摘要:

Background: Pull-based development has shaped the practice of Modern Code Review (MCR), in which reviewers can contribute code improvements, such as refactorings, through comments and commits in Pull Requests (PRs). Past MCR studies uniformly treat all PRs, regardless of whether they induce refactoring or not. We define a PR as refactoring-inducing, when refactoring edits are performed after the initial commit(s), as either a result of discussion among reviewers or spontaneous actions carried out by the PR developer. Aims: This mixed study (quantitative and qualitative) explores code reviewing-related aspects intending to characterize refactoring-inducing PRs. Method: We hypothesize that refactoring-inducing PRs have distinct characteristics than non-refactoring-inducing ones and thus deserve special attention and treatment from researchers, practitioners, and tool builders. To investigate our hypothesis, we mined a sample of 1,845 Apache's merged PRs from GitHub, mined refactoring edits in these PRs, and ran a comparative study between refactoring-inducing and non-refactoring-inducing PRs. We also manually examined 2,096 review comments and 1,891 detected refactorings from 228 refactoring-inducing PRs. Results: We found 30.2% of refactoring-inducing PRs in our sample and that they significantly differ from non-refactoring-inducing ones in terms of number of commits, code churn, number of file changes, number of review comments, length of discussion, and time to merge. However, we found no statistical evidence that the number of reviewers is related to refactoring-inducement. Our qualitative analysis revealed that at least one refactoring edit was induced by review in 133 (58.3%) of the refactoring-inducing PRs examined. Conclusions: Our findings suggest directions for researchers, practitioners, and tool builders to improve practices around pull-based code review.

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

↑