论文标题
代码气味通过现代代码评论检测:OpenStack和QT社区的研究
Code Smells Detection via Modern Code Review: A Study of the OpenStack and Qt Communities
论文作者
论文摘要
检测和找到缺陷和其他质量问题的代码审查在软件质量控制中起着重要作用。可能影响软件质量的一种问题是代码气味。然而,关于在现代代码审查期间鉴定的代码气味的程度知之甚少。为了调查现代代码审查中确定的代码气味的概念以及审稿人对确定气味的响应所采取的行动,我们通过分析了来自OpenStack(Nova和Neva和Neadron)和QT(QT Base and QT Creator)社区的四个大型开源项目的评论,对代码评论中的代码气味进行了研究。我们手动检查了由关键字搜索和随机选择获得的25,415个代码评论评论,并确定了1,539个与气味有关的评论。我们的分析发现,1)代码评论中未发现代码气味,2)通常是由违反编码约定的情况引起的,3)审阅者通常提供建设性的反馈,包括修复(重构)建议以帮助开发人员消除气味,4)开发人员通常会遵循这些建议,通常会遵循开发者的批评,而审阅者则不太确定审核的范围,5)又一次识别了审查的范围,而又一次的是,又一次的是,又一次又一张开来,又有了验证,而又一次的习惯,以及审核的确定性,又一次又一次,又有句子,又要确定审查的气味,并允许审查的范围。忽略确定的气味不值得解决气味。我们的结果表明:1)开发人员应在其项目中紧密遵守编码惯例,以避免引入代码气味,2)基于审查的代码气味的检测被认为是开发人员的一种值得信赖的方法,主要是因为审核是上下文敏感的,因为审阅者对审查者的范围更加意识到,因为审核者更了解了该代码的上下文,并且可以完全考虑到范围的范围。 立即地。
Code review that detects and locates defects and other quality issues plays an important role in software quality control. One type of issue that may impact the quality of software is code smells. Yet, little is known about the extent to which code smells are identified during modern code review. To investigate the concept behind code smells identified in modern code review and what actions reviewers suggest and developers take in response to the identified smells, we conducted a study of code smells in code reviews by analyzing reviews from four large open source projects from the OpenStack (Nova and Neutron) and Qt (Qt Base and Qt Creator) communities. We manually checked a total of 25,415 code review comments obtained by keywords search and random selection, and identified 1,539 smell-related reviews. 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, 4) developers generally followed those recommendations and actioned the changes, 5) once identified by reviewers, it usually takes developers less than one week to fix the smells, and 6) the main reason why developers chose to ignore the identified smells is not worth fixing the smell. Our results suggest that: 1) developers should closely follow coding conventions in their projects to avoid introducing code smells, 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), and 3) program context needs to be fully considered in order to make a decision of whether to fix the identified code smell immediately.