Mutation Testing Software Testing (original) (raw)

Last Updated : 9 Jun, 2026

Mutation Testing is an advanced white-box testing technique used to evaluate the quality and effectiveness of test cases. It involves introducing small changes (mutations) into the source code and checking whether the existing tests can detect them. This helps ensure that the software is thoroughly tested and capable of identifying defects.

Objective of Mutation Testing

The main objectives of mutation testing are:

original_program

Mutation Testing

**Types of Mutation Testing

Mutation Testing can be classified into three main types based on the nature of the changes (mutations) introduced into the source code.

types_of_mutation_testing

Types of Mutation Testing

**Value Mutations

Value mutation changes the values of constants, variables, or literals in the program. It helps verify whether test cases can detect incorrect data values.

**Example: Replacing 10 with 100 or changing true to false.

Decision Mutations

Decision mutation modifies conditional or logical operators used in decision-making statements. It checks whether tests can identify errors in program logic.

**Example: Replacing > with < or && with ||.

Statement Mutations

Statement mutation alters, removes, or replaces program statements. It ensures that test cases can detect incorrect or missing program instructions.

**Example: Deleting a statement or replacing an assignment statement with another operation.

Process of Mutation Testing

Mutation testing is performed by introducing small changes into the program and checking whether the existing test cases can detect those changes. The process generally involves the following steps:

Mutation Score (Evaluation Metric)

Mutation Score is a metric used to measure the effectiveness of a test suite by determining how many mutants are detected (killed) by the test cases.

**Formula:

Mutation Score = (Killed Mutants / (Total Mutants − Equivalent Mutants)) × 100

Explanation

Interpretation

**Example: If 72 mutants are killed out of 100 total mutants and 10 are equivalent mutants, then:

**Mutation Score = (72 ÷ (100 − 10)) × 100 = (72 ÷ 90) × 100 = 80%

**Result: The mutation score is 80%, indicating that the test suite detected 80% of the non-equivalent mutants.

Several tools are available to perform mutation testing across different programming languages and environments:

Advantages of Mutation Testing

Limitations of Mutation Testing