TOPIC 09/5118 MINNOT STARTED

Mutation testing

Plant small faults on purpose and see if the tests notice. The share caught tells you how strong the tests are, which coverage cannot.

L1–L4 are part of the Pro pass

L0 Explain simply

Analogy: a teacher plants spelling mistakes in an essay to see if the proofreader finds them. The planted mistakes show which faults this check can detect. Finding them all still does not prove that the original essay has no other errors.

Daily List is a to-do list app. Its tests all pass, and a report says they run every line of the code. Leo asks Tom if that means the tests are good. Tom says: let us find out.

Leo plants a small fault in the rule that decides if a task is overdue. He changes one sign. Then he runs the tests. If a test fails, the tests noticed. If all still pass, investigate whether the change alters reachable behaviour and whether the setup and assertions check it. Some surviving changes are equivalent or irrelevant to the supported domain.

This is mutation testing: planting small faults on purpose to see whether the tests catch them.

The picture has a limit. A teacher plants mistakes by hand. A tool plants hundreds, fast, and a few may not be mistakes at all.

(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)

PLAIN WORDS · 1 in this section
proofreader
a person who reads closely to find mistakes before printing

PICTURE IT

The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.

THE REAL JOB Testing the tests by planting small faults and seeing which ones are caught.

  1. Plant a fault
  2. Run the tests
  3. Count the kills
  4. Study the survivors
Plant, run, count the catches

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
A teacher's planted spelling mistakesThe mutants
The proofreaderThe tests
A mistake that is foundA killed mutant
A mistake that is missedA surviving mutant

WHERE THIS PICTURE STOPS

  • A teacher plants a few by hand. A tool plants hundreds.
  • Some planted changes are not mistakes at all. They are equivalent mutants.
  • A proofreader may see the whole page. Tests only check what they were written to check.

HOOK

Plant, run, count the catches.

REMEMBER IT THIS WAY

A story beat: one picture-line that carries the order or the cause.

Leo changes one sign in the overdue rule, and Tom runs the tests to see if any fail.

What each part of the trick stands for
In the trickWhat it stands for
One signplants a small fault
Tests failthe fault is caught

The planted change does not matter in real use, so a survivor is not always a weak test.

TELL A FRIEND

Plant small code changes, see which the tests detect, and read the tool’s counted set before interpreting the score.

OFTEN MIXED UP WITH Unit tests for testers. The unit tests lesson writes the tests. This lesson tests how good those tests are.

PRACTISE AND KEEP

Sources for this topic — 3 sources
  1. Market practice

    An Analysis and Survey of the Development of Mutation Testing (Yue Jia and Mark Harman, journal article, 2011) ↗ — Institute of Electrical and Electronics Engineers (IEEE) · A survey of mutation testing, a fault-based technique that seeds small faults into a program (search excerpt, page not opened)

    Survey of mutation testing, a fault-based technique that seeds small faults into a program. Published in the journal Institute of Electrical and Electronics Engineers (IEEE) Transactions on Software Engineering. Used for the idea and the history, not quoted. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Volume 37, issue 5, pages 649 to 678. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  2. Market practice

    Pitest mutation testing home page (pitest.org) ↗ — Pitest project · Faults are seeded and the tests run; a failing test kills the mutant, a passing suite lets it live; quality is the percentage killed; builds can contain equivalent mutations (search excerpt, page not opened)

    Says faults are seeded and the tests run; a failing test kills the mutant, a passing suite lets it live; test quality is the percentage of mutations killed; builds can contain equivalent mutations. Vendor documentation for one tool. Practitioner guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  3. Market practice

    Mutant states and metrics ↗ — Stryker Mutator · Opened 21 October 2026: Stryker mutant states and metrics; detected = killed + timeout, valid = detected + survived + no coverage. Compile/runtime errors, ignored and pending are outside this score denominator.

    The Stryker tool report statuses and the detected/valid score denominator; no-coverage is not detected, timeouts are detected, and invalid/ignored/pending mutants are outside that denominator. · Checked 2026-10-21

    Primary page opened and read on 21 October 2026. Earlier references may describe the access available in their own batch. Paraphrase only.

Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.