Other meanings of Mutation testing
Software Testing
Mutation testing is a software testing method that evaluates the quality of a test suite by introducing small, deliberate faults (mutations) into the source code and checking whether the existing tests detect them. A mutation is considered "killed" if at least one test fails, indicating that the test suite is sensitive to that change; if the tests still pass, the mutation "survives," revealing a weakness in the test suite. This technique provides a more rigorous measure of test effectiveness than code coverage alone, as it directly assesses the ability of tests to catch specific faults.1
Mutation testing operates by creating many mutated versions of the program under test, each containing a single syntactic change. Common mutation operators include replacing arithmetic operators (e.g., + to -), changing relational operators (e.g., < to >), deleting statements, or altering boolean conditions.2 The test suite is then executed against each mutant. If a test fails, the mutant is killed; if all tests pass, the mutant survives, indicating that the test suite does not detect that particular fault. The mutation score is the percentage of killed mutants out of the total number of mutants (excluding equivalent mutants). A high mutation score suggests a robust test suite.
The concept of mutation testing was first described by Richard Lipton in 1971, but it remained largely theoretical due to high computational costs. In the 1980s, researchers like Timothy Budd and Richard DeMillo developed foundational frameworks, and the first tools emerged. The technique gained practical traction in the 2000s with the advent of faster processors and tools like Javalanche and PIT for Java, and later for other languages. Modern tools use techniques such as mutation sampling and incremental analysis to reduce overhead.
One major challenge is the equivalent mutant problem: some mutations do not change the program's observable behavior, so they cannot be killed by any test. Identifying and eliminating equivalent mutants is time-consuming and often requires manual analysis. Another issue is the computational cost, as running the full test suite for each mutant can be prohibitive. Strategies to mitigate this include using mutation testing on a subset of code, employing parallel execution, and using heuristics to prioritize mutants.3
Beyond its use in unit testing, mutation testing has been applied to other domains: it is used to assess the quality of test suites for security-critical systems, to evaluate the effectiveness of test data generation, and even to guide the design of fault-tolerant systems. A niche application is in the validation of formal specifications and model-based testing. Additionally, mutation testing has inspired the concept of "mutation analysis" in bioinformatics, where it is used to assess the impact of genetic mutations on protein function, though this is a separate field.4
Several mature tools support mutation testing across programming languages. For Java, PIT (Pitest) is widely used and integrates with build tools like Maven and Gradle. For JavaScript, Stryker is popular. For Python, MutPy and Cosmic Ray are available. These tools automate mutant generation, test execution, and reporting. Despite its benefits, adoption remains limited in industry due to performance overhead and the need for skilled interpretation of results. However, it is increasingly used in safety-critical domains such as aerospace and medical software, where test thoroughness is paramount.5
Mutation testing is also known as mutation analysis or program mutation.
Help improve the encyclopedia. Reports go straight to the site manager.