Mutation in nature is changes in the genetic material of an organism that can be inherited. But this term is used for very interesting testing technique – mutation testing.
Mutation Testing in Software Testing
Mutation in software testing is a small change in program under test, which occurred due to partial syntactic code changes (eg, refactoring). And tests are run for the original and all the “mutated” versions of the program under test.
A common way to test the quality of quality assurance is to simulate a situation in which quality assurance team should trigger an alarm. For instance, to test a watchdog, one could check whether the dog actually gives an alarm when facing a (staged) intruder. To test the quality assurance of a clothes company, one could insert a faulty cloth into the production chain and check whether quality assurance finds it. Secure systems are routinely tested using penetration testing, simulating an attack from a malicious source.
History of Mutation Testing
In 1971, Richard Lipton adapted this simulation concept to testing. His idea, written down in a paper called “Fault diagnosis of computer programs,” was to seed artificial defects, called mutations, into the software under test, and to check whether the test suite would find them. Such an artificial defect could be to change a constant, to remove a function call, or to negate a branching condition. If the test suite fails to detect the mutation, it would likely miss real defects, too, and thus must be improved.
The basic idea of mutation testing is to seed lots of these artificial defects into the program, test them all individually, and focus on those mutations that are not detected—and to systematically improve the test suite until it finds all mutations.