Overview
Genetic Algorithms (GAs) are a family of population-based search and optimization techniques inspired by the biological process of natural selection. They operate by evolving a population of candidate solutions through selection, crossover, and mutation operators, favoring individuals with higher fitness over successive generations. GAs are especially suited to problems characterized by huge search spaces and the absence of tractable exact algorithms.
Characteristics
- Stochastic by nature: GAs incorporate randomness in population initialization, selection, crossover, and mutation, which means that outputs for the same input may differ between runs.
- Unknown ground-truth outputs: Because of this stochasticity, it is often difficult to specify known expected outputs for test cases.
- Generalizability: Some design principles and metamorphic relations transfer across different types of evolutionary algorithms.
Applications
Combinatorial Optimization and Default Reasoning
GAs have been successfully applied to combinatorial problems. In the context of Default Logic — whose extension-finding problem is Σ₂ᴾ-complete and thus intractable for non-trivial knowledge bases — GA-based techniques have been used to build efficient default reasoning systems. A formal description of the components required for an extension search based on GA principles has been proposed, along with supporting experimental results.
Software Testing
Although GAs themselves are widely used to aid software testing (for example, in test data generation), testing GA implementations poses unique challenges due to stochasticity and the lack of known outputs. Statistical metamorphic testing has been proposed as a solution, identifying 17 metamorphic relations for testing GAs. Mutation testing has shown these relations to be more effective at finding defects than traditional unit tests based on known outputs. Three of the system-level relations were observed to fail excessively across fitness functions and were subsequently refined to reduce their failure rates.
Automated Program Generation
GAs have also served as the foundation for program generation tools. The proGenesys system, presented at the 1999 International Conference on Artificial Intelligence, applies genetic-system principles to program generation, with applications that include embedded systems design.
Testing Considerations
When testing a GA implementation, the following practical considerations have been identified:
- Use of metamorphic relations rather than known-output assertions, since outputs are not deterministic.
- Statistical evaluation of results is required to distinguish genuine defects from acceptable stochastic variation.
- Cross-implementation comparison of mutation scores can be used to validate that the metamorphic relations generalize across different GA implementations.
Related Algorithmic Family
GAs are a specific instance of evolutionary algorithms, a broader family of population-based metaheuristics that share the same high-level structure of iterated selection and variation.