论文标题

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

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

论文作者

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

论文摘要

最受欢迎的代码审查工具(例如Gerrit和Github)提出了要按字母顺序排序的文件。这个选择或更一般而言,表明文件的相对位置是否可以偏向代码审查的结果?我们在两步研究中通过三角辅助证据进行了三角调节,研究了这一假设。 首先,我们观察开发人员的代码审查活动。我们分析了来自Github上138个流行Java项目的219,476次拉请求(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

扫码加入交流群

加入微信交流群

微信交流群二维码

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