arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2103.09537cs.SE
收藏

最糟糕的气味和最糟糕的原因

Worst Smells and Their Worst Reasons

Davide Falessi, Rick Kazman

摘要:

本文的目的是:1)识别“最糟糕的气味”,即,从来没有好的理由存在的坏气味,2)确定与最坏气味相关的频率、变化倾向性和严重性,以及3)识别"最坏原因",即,为什么要引入这些难闻的气味为了实现这些目标,我们对71名开发人员进行了调查。我们了解到,在314种编目的代码气味中,有80种是“最糟糕的”;也就是说,开发人员同意这80种气味不应该存在于任何代码库中。然后,我们在27个大型Apache开源项目中检查了这些最糟糕的气味的频率和变化倾向。我们的研究结果显示,在频率和变化倾向,最坏的和非最坏的气味之间的差异不显著。也就是说,这些气味和其他气味一样有害,但从来没有任何正当理由引入它们。最后,在对五位开发商的后续电话采访中,我们证实了这些气味确实是最糟糕的,受访者提出了七个原因,为什么他们可能会首先引入。通过明确识别这七个原因,项目利益相关者可以通过质量门或审查,确保代码库中永远不会接受这些气味,从而在不影响其他目标(如敏捷性或上市时间)的情况下提高质量。

英文摘要:

The aims of this paper are: 1) to identify "worst smells", i.e., bad smells that never have a good reason to exist, 2) to determine the frequency, change-proneness, and severity associated with worst smells, and 3) to identify the "worst reasons", i.e., the reasons for introducing these worst smells in the first place. To achieve these aims we ran a survey with 71 developers. We learned that 80 out of 314 catalogued code smells are "worst"; that is, developers agreed that these 80 smells should never exist in any code base. We then checked the frequency and change-proneness of these worst smells on 27 large Apache open-source projects. Our results show insignificant differences, in both frequency and change proneness, between worst and non-worst smells. That is to say, these smells are just as damaging as other smells, but there is never any justifiable reason to introduce them. Finally, in follow-up phone interviews with five developers we confirmed that these smells are indeed worst, and the interviewees proposed seven reasons for why they may be introduced in the first place. By explicitly identifying these seven reasons, project stakeholders can, through quality gates or reviews, ensure that such smells are never accepted in a code base, thus improving quality without compromising other goals such as agility or time to market.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑