doc: document how to reference killed mutant

bitcoin/bitcoin: PR #36900

1 minor finding · 3 suggestions

Findings

Link

[minor] · Example mutant diff has inconsistent hunk counts

The example declares seven lines per side but contains five, making it malformed for normal patch application; this follows from inspection, not an executed git apply check.

Location: doc/developer-notes.md:707 (head).

Details and suggested fix

The header @@ -459,7 +459,7 @@ bool EvalScript(...) counts seven old and new lines, but the body contains four context lines and one replacement. Copying this example therefore produces a truncated hunk rather than the applicable mutant promised by the following paragraph. The first displayed context line is also line 460 in src/script/interpreter.cpp. Change the header to @@ -460,5 +460,5 @@ bool EvalScript(...) to match the displayed body, then validate the extracted example with git apply --check.


Optional improvements

Link

[suggestion] · MutantHub submission becomes a prerequisite without a documented fallback

The workflow requires submitting unlisted mutants to MutantHub before writing tests, but documents neither a submission procedure nor an unavailable-service fallback; no actual contributor blockage was established.

Location: doc/developer-notes.md:726 (head).

Details and suggested fix

For a mutant found in a local run, “submit it first” makes external submission a prerequisite, and the subsequent link requirement retains that dependency. Early submission can help coordinate work and identify unproductive targets, but the text requires neither approval nor waiting for feedback. Recommend making submission and linking optional while retaining the self-contained mutant description. If submission is deliberately mandatory, document how to submit and how contributors may proceed when submission is not possible.


Link

[suggestion] · The mutant diff requirement is ambiguous

The opening makes a diff preferable, but the closing instructions assume one is present, leaving contributors and reviewers unsure whether a prose description satisfies the guidance.

Location: doc/developer-notes.md:702 (head).

Details and suggested fix

“Include the file and the change, preferably as a minimal diff” allows a prose description. Later, “next to the diff” and “The link does not replace the diff” read as requiring a diff. State the accepted format consistently: remove “preferably” if a diff is mandatory, or refer to “the description of the change” in the closing paragraph if prose is acceptable.


Link

[suggestion] · The verification guidance omits base-commit survival

The documented failure check cannot distinguish newly killed mutants from ones already caught by existing tests; whether MutantHub supplies current survival evidence was not verified.

Location: doc/developer-notes.md:725 (head).

Details and suggested fix

A mutant listing can refer to an older commit, as the closing paragraph acknowledges. If existing tests already kill that mutant, confirming that the new test also fails does not demonstrate added mutant-killing coverage. Ask contributors to apply the mutant to the PR's base commit, confirm that the existing tests pass with it, and record that base commit alongside the mutant diff. Comparing that result with the new test's failure establishes the coverage improvement.


Coverage details

Background

Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.

Documented decisions

The inspected prior guidance presented MutantHub as a place contributors could check or suggest mutants, not as an explicit prerequisite to writing tests. In PR #36360, brunoerg requested a reproduction diff instead of an opaque mutant number, explaining that the diff would facilitate reproduction, and added that the contributor 'can check or suggest mutants' on MutantHub.

This supports using MutantHub for discovery and coordination, and including a self-contained diff for reproducibility. It does not state a registration requirement, a pre-writing checkpoint, or an adopted coordination decision supporting the new prerequisite in developer-notes.md.

Source 1

A prior mutation-targeting PR adopted reproduction diffs and MutantHub links in its description after that request.

This supplies precedent for identifying targeted mutants with both links and diffs. It demonstrates a presentation practice, not that registration was mandatory before test development began.

Source 1 · Source 2