Skip to Main Content
Genetic algorithms have been used to generate test sets automatically by searching the domain of the software for suitable values to satisfy a predefined testing criterion. These criteria have been set by the requirements for test data set adequacy of structural testing, such as obtaining full branch coverage and controlling the number of iterations of a conditional loop. This technique has been applied successfully to several problems, varying in complexity from a quadratic equation solver to a generic sort module that comprises several procedures. In these cases, full branch coverage was obtained. Genetic algorithms could be applied to approaches other than structural testing, provided that the goal of the testing is clearly defined, and a fitness function which relates to this goal can be devised to give a single numeric value for the fitness. The quality of the test data is enhanced by designing the fitness function to generate data close to a subdomain boundary where the likelihood of revealing an error is higher.