代码审查中代码变更恢复的经验研究
作者:
作者单位:

作者简介:

王青叶(1989-),女,博士,CCF专业会员,主要研究领域为经验软件工程,软件仓库挖掘;
李善平(1963-),男,博士,教授,博士生导师,CCF高级会员,主要研究领域为分布式计算,软件工程,Linux内核;
万志远(1984-),女,博士,副教授,CCF会员,CCF专业会员,主要研究领域为软件工程;
夏鑫(1986-),男,博士,讲师,博士生导师,CCF专业会员,主要研究领域为经验软件工程,软件仓库挖掘.

通讯作者:

万志远,E-mail:wanzhiyuan@zju.edu.cn

中图分类号:

基金项目:

国家重点研发计划(2020YFB1005400);浙江省重点研发计划(2021C01014)


Empirical Study on Restored Code Changes in Code Review
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    代码审查是一种由其他开发者而非代码作者本人评审代码的形式.在代码审查系统中,开发者通过提交代码变更来修复软件缺陷或添加软件特性.并非所有的代码变更都会被集成到代码库中,部分代码变更会被拒收.被拒收的代码变更有可能被恢复,并继续接受审查,提供代码贡献者改进代码变更的机会.然而,审查恢复过的代码变更需要花费更多的时间.收集了4个开源项目中的920 700条代码变更,采用主题分析方法识别出11类代码变更恢复的原因,并定量分析被恢复的代码变更的特征.主要发现包括:1)导致代码变更恢复的原因中,“提升改进”类型占比最大;2)不同项目之间,代码变更被恢复的原因类别分布存在差异,但并不显著;3)与从未恢复过的代码变更相比,恢复的代码变更接收率低10%,评论数量平均多1.9倍,审查所用时间平均多5.8倍;4)81%的恢复代码变更被接收,19%的恢复代码变更被拒收.

    Abstract:

    Code review is manual inspection of source code by developers other than the author. In a code review system, software developers submit code changes to fix software defects or add software features. Not all of the code changes will be integrated into the code base. Some of the code changes will be abandoned. The abandoned code changes could be restored for review, which allows contributors to further improve the code changes. However, it takes more time to review the restored code changes. This study collects 920 700 restored code changes from four open-source projects, investigates reasons for which code changes have been restored, uses thematic analysis method to identify 11 categories of reasons for restoring code changes, and quantitatively analyzes the characteristics of restored code changes. The main findings are as followings. (1) Among the reasons for which code changes are restored, the reason “improve and update” accounts for the largest proportion. (2) The distribution of reasons across the four projects are different, but the difference is not significant. (3) Compared with non-restored code changes, restored code changes have a 10% lower acceptance rate, 1.9 times more comments, and 5.8 times longer review time on average. (4) 81% of restored code changes has been accepted, while 19% of them has still been abandoned.

    参考文献
    相似文献
    引证文献
引用本文

王青叶,万志远,李善平,夏鑫.代码审查中代码变更恢复的经验研究.软件学报,2022,33(7):2581-2598

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2020-09-17
  • 最后修改日期:2021-01-06
  • 录用日期:
  • 在线发布日期: 2021-08-02
  • 出版日期: 2022-07-06
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号