Fault Seeding and Mutation Adequacy

Robert D. Cameron
January 15, 2013

Fault Seeding

Fault seeding is a technique for evaluating the effectiveness of a testing process.

Sample Problem

But be aware of the caution in section 4.2.2 of SWEBOK: "Inserting faults into software involves the obvious risk of leaving them there".

Mutation Adequacy

Mutation adequacy uses a similar concept to fault seeding to evaluate the effectiveness of a test suite.

The mutation adequacy approach differs from fault seeding in that it is applied at a particular point in the testing process and also in that faults are not directly inserted into P.

Automated Mutation: Mutation Operators

Some Mutation Operators

Mutation OperatorMeaning Original Code Mutated Code
Add 1Add 1 to a constant
q = 0;
q = 1;
Replace VariableReplace a variable with a different one of the same type
r = x;
r = y;
Replace OperatorReplace an operator with a compatible one
q = q + 1
q = q - 1

A Program and Three Mutants

The following table shows a program P to perform integer division. Given inputs x and y, P computes the integer division of x divided by y producing quotient q and remainder r. Three mutants m(1), m(2), and m(3) are shown resulting from application of the mutation operators in the previous table.

Pm(1)m(2)m(3)
q = 0;
r = x;
while r >= y {
  r = r - y;
  q = q + 1;
}
q = 1;
r = x;
while r >= y {
  r = r - y;
  q = q + 1;
}
q = 0;
r = y;
while r >= y {
  r = r - y;
  q = q + 1;
}
q = 0;
r = x;
while r >= y {
  r = r - y;
  q = q - 1;
}

Mutation Theory

Read the Mutation Theory section of the Mutation Testing Repository for insight into the following topics.

Competent Programmer Assumption

Coupling Effect

Problems of Mutation Adequacy

Equivalent Mutants
Computational Cost

Resources

Answers

Fault Seeding Problem