A method for estimating the number of defects remaining in software is provided, using a fish-tagging analogy:
\frac{1000}{300} = \frac{50}{\text{untagged fish population}}
We seed 1,000 mutations into the program.
After running tests, we find that 50 mutants are not killed out of a sample of 300.
The estimated remaining defects are:
\frac{1000}{300} = \frac{50}{\text{remaining defects}}
abs()
returns the absolute value of the expression, while negAbs()
returns the negative of the absolute value.failOnZero()
tests whether the value of the expression is zero. If it is, the mutant is killed; otherwise, execution continues and the value of the expression is returned.x = 3 * a;
is mutated to create the following three statements:x = 3 * abs(a);
x = 3 * -abs(a);
x = 3 * failOnZero(a);
abs()
, negAbs()
, and failOnZero()
.leftOp
returns the left operand (the right is ignored), rightOp
returns the right operand, and mod
computes the remainder when the left operand is divided by the right.x = a + b;
is mutated to create the following seven statements:x = a - b;
x = a * b;
x = a / b;
x = a % b;
x = a;
x = b;
+
, -
, *
, /
, and %
is replaced by each of the other operators. In addition, each is replaced by the special mutation operators leftOp
, and rightOp
.leftOp
returns the left operand (the right is ignored) and rightOp
returns the right operand.falseOp
always returns false, and trueOp
always returns true.if (a && b)
is mutated to create the following eight statements:if (a || b)
if (a & b)
if (a | b)
if (a ^ b)
if (false)
if (true)
if (a)
if (b)
&&
, ||
, &
, |
, ^
) is replaced by each of the other operators; in addition, each is replaced by falseOp
, trueOp
, leftOp
, and rightOp
.