Reading results

Every mutation ends in one status. The statuses decide your mutation score and tell you where your tests are weak.

Open the results

After a run, open the viewer. It reads the reports directory and shows every mutation with its diff.

gooze report view

Keys and flags: gooze report view. File layout: Report format.

Statuses

  • killed: the tests of the package that owns the mutated file failed for the mutation (go test -count=1 on that package). Usually good: your tests caught the change.
  • survived: the package tests still passed. Usually a weak or missing assertion.
  • not_covered: the mutated line is uncovered in the profile passed with --coverage-profile, so Gooze skipped its tests. It counts as a survivor (it lowers the score) but is tallied separately.
  • timeout: the tests exceeded --mutation-timeout (default 120 seconds). A timeout is not a kill.
  • error: the mutant did not compile; excluded from the score.

A missing test file does not skip anything: Gooze runs the sibling <name>_test.go if it exists, otherwise any *_test.go in the same package. If the package has no test file at all, the mutation is reported as survived.

Mutation score

score = killed / (all mutations - error)
  • Only killed counts in your favour. survived, not_covered, and timeout all lower the score.
  • error mutants (did not compile) are left out entirely. With no scorable mutations the score is 100%.
  • gooze run, gooze report merge, and a non-interactive gooze report view print it as Mutation score: NN.NN%. To fail CI below a minimum, see the score gate.
  • _index.yaml stores the raw counts but not the score; its failed_mutations lumps error and timeout together, so use the printed score rather than recomputing it.

What to do when you see a survivor

A survivor is a hint. It usually means: your tests do not check this behavior.

  1. Open the diff in gooze report view.
  2. Ask: what behavior changed? Each mutation operator explains what a survivor of its kind usually means.
  3. Add a test that would fail if this behavior changes.
  4. Run Gooze again and see if it is killed now.

If the code genuinely should not be tested (generated code, debug helpers), skip it instead: see Ignoring code.