Choosing the fitness function for the job: Automated generation of test suites that detect real faults

Choosing the fitness function for the job: Automated generation of test suites that detect real faults
复制标题

DOI:
10.1002/stvr.1701
复制
发表时间:
2019-06
期刊:
Software Testing
影响因子:
--
通讯作者:
Alireza Salahirad;H. Almulla;Gregory Gay
Alireza Salahirad;H. Almulla;Gregory Gay
中科院分区:
其他
文献类型:
--
作者:
Alireza Salahirad;H. Almulla;Gregory Gay

文献摘要

被引文献

相似文献

基于搜索的单元测试生成,如果在故障检测方面有效,可以降低测试成本。这些技术依赖于适应度函数来指导搜索。最终,这样的功能代表了近似但不能确保故障检测的测试目标。需要依赖于近似导致两个问题-健身功能可以产生有效的测试,如果是这样的话,应该用来生成测试?为了回答这些问题,我们评估了单元测试套件的故障检测能力,以满足来自Defects 4J数据库的597个真实的故障上的8个白色盒适应度函数。我们的分析发现,有效性的最强指标是对目标类的高水平代码覆盖率和对标准义务的高满意度。因此,分支覆盖适应度函数是最有效的。我们的研究结果表明,健身功能,彻底探索系统结构应被用作初级生成的目标,支持二次健身功能,探索正交,支持的情况。我们的研究结果还提供了进一步的证据表明,未来的测试生成方法应该专注于实现更高的私有代码覆盖率和更好的初始化和操纵类依赖关系。
Search‐based unit test generation, if effective at fault detection, can lower the cost of testing. Such techniques rely on fitness functions to guide the search. Ultimately, such functions represent test goals that approximate—but do not ensure—fault detection. The need to rely on approximations leads to two questions—can fitness functions produce effective tests and, if so, which should be used to generate tests? To answer these questions, we have assessed the fault‐detection capabilities of unit test suites generated to satisfy eight white‐box fitness functions on 597 real faults from the Defects4J database. Our analysis has found that the strongest indicators of effectiveness are a high level of code coverage over the targeted class and high satisfaction of a criterion's obligations. Consequently, the branch coverage fitness function is the most effective. Our findings indicate that fitness functions that thoroughly explore system structure should be used as primary generation objectives—supported by secondary fitness functions that explore orthogonal, supporting scenarios. Our results also provide further evidence that future approaches to test generation should focus on attaining higher coverage of private code and better initialization and manipulation of class dependencies.