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.
翻译:本文的目的是:1)确定“最坏的气味”,即:1)确定“最坏的气味”,即,从来就没有良好理由存在的坏气味;2)确定与最坏气味相关的频率、易变性和严重程度;3)确定“最坏气味”的频率、易变性和严重程度,以及3)确定“最坏气味”的原因,即,为了实现这些目标,我们与71个开发商进行了一项调查;我们了解到,在314个编目代码中的80个气味中,有80个是“最坏”的;即,开发商同意,这80个气味不应存在于任何代码库中;我们随后检查了这些最坏气味的频率和易变化性,27个大型阿帕开源项目的气味。我们的结果显示,在最坏和非坏气味的频率和易变性方面,我们的气味没有多大差别。也就是说,这些气味与其他气味一样有害,但是没有任何正当理由加以介绍。最后,在与5个开发商的后续电话访谈中,我们确认这些气味确实是最坏的,而且受访者提出了7个理由,为什么可以确保这些气质标准放在第一位。通过这样的质量审查,这样接受一个质量标准。