A key aspect of ensuring the quality of a software system is the practice of unit testing. Through unit tests, developers verify the correctness of production source code, thereby verifying the system's intended behavior under test. However, unit test code is subject to issues, ranging from bugs in the code to poor test case design (i.e., test smells). In this study, we compare and contrast the occurrences of a type of single-statement-bug-fix known as "simple stupid bugs" (SStuBs) in test and non-test (i.e., production) files in popular open-source Java Maven projects. Our results show that SStuBs occur more frequently in non-test files than in test files, with most fix-related code associated with assertion statements in test files. Further, most test files exhibiting SStuBs also exhibit test smells. We envision our findings enabling tool vendors to better support developers in improving the maintenance of test suites.
翻译:确保软件系统质量的一个关键方面是单位测试的做法。通过单位测试,开发者核查生产源代码的正确性,从而核查系统在测试中预期的行为。然而,单位测试代码受到各种问题的影响,从代码中的错误到测试案例设计差(即测试气味),从代码中的错误到测试案例设计差(即测试气味)不等。在这个研究中,我们比较和比较了测试和非测试(即生产)中流行的公开源码 Java Maven 项目的单一声明-错误(SStuBs)的发生率。我们的结果显示,SSTUBs在非测试文档中比测试文档中更频繁出现,而大多数固定代码与测试文档中的主张声明相关。此外,大多数显示SStuBs的测试文件也存在测试气味。我们设想我们的调查结果使工具供应商能够更好地支持开发者改进测试套件的维护。