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

先到先得:文件位置对代码评审的影响

First Come First Served: The Impact of File Position on Code Review

Enrico Fregnan, Larissa Braz, Marco D'Ambros, Gül Çalikli, Alberto Bacchelli

摘要:

最流行的代码审查工具(例如,Gerrit和GitHub)按字母顺序呈现要查看的文件。这个选择,或者更一般地说,文件呈现的相对位置,是否会使代码评审的结果产生偏差?我们通过两步研究中的三角互补证据来调查这一假设。首先,我们观察开发人员的代码审查活动。我们分析了来自GitHub上138个流行Java项目的219,476个Pull Request(PR)的评论。我们发现PR中较早显示的文件比较晚显示的文件收到更多评论,并且在控制可能的混淆因素时也是如此:讨论线程或添加到文件中的行的存在。其次,我们衡量的影响,文件的位置缺陷发现代码审查。招募106名参与者,我们进行了一个在线对照实验,在这个实验中,我们测量了参与者在检测两个不相关的缺陷时的表现。参与者被分配到两个治疗之一,其中有缺陷的文件的位置被切换。对于一种类型的缺陷,参与者不受其文件位置的影响;对于另一种类型的缺陷,当其文件是最后一个而不是第一个时,他们识别它的几率要低64%。总体而言,我们的研究结果提供的证据表明,文件的相对位置对代码审查的结果有影响,我们讨论了这些结果和工具设计和代码审查的影响。数据和材料:https://doi.org/10.5281/zenodo.6901285

英文摘要:

The most popular code review tools (e.g., Gerrit and GitHub) present the files to review sorted in alphabetical order. Could this choice or, more generally, the relative position in which a file is presented bias the outcome of code reviews? We investigate this hypothesis by triangulating complementary evidence in a two-step study. First, we observe developers' code review activity. We analyze the review comments pertaining to 219,476 Pull Requests (PRs) from 138 popular Java projects on GitHub. We found files shown earlier in a PR to receive more comments than files shown later, also when controlling for possible confounding factors: e.g., the presence of discussion threads or the lines added in a file. Second, we measure the impact of file position on defect finding in code review. Recruiting 106 participants, we conduct an online controlled experiment in which we measure participants' performance in detecting two unrelated defects seeded into two different files. Participants are assigned to one of two treatments in which the position of the defective files is switched. For one type of defect, participants are not affected by its file's position; for the other, they have 64% lower odds to identify it when its file is last as opposed to first. Overall, our findings provide evidence that the relative position in which files are presented has an impact on code reviews' outcome; we discuss these results and implications for tool design and code review. Data and materials: https://doi.org/10.5281/zenodo.6901285

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

↑