How does code style inconsistency affect pull request integration? An exploratory study on 117 GitHub projects

How does code style inconsistency affect pull request integration? An exploratory study on 117 GitHub projects
复制标题

DOI:
10.1007/s10664-019-09720-x
复制
发表时间:
2019-06
影响因子:
4.1
通讯作者:
W. Zou;J. Xuan;Xiaoyuan Xie;Zhenyu Chen;Baowen Xu
W. Zou;J. Xuan;Xiaoyuan Xie;Zhenyu Chen;Baowen Xu
中科院分区:
计算机科学2区
文献类型:
--
作者:
W. Zou;J. Xuan;Xiaoyuan Xie;Zhenyu Chen;Baowen Xu

文献摘要

被引文献

相似文献

GitHub是一个流行的代码平台,提供了促进协作开发的基础设施。Pull Request(PR)是支持协作的关键思想之一。我们鼓励开发人员提交PR,要求整合他们的贡献。在实践中,并不是所有提交的PR都可以被项目维护人员集成到代码库中。现有的研究已经调查了影响PR整合的因素。然而,PR的代码风格,这在很大程度上是由项目维护人员考虑,还没有深入研究。在本文中,我们对代码风格对GitHub中PR集成的影响进行了探索性分析。我们通过提交的PR与其目标代码库中的现有代码之间的不一致性来建模代码风格。这样的建模使得我们的研究不受代码风格的特定定义的限制。我们在117个Java项目中的50,092个关闭的PR上进行了实验。研究结果表明:(1)PR与代码库之间确实存在代码风格不一致。(2)关于如何使用空格或缩进、注释以及编写具有适当长度的代码行的几个代码风格标准往往会在PR之间显示出更多的不一致。(3)与当前代码风格一致的PR往往更容易合并到代码库中。(4)违反当前代码风格的PR可能需要更多时间才能关闭。我们的研究向开发人员展示了如何提供更好的贡献以促进高效协作的证据。
GitHub is a popular code platform that provides infrastructures to facilitate collaborative development. A Pull Request (PR) is one of the key ideas to support collaboration. Developers are encouraged to submit PRs to ask for the integration of their contributions. In practice, not all submitted PRs can be integrated into the codebase by project maintainers. Existing studies have investigated factors affecting PR integration. Nevertheless, the code style of PRs, which is largely considered by project maintainers, has not been deeply studied yet. In this paper, we performed an exploratory analysis on the effect of code style on PR integration in GitHub. We modeled the code style via the inconsistency between a submitted PR and the existing code in its target codebase. Such modeling makes our study not limited by a specific definition of code style. We conducted our experiments on 50,092 closed PRs in 117 Java projects. Our findings show that: (1) There indeed exists code style inconsistency between PRs and the codebase. (2) Several code style criteria on how to use spaces or indents, make comments, and write code lines with a suitable length, tend to show more inconsistency among PRs. (3) A PR that is consistent with the current code style tends to be merged into the codebase more easily. (4) A PR that violates the current code style is likely to take more time to get closed. Our study shows evidence to developers about how to deliver better contributions to facilitate efficient collaboration.