一句话:首次系统实证刻画变异测试中测试用例杀死变异体的失败方式与崩溃成因。
变异测试通过向程序注入人工缺陷生成变异体,并运行测试套件判断是否能检测并杀死变异体;失败测试用例即杀死该变异体。尽管该技术已被研究和应用四十余年,但人们对“杀死”本身的性质了解甚少。本文开展实证研究,考察杀死变异体的测试用例为何失败、每个被杀死变异体有多少测试用例失败(尽管只需一次失败即可杀死)、程序崩溃如何促成杀死、以及这些崩溃的来源与性质。结果显示,崩溃对导致杀死的测试失败有显著贡献;即使对单个变异,测试失败原因也呈多样性;并识别出常引发崩溃的具体异常类型。作者认为该结果对实践者解读变异得分及研究者使用变异测试均有启示。
Mutation testing has been used and studied for over four decades as a method to assess the strength of a test suite. This technique adds an artificial bug (i.e., a mutation) to a program to produce a mutant, and the test suite is run to determine if any of its test cases are sufficient to detect this mutation (i.e., kill the mutant). In this situation, a test case that fails is the one that kills the mutant. However, little is known about the nature of these kills. In this paper, we present an empirical study that investigates the nature of these kills. We seek to answer questions, such as: How are test cases failing so that they contribute to mutant kills? How many test cases fail for each killed mutant, given that only a single failure is required to kill that mutant? How do program crashes contribute to kills, and what are the origins and nature of these crashes? We found several revealing results across all subjects, including the substantial contribution of "crashes" to test failures leading to mutant kills, the existence of diverse causes for test failures even for a single mutation, and the specific types of exceptions that commonly instigate crashes. We posit that this study and its results should likely be taken into account for practitioners in their use of mutation testing and interpretation of its mutation score, and for researchers who study and leverage mutation testing in their future work.