Code review plays an important role in software quality control. A typical review process would involve a careful check of a piece of code in an attempt to find defects and other quality issues/violations. One type of issues that may impact the quality of the software is code smells - i.e., bad programming practices that may lead to defects or maintenance issues. Yet, little is known about the extent to which code smells are identified during code reviews. To investigate the concept behind code smells identified in code reviews and what actions reviewers suggest and developers take in response to the identified smells, we conducted an empirical study of code smells in code reviews using the two most active OpenStack projects (Nova and Neutron). We manually checked 19,146 review comments obtained by keywords search and random selection, and got 1,190 smell-related reviews to study the causes of code smells and actions taken against the identified smells. Our analysis found that 1) code smells were not commonly identified in code reviews, 2) smells were usually caused by violation of coding conventions, 3) reviewers usually provided constructive feedback, including fixing (refactoring) recommendations to help developers remove smells, and 4) developers generally followed those recommendations and actioned the changes. Our results suggest that 1) developers should closely follow coding conventions in their projects to avoid introducing code smells, and 2) review-based detection of code smells is perceived to be a trustworthy approach by developers, mainly because reviews are context-sensitive (as reviewers are more aware of the context of the code given that they are part of the project's development team).


翻译:守则审查在软件质量控制中起着重要作用。典型的审查过程将涉及仔细检查守则的一部分,以查找缺陷和其他质量问题/违规情况。一种可能影响到软件质量的问题是代码气味----即可能导致缺陷或维护问题的不良编程做法;然而,对于守则在代码审查中发现编码气味的程度知之甚少。为了调查守则审查中查明的守则气味背后的概念,以及审查者建议和开发者针对已查明的气味采取什么行动,我们利用两个最活跃的OpenStack项目(Nova和Neutron)对守则审查中的守则气味进行了实证性研究。我们人工核对了19,146项通过关键词搜索和随机选择获得的评论,并收到了1,190项与气味有关的审查,以研究守则的气味和针对已查明的气味采取的行动。我们的分析发现,1项守则的气味通常由违反编码的公约导致,3项审查者通常提供建设性的反馈,包括确定(重新校正)建议,4项是,开发者一般遵循的是关键词搜索和检验方法,因此,我们建议采用比较可靠的准则。

0
下载
关闭预览

相关内容

Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
145+阅读 · 2019年10月12日
开源书:PyTorch深度学习起步
专知会员服务
50+阅读 · 2019年10月11日
强化学习最新教程,17页pdf
专知会员服务
171+阅读 · 2019年10月11日
[综述]深度学习下的场景文本检测与识别
专知会员服务
77+阅读 · 2019年10月10日
机器学习入门的经验与建议
专知会员服务
91+阅读 · 2019年10月10日
意识是一种数学模式
CreateAMind
3+阅读 · 2019年6月24日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
meta learning 17年:MAML SNAIL
CreateAMind
11+阅读 · 2019年1月2日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
ResNet, AlexNet, VGG, Inception:各种卷积网络架构的理解
全球人工智能
19+阅读 · 2017年12月17日
计算机视觉近一年进展综述
机器学习研究会
8+阅读 · 2017年11月25日
【推荐】树莓派/OpenCV/dlib人脸定位/瞌睡检测
机器学习研究会
9+阅读 · 2017年10月24日
Arxiv
13+阅读 · 2021年3月3日
The Measure of Intelligence
Arxiv
6+阅读 · 2019年11月5日
AutoML: A Survey of the State-of-the-Art
Arxiv
68+阅读 · 2019年8月14日
Arxiv
11+阅读 · 2019年4月15日
Arxiv
6+阅读 · 2018年1月14日
VIP会员
相关VIP内容
相关资讯
意识是一种数学模式
CreateAMind
3+阅读 · 2019年6月24日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
meta learning 17年:MAML SNAIL
CreateAMind
11+阅读 · 2019年1月2日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
ResNet, AlexNet, VGG, Inception:各种卷积网络架构的理解
全球人工智能
19+阅读 · 2017年12月17日
计算机视觉近一年进展综述
机器学习研究会
8+阅读 · 2017年11月25日
【推荐】树莓派/OpenCV/dlib人脸定位/瞌睡检测
机器学习研究会
9+阅读 · 2017年10月24日
相关论文
Top
微信扫码咨询专知VIP会员