What is mutation testing? According to STH team member Swati S,
Mutation testing is a fault based testing technique where variations of a software program are subjected to the test data-set. This is done to determine the effectiveness of the test set in isolating the deviations.
Examples of mutation operators
- Arithmetic operator replacement
- Logical connector replacement
- Statement removal
- Relational operator replacement
- Absolute value insertion
How Do You Know If Your Data Set Is Effective?
You know that your data set is effective if it kills all mutants. This means that when you plug in a data set value into your program, you should expect the output to give you an error.
Mutants To Avoid
Incorrect Syntax: Mutants need to be syntactically correct.
Ex. If age%%14 (incorrect syntax)
Equivalent mutants
Ex. If age> 14 & age>14 ‘means the same thing as age>14’
Trivial Mutant
Ex. ‘remove the doctor assignment statement’
From the blog CS@Worcester – My Blog by justcodeit94 and used with permission of the author. All other rights reserved by the author.