Learning how to search: generating effective test cases through adaptive fitness function selection
Open Access
- 11 January 2022
- journal article
- research article
- Published by Springer Nature in Empirical Software Engineering
- Vol. 27 (2) , 1-62
Abstract
Search-based test generation is guided by feedback from one or more fitness functions—scoring functions that judge solution optimality. Choosing informative fitness functions is crucial to meeting the goals of a tester. Unfortunately, many goals—such as forcing the class-under-test to throw exceptions, increasing test suite diversity, and attaining Strong Mutation Coverage—do not have effective fitness function formulations. We propose that meeting such goals requires treating fitness function identification as a secondary optimization step. An adaptive algorithm that can vary the selection of fitness functions could adjust its selection throughout the generation process to maximize goal attainment, based on the current population of test suites. To test this hypothesis, we have implemented two reinforcement learning algorithms in the EvoSuite unit test generation framework, and used these algorithms to dynamically set the fitness functions used during generation for the three goals identified above. We have evaluated our framework, EvoSuiteFIT, on a set of Java case examples. EvoSuiteFIT techniques attain significant improvements for two of the three goals, and show limited improvements on the third when the number of generations of evolution is fixed. Additionally, for two of the three goals, EvoSuiteFIT detects faults missed by the other techniques. The ability to adjust fitness functions allows strategic choices that efficiently produce more effective test suites, and examining these choices offers insight into how to attain our testing goals. We find that adaptive fitness function selection is a powerful technique to apply when an effective fitness function does not already exist for achieving a testing goal.Keywords
All Related Versions
Funding Information
- Vetenskapsrådet (2019-05275)
- Chalmers University of Technology
This publication has 75 references indexed in Scilit:
- Achieving scalable mutation-based generation of whole test suitesEmpirical Software Engineering, 2014
- An orchestrated survey of methodologies for automated software test case generationJournal of Systems and Software, 2013
- Parameter tuning of a choice-function based hyperheuristic using Particle Swarm OptimizationExpert Systems with Applications, 2013
- Searching and generating test inputs for mutation testingSpringerPlus, 2013
- A survey on metaheuristics for stochastic combinatorial optimizationNatural Computing, 2008
- Search‐based software test data generation: a surveySoftware Testing, Verification and Reliability, 2004
- Search-based software engineeringInformation and Software Technology, 2001
- A guided tour to approximate string matchingACM Computing Surveys, 2001
- A Critique and Improvement of the CL Common Language Effect Size Statistics of McGraw and WongJournal of Educational and Behavioral Statistics, 2000
- Ant colony system: a cooperative learning approach to the traveling salesman problemIEEE Transactions on Evolutionary Computation, 1997