SWE 437 In Class Exercise # 24
More Mutation Testing


Names:
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 a mutation operator that replaces boolean variables with the constants "T" and "F".
  1. How many mutants does this generate for
  2. Some of these mutants are bound to be redundant. How many? Why?
  3. 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?
  4. For each mutant, find all the tests that kill that mutant.
  5. Analyze weak vs. strong mutation for these mutants. Is there any difference? Does your answer depend on any assumptions?