What is mutation testing?
Mutation testing is a technique to identify if a set of test data or test case is useful by intentionally introducing various code changes(bugs) and retesting with original test data/cases to determine if the bugs are detected.
Mutation Testing is a type of software testing where we mutate (change) certain statements in the source code and check if the test cases are able to find the errors. IT is a type of white box testing. Mainly used in unit testing
Mutation testing is extremely time consuming and complicated to execute manually. To speed up the process, it is advisable to go for automation tools.
Mutation testing is used to design new software tests and evaluate the quality of existing software tests. Mutation testing involves modifying a program in small ways.Each mutated version is called a mutant and tests detect and reject mutants by causing the behavior of the original version to differ from the mutant. This is called killing the mutant. Test suites are measured by the percentage of mutants that they kill. New tests can be designed to kill additional mutants.
Goals of mutation testing
- identify weakly tested pieces of code
- learn about error propagation and state infection in the program
- identify weak tests (those that never kill mutants)
- compute the mutation score