Instructions: Work with your neighbors in groups.
This is a mutation exercise.
Consider (again) the following code:
public final class GoodFastCheap {
// boolean variables good, fast, and cheap
// other stuff omitted
public boolean isSatisfactory() {
if ((good && fast) || (good && cheap) || (fast && cheap)) {
return true;
}
return false;
}
public boolean isSatisfactoryRefactored() {
if (good && fast) return true;
if (good && cheap) return true;
if (fast && cheap) return true;
return false;
}
}
Consider two mutation operators, one that replaces boolean variables
with the constant "true", and another that replaces boolean variables
with the constant "false".
-
How many mutants do these two operators generate for
-
isSatisfactory()
?
-
isSatisfactoryRefactored()
?
- Are any of these mutants "equivalent"?
What is it about these mutation operators that makes this analysis
especially easy?
- Some of these mutants are bound to be redundant. How many? Why?
-
Consider a pair of corresponding mutants, one in each method.
Will these mutants be killed by exactly the same tests?
Is this a good thing?
-
For each mutant, find all the tests that kill that mutant.