论文标题
小型代码更改是否更快地合并?多语言实证研究
Do Small Code Changes Merge Faster? A Multi-Language Empirical Investigation
论文作者
论文摘要
代码速度或将代码更改集成到生产环境中的速度,在连续集成和连续部署中起着至关重要的作用。许多研究报告了影响代码速度的因素。但是,增加代码速度的解决方案尚不清楚。同时,该行业继续发布有关“理想”代码变化规模的准则,认为尽管缺乏证据来验证这种做法,但它仍会提高代码速度。令人惊讶的是,迄今为止尚未研究这个基本问题。这项研究通过优化拉的请求尺寸和组成(插入,删除和修改的比率)来调查改善代码速度的实用性。我们从一个假设开始,即拉的请求大小和合并时间之间存在中等相关性。我们从Github上选择了100种最受欢迎的,积极开发的项目。我们分析了按大小,组成和上下文分析了845,316个拉的请求的数据集,以探索其与合并时间的关系 - 衡量代码速度的代理。我们的研究表明,拉的请求尺寸和成分与合并时间无关。不管可以影响拉的请求大小或组成(例如编程语言)的上下文因素,该观察结果都会存在。从其他两个平台中拉出请求数据:Gerrit和Phabricator(401,790代码评论)证实了缺乏关系。这种负面结果是“ ...消除无用的假设……”,通过表明小型代码更改并不更快地合并以提高代码速度,从而挑战了广泛的信念。
Code velocity, or the speed with which code changes are integrated into a production environment, plays a crucial role in Continuous Integration and Continuous Deployment. Many studies report factors influencing code velocity. However, solutions to increase code velocity are unclear. Meanwhile, the industry continues to issue guidelines on "ideal" code change size, believing it increases code velocity despite lacking evidence validating the practice. Surprisingly, this fundamental question has not been studied to date. This study investigates the practicality of improving code velocity by optimizing pull request size and composition (ratio of insertions, deletions, and modifications). We start with a hypothesis that a moderate correlation exists between pull request size and time-to-merge. We selected 100 most popular, actively developed projects from 10 programming languages on GitHub. We analyzed our dataset of 845,316 pull requests by size, composition, and context to explore its relationship to time-to-merge - a proxy to measure code velocity. Our study shows that pull request size and composition do not relate to time-to-merge. Regardless of the contextual factors that can influence pull request size or composition (e.g., programming language), the observation holds. Pull request data from two other platforms: Gerrit and Phabricator (401,790 code reviews) confirms the lack of relationship. This negative result as in "... eliminate useless hypotheses ..." challenges a widespread belief by showing that small code changes do not merge faster to increase code velocity.