CS447 Lecture 1: L23.pdf
Document Summary
The usual way to use mutation testing is by generating mutants by modifying programs according to the language grammar, using mutation operators. Mutants are valid programs (not tests) which ought to behave di erently from the ground string. Our task, in mutation testing, is to create tests which distinguish mutants from originals. Given the ground string x = a + b, we might create mutants x = a - b, x = a * b, etc. Once we nd a test case that kills a mutant, we can forget the mutant and keep the test case. Three kinds of mutants are uninteresting: stillborn: such mutants cannot compile (or immediately crash), trivial : killed by almost any test case, equivalent: indistinguishable from original program. The usual application of program-based mutation is to individual statements in unit-level (per- method) testing. // original int min(int a, int b) { // 5 minval = a; minval = failonzero(b); // 6 return minval;