代码审查中代码变更恢复的经验研究  被引量:2

Empirical Study on Restored Code Changes in Code Review

在线阅读下载全文

作  者:王青叶 万志远[1] 李善平[1] 夏鑫 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)

机构地区:[1]浙江大学计算机科学与技术学院,浙江杭州310007 [2]Faculty of Information Technology,Monash University,Melbourne,VIC 3800,Australia

出  处:《软件学报》2022年第7期2581-2598,共18页Journal of Software

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

摘  要:代码审查是一种由其他开发者而非代码作者本人评审代码的形式.在代码审查系统中,开发者通过提交代码变更来修复软件缺陷或添加软件特性.并非所有的代码变更都会被集成到代码库中,部分代码变更会被拒收.被拒收的代码变更有可能被恢复,并继续接受审查,提供代码贡献者改进代码变更的机会.然而,审查恢复过的代码变更需要花费更多的时间.收集了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.

关 键 词:代码审查 代码变更 代码变更拒收 代码变更恢复 经验研究 

分 类 号:TP311.52[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象