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

利用传播感染交叉火力变异体

Leveraging Propagated Infection to Crossfire Mutants

Hang Du, Vijay Krishna Palepu, James A. Jones

AI总结:

本研究针对变异测试中存活变异体的检测问题,提出基于内存状态分析的断言增强技术和交叉火力优化方法,通过理论模型和实验验证,显著提升了测试套件杀死变异体的效率。

摘要:

变异测试旨在通过反复生成人工故障版本的软件(变异体)并确定测试套件是否足以检测到它们(杀死它们),来识别测试套件中的弱点。当测试不足时,每个存活的变异体都为改进测试套件提供了机会。我们进行了一项研究,发现许多这样的存活变异体(在我们的研究对象中高达84%)可以通过简单地向现有测试添加额外断言(断言增强)来检测。此外,我们发现这些变异体中有许多可以通过多个现有测试检测到,这为开发者提供了如何检测它们的选项。为了帮助应对这些挑战,我们创建了一种技术,该技术执行内存状态分析以识别开发者可用于检测存活变异体的候选断言。此外,我们基于先前识别“交叉火力”机会的研究——即偶然杀死多个变异体的测试。为此,我们开发了一个理论模型,描述了交叉火力在现有测试套件中可发生的不同粒度,这为如何杀死存活变异体提供了机会和选项。我们将该模型转化为一种配套技术,该技术优化现有测试的断言增强,以用更少的添加断言交叉火力多个变异体,可选地集中在更少的测试中。我们的实验表明,我们能够仅使用1.1%的已识别断言候选者杀死所有可通过现有测试数据检测的存活变异体,并且与不交叉火力的测试相比,从增强测试中杀死的变异体数量平均增加了6倍。

英文摘要:

Mutation testing was proposed to identify weaknesses in test suites by repeatedly generating artificially faulty versions of the software (mutants) and determining if the test suite is sufficient to detect them (kill them). When the tests are insufficient, each surviving mutant provides an opportunity to improve the test suite. We conducted a study and found that many such surviving mutants (up to 84% for the subjects of our study) are detectable by simply augmenting existing tests with additional assertions, or assertion amplification. Moreover, we find that many of these mutants are detectable by multiple existing tests, giving developers options for how to detect them. To help with these challenges, we created a technique that performs memory-state analysis to identify candidate assertions that developers can use to detect the surviving mutants. Additionally, we build upon prior research that identifies ``crossfiring'' opportunities -- tests that coincidentally kill multiple mutants. To this end, we developed a theoretical model that describes the varying granularities that crossfiring can occur in the existing test suite, which provide opportunities and options for how to kill surviving mutants. We operationalize this model to an accompanying technique that optimizes the assertion amplification of the existing tests to crossfire multiple mutants with fewer added assertions, optionally concentrated within fewer tests. Our experiments show that we can kill all surviving mutants that are detectable with existing test data with only 1.1% of the identified assertion candidates, and increasing by a factor of 6x, on average, the number of killed mutants from amplified tests, over tests that do not crossfire.

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

↑