A Memetic Algorithm for whole test suite generation

A Memetic Algorithm for whole test suite generation
复制标题

DOI:
10.1016/j.jss.2014.05.032
复制
发表时间:
2015-05
期刊:
J. Syst. Softw.
影响因子:
--
通讯作者:
G. Fraser;Andrea Arcuri;Phil McMinn
G. Fraser;Andrea Arcuri;Phil McMinn
中科院分区:
其他
文献类型:
--
作者:
G. Fraser;Andrea Arcuri;Phil McMinn

文献摘要

被引文献

相似文献

生成结构代码覆盖的单元级测试用例是一项非常适合遗传算法的任务。必须创建构造对象的方法调用序列,将它们置于正确的状态,然后执行未覆盖的代码。但是,原始值的生成(如整型和双精度型、出现在字符串中的字符以及原始值的数组)就不那么简单了。通常,需要进行较小的本地更改才能将值推向执行某些目标结构所需的值。然而,像遗传算法这样的全局搜索往往会做出更大的更改,而不是集中在测试用例的任何特定方面。在本文中,我们将EvoSuitest生成工具背后的遗传算法扩展为Memtic算法,为其配备了几个局部搜索算子。这些运算符旨在高效地优化测试套件的原始值和其他方面,使测试用例的搜索能够更有效地运行。我们在超过12,000个Java类上使用严格的实验方法来评估我们的运算符,这些Java类包括各种不同类型的开放源码类,包括数值应用程序和文本处理器。我们的研究表明,在实践中,单个班级的分支机构覆盖率可能增加高达53%。
The generation of unit-level test cases for structural code coverage is a task well-suited to Genetic Algorithms. Method call sequences must be created that construct objects, put them into the right state and then execute uncovered code. However, the generation of primitive values, such as integers and doubles, characters that appear in strings, and arrays of primitive values, are not so straightforward. Often, small local changes are required to drive the value toward the one needed to execute some target structure. However, global searches like Genetic Algorithms tend to make larger changes that are not concentrated on any particular aspect of a test case. In this paper, we extend the Genetic Algorithm behind theEvoSuitetest generation tool into a Memetic Algorithm, by equipping it with several local search operators. These operators are designed to efficiently optimize primitive values and other aspects of a test suite that allow the search for test cases to function more effectively. We evaluate our operators using a rigorous experimental methodology on over 12,000 Java classes, comprising open source classes of various different kinds, including numerical applications and text processors. Our study shows that increases in branch coverage of up to 53% are possible for an individual class in practice.