Assessing Diffusion and Perception of Test Smells in Scala Projects

Assessing Diffusion and Perception of Test Smells in Scala Projects
复制标题

评估 Scala 项目中测试气味的扩散和感知

DOI:
--
复制
发表时间:
2019
期刊:
IEEE Working Conference on Mining Software Repositories
影响因子:
--
通讯作者:
Coen De Roover
Coen De Roover
中科院分区:
--
文献类型:
--
作者:
Jonas De Bleser;Dario Di Nucci;Coen De Roover

文献摘要

被引文献

相似文献

与代码气味类似,测试气味被定义为设计不良的单元测试所表现出的特征。他们的负面影响测试的有效性,理解和维护已被证明了一些实证研究。然而,这些研究的范围主要局限于Java与JUnit测试框架的结合。其他语言和框架组合的结果--尽管它们在实践中很流行--很少,这可能会扭曲我们对测试气味的理解。例如,Scala和ScalaTest的结合为定义和重用测试夹具提供了更全面的方法,从而可能减少夹具相关测试气味的扩散和感知。因此,本文报告了两个实证研究进行这种组合。在第一项研究中,我们分析了GitHub上托管的164个开源Scala项目的测试,以传播测试气味。这就需要将它们的原始定义转换到这个新的环境中,并实现一个工具(SOCRATES)来自动检测它们。在第二项研究中,我们评估了14名Scala开发人员识别测试气味的感知和能力。在这种情况下,我们的研究结果表明:(i)测试气味在测试类中的扩散程度较低;(ii)最常见的测试气味是LazyTest、AsserTest和AssertionRoulette;(iii)许多开发人员能够感知但无法识别这些气味。
Test smells are, analogously to code smells, defined as the characteristics exhibited by poorly designed unit tests. Their negative impact on test effectiveness, understanding, and maintenance has been demonstrated by several empirical studies. However, the scope of these studies has been limited mostly to Java in combination with the JUnit testing framework. Results for other language and framework combinations are –-despite their prevalence in practice–- few and far between, which might skew our understanding of test smells. The combination of Scala and ScalaTest, for instance, offers more comprehensive means for defining and reusing test fixtures, thereby possibly reducing the diffusion and perception of fixture-related test smells. This paper therefore reports on two empirical studies conducted for this combination. In the first study, we analyse the tests of 164 open-source Scala projects hosted on GitHub for the diffusion of test smells. This required the transposition of their original definition to this new context, and the implementation of a tool (SOCRATES) for their automated detection. In the second study, we assess the perception and the ability of 14 Scala developers to identify test smells. For this context, our results show (i) that test smells have a low diffusion across test classes, (ii) that the most frequently occurring test smells are LazyTest, EagerTest, and AssertionRoulette, and (iii) that many developers were able to perceive but not to identify the smells.