Search-based approaches have been used in the literature to automate the process of creating unit test cases. However, related work has shown that generated unit-tests with high code coverage could be ineffective, i.e., they may not detect all faults or kill all injected mutants. In this paper, we propose CLING, an integration-level test case generation approach that exploits how a pair of classes, the caller and the callee, interact with each other through method calls. In particular, CLING generates integration-level test cases that maximize the Coupled Branches Criterion (CBC). Coupled branches are pairs of branches containing a branch of the caller and a branch of the callee such that an integration test that exercises the former also exercises the latter. CBC is a novel integration-level coverage criterion, measuring the degree to which a test suite exercises the interactions between a caller and its callee classes. We implemented CLING and evaluated the approach on 140 pairs of classes from five different open-source Java projects. Our results show that (1) CLING generates test suites with high CBC coverage, thanks to the definition of the test suite generation as a many-objectives problem where each couple of branches is an independent objective; (2) such generated suites trigger different class interactions and can kill on average 7.7% (with a maximum of 50%) of mutants that are not detected by tests generated at the unit level; (3) CLING can detect integration faults coming from wrong assumptions about the usage of the callee class (32 for our subject systems) that remain undetected when using automatically generated unit-level test suites.
翻译:文献中采用了基于搜索的方法使单位测试案例的创建过程自动化。然而,相关工作表明,生成代码覆盖率高的单位测试可能是无效的,即它们可能不会发现所有故障或杀死所有被注射变异体。在本文中,我们提议使用一个整合级测试生成案例方法,即CLing,即集成级测试生成方法,利用一对类、调用人和被调用人之间如何互动;特别是,CLing生成整合级测试案例,最大限度地增加组合分支的利用率。混合分支是包含调用人的分支和被调用人的分支的分支的对对齐,即它们可能自动检测所有缺陷或杀死所有被注射变异体。在本文件中,CBC是一个新的整合级别标准,衡量测试套装在调用人与其被调用人类别之间如何互动的程度。我们实施了CLing并评估了5个不同开源 Java项目中的140对类中的140对级。我们的呼叫显示,(1)CLing生成一个包含高 CBC覆盖范围的测试套房,由于即将进行整合的分级的整合,在50个单位的测试等级上,因此,而将使用标准级最高级的测试等级的CBC将生成的机级测试等级将生成一个测试等级,而生成了50级的机级测试等级为标准,而测试等级的等级为Serlings,而生成的版本的等级的等级的测试的等级的等级为Servicbilds,而生成了标准级等级等级等级的等级的等级的等级等级等级的等级的等级为不同级级级的测试的等级为Servic)在测试等级,在测试的等级等级等级等级的等级的等级的等级的等级的等级的等级的等级可测测测算为不同制的等级,而可测测算为不同制的等级的等级的等级的等级为不同制的等级的等级为不同制的等级的等级的等级的等级的等级为:在测试的等级的等级等级的等级的等级的等级的等级的等级的等级等级的等级的等级的等级的等级的等级的等级的等级的等级的等级的等级的等级的等级的等级的等级的等级的等级的等级的等级的等级的等级的等级可测算的等级的等级的等级可测测算的等级为不同