Test suite generation with memetic algorithms

Gordon Fraser, Andrea Arcuri, Phil McMinn
2013 Proceeding of the fifteenth annual conference on Genetic and evolutionary computation conference - GECCO '13  
Genetic Algorithms have been successfully applied to the generation of unit tests for classes, and are well suited to create complex objects through sequences of method calls. However, because the neighborhood in the search space for method sequences is huge, even supposedly simple optimizations on primitive variables (e.g., numbers and strings) can be ineffective or unsuccessful. To overcome this problem, we extend the global search applied in the EvoSuite test generation tool with local
more » ... on the individual statements of method sequences. In contrast to previous work on local search, we also consider complex datatypes including strings and arrays. A rigorous experimental methodology has been applied to properly evaluate these new local search operators. In our experiments on a set of open source classes of different kinds (e.g., numerical applications and text processing), the resulting test data generation technique increased branch coverage by up to 32% on average over the normal Genetic Algorithm. ...$15.00. c l a s s Foo { b o o l e a n bar ( S t r i n g s ) { i f ( s . e q u a l s ( " bar ") ) // t a r g e t } } Foo f o o = new Foo ( ) ; S t r i n g s = " t e s t "; f o o . bar ( s ) ;
doi:10.1145/2463372.2463548 dblp:conf/gecco/FraserAM13 fatcat:k6hcymj4w5g2xay6ivejtg2tta