# Mutation score vs code coverage

> Compare code coverage with mutation score on a wrong shipping fee. Inspect the missing assertion and the denominator behind each metric.

Source: https://cueapril.com/compare/mutation-score-vs-code-coverage
Updated: 2026-12-01
Index: https://cueapril.com/llms.txt

## Can a green, high-coverage suite notice a wrong answer?

Choose coverage to find code and branches your tests have never exercised. Choose mutation analysis to challenge what the suite can detect in a defined scope. Start with uncovered high-consequence paths. Then inspect surviving changes on code you already exercise, especially money, permissions and state transitions.

Compare coverage and mutation scores using a wrong shipping fee. Identify the assertion that misses it and understand what each percentage counts.

Cue April editorial assessment. The sources identify documented capabilities. Suggested pilot checks are evaluation criteria.

## An executed line can return the wrong amount

Imagine a shipping test calls the fee calculation and checks only that the result is a number. The return line executes, including when a change replaces 499 cents with 0. A targeted assertion of 499 cents below the free-shipping threshold should detect that particular change. This example illustrates the difference before you measure your own suite.

Mutation score vs. code coverage

| Release question | Coverage report | Mutation report |
| --- | --- | --- |
| Did the fee branch execute? | Identify the branch and its execution count. | Check whether the generator changed the relevant code. |
| Would a wrong fee fail a test? | Line or branch execution alone leaves this open. | Inspect the deliberate fee change and its outcome. |
| Where should we add an assertion? | Find exercised business rules with little visible checking. | Prioritise harmful survivors and their input conditions. |
| Can we compare releases? | Keep the same coverage type and file scope. | Keep engine, operators, exclusions and outcome definitions. |

## Compare the denominators before presenting a trend

Coverage can count executable lines or branch opportunities. A mutation tool counts generated changes under its own status rules and configured scope. Keep the revision, files, exclusions and counts for detected, surviving, uncovered and invalid changes. A higher percentage after dropping a hard-to-test file gives a reviewer a different story from detecting more changes.

## Primary documentation

- [coverage.py branch coverage measurement](https://coverage.readthedocs.io/en/latest/branch.html)
- [Stryker mutation testing concepts](https://stryker-mutator.io/docs/mutation-testing-elements/mutant-states-and-metrics/)

By Cue April. Updated 2026-12-01.

## Related

- [Testing comparisons](https://cueapril.com/compare): Compare testing tools and methods against a release decision. Inspect the required evidence, maintenance work and checks each approach can provide.
- [Mutation testing](https://cueapril.com/testing/mutation-testing): Run a Stryker mutation testing example. Inspect a surviving delivery-boundary mutant, add the missing assertion and compare native reports.
- [QA metrics](https://cueapril.com/guides/qa-metrics): Build a QA dashboard for release reviews. A worked example tracks risk coverage, escaped defects, pull request wait times and flaky reruns.
