期刊文献+

代码审查中代码变更恢复的经验研究

Empirical Study on Restored Code Changes in Code Review
下载PDF
导出
摘要 代码审查是一种由其他开发者而非代码作者本人评审代码的形式.在代码审查系统中,开发者通过提交代码变更来修复软件缺陷或添加软件特性.并非所有的代码变更都会被集成到代码库中,部分代码变更会被拒收.被拒收的代码变更有可能被恢复,并继续接受审查,提供代码贡献者改进代码变更的机会.然而,审查恢复过的代码变更需要花费更多的时间.收集了4个开源项目中的920700条代码变更,采用主题分析方法识别出11类代码变更恢复的原因,并定量分析被恢复的代码变更的特征.主要发现包括:1)导致代码变更恢复的原因中,“提升改进”类型占比最大;2)不同项目之间,代码变更被恢复的原因类别分布存在差异,但并不显著;3)与从未恢复过的代码变更相比,恢复的代码变更接收率低10%,评论数量平均多1.9倍,审查所用时间平均多5.8倍;4)81%的恢复代码变更被接收,19%的恢复代码变更被拒收. 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 920700 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.9times 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.
作者 王青叶 万志远 李善平 夏鑫 WANG Qing-Ye;WAN Zhi-Yuan;LI Shan-Ping;XIA Xin(College of Computer Science and Technology,Zhejiang University,Hangzhou 310007,China;Faculty of Information Technology,Monash University,Melbourne,VIC 3800,Australia)
出处 《软件学报》 EI CSCD 北大核心 2022年第7期2581-2598,共18页 Journal of Software
基金 国家重点研发计划(2020YFB1005400) 浙江省重点研发计划(2021C01014)
关键词 代码审查 代码变更 代码变更拒收 代码变更恢复 经验研究 code review code change abandoned code change restored code change empirical study
  • 相关文献

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部