Mutation Testing - Equivalent Mutants

Equivalent Mutants

Many mutation operators can produce equivalent mutants. For example, consider the following code fragment:

int index = 0; while (…) { …; index++; if (index == 10) { break; } }

Boolean relation mutation operator will replace == with >= and produce the following mutant:

int index = 0; while (…) { …; index++; if (index >= 10) { break; } }

However, it is not possible to find a test case that could kill this mutant. The resulting program is equivalent to the original one. Such mutants are called equivalent mutants.

Equivalent mutants detection is one of biggest obstacles for practical usage of mutation testing. The effort needed to check if mutants are equivalent or not, can be very high even for small programs.

Read more about this topic:  Mutation Testing

Famous quotes containing the word equivalent:

    “Perhaps basketball and poetry have just a few things in common, but the most important is the possibility of transcendence. The opposite is labor. In writing, every writer knows when he or she is laboring to achieve an effect. You want to get from here to there, but find yourself willing it, forcing it. The equivalent in basketball is aiming your shot, a kind of strained and usually ineffective purposefulness. What you want is to be in some kind of flow, each next moment a discovery.”
    —Stephen Dunn (b. 1939)