test(markdown-common, adopt): meet the mutation floors the weekly run failed on - #678
Merged
Merged
Conversation
…ched The weekly mutation run failed the module at a score of 82 against its floor of 91. Nothing had regressed: `MarkdownConformer` moved into this module with its behaviour tested from the adopt side, so the module's own suite covered the reshape only through a handful of end-to-end conforms, and every decision inside it — which heading is a near miss, which blank line goes with a heading that is removed, how the settle loop ends — was free to change without a test saying so. The tests are written to those decisions, and each one states the reading it pins rather than the mutant it kills: - the title: one carried lower down is moved rather than copied, a second is removed, and the blank line under a removed heading goes with it only where the line above was blank too; - the near match: renamed in place with its body, in another case as readily as with extra words, never onto a heading that is already a required section of its own, and never onto one that merely begins with the wording; - the insertions: a bare heading is stubbed beneath itself, the reference takes the blank line already under the title rather than adding a second, and a document that is nothing but its title has no line below it to read; - the blocks: a fence or a comment the document left open is closed before anything is appended, so the appended section is structure a check can see; - the loop: a document nothing settles comes back as the last pass left it. The reader gains the readings PIT found unwatched — a raw line, the first non-blank one, a comment held open across a fenced sample inside it, a list kept open by a continuation indented exactly to its content, and a tab counting on to the next four-column stop both at the margin and inside a list item — and `LineTerminators`, until now exercised only from adopt, gets both directions of its conversion. Score 97% (265 mutations, 256 killed); the nine survivors left are boundary mutants on an index the title always occupies and calls the settle loop makes twice over. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jbmrw5FtTYTmWyvQ37uZXb
…verification With markdown-common's floor met the mutation run reaches `adopt`, which the weekly job had never got to: the reactor stopped at the module before it. It scores 87 against a floor of 88, on three gaps that share a shape — a value an operator types, or a file a checkout may or may not carry, read by a method no test asks anything of. `GuardRules` had no test at all, though what it returns decides how much of somebody else's build the installed guard enforces: `of` now answers in any case and with room around the name, and refuses an unknown one naming what it accepts, since a misspelt rule set read as the default would quietly widen or narrow that guard. `--parallel` was parsed and bounded but never exercised, so neither end of the bound was pinned. Both ends are now accepted and everything outside them refused — zero, a negative, a word, and one past the maximum — beside the default that adopts one repository at a time. `--rules` is read the same way, blank included. `WorkflowGuardInstaller.isInstalled` is what a verification asks, and nothing called it: a checkout carrying both guard files reads as guarded, one carrying neither or having lost the script does not, and the project's own workflow at the guard's path does not stand in for the adoption's — the marker is what tells the two apart. Score 90% (998 mutations, 896 killed). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jbmrw5FtTYTmWyvQ37uZXb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the Mutation Testing run, which failed with:
Nothing had regressed in the code.
MarkdownConformerlives inmarkdown-commonbut its behaviour is tested from theadoptside, so the module's own suite covered the reshape only through a handful of end-to-end conforms: every decision inside it — which heading is a near miss, which blank line goes with a heading that is removed, how the settle loop ends — was free to change without a test saying so.Two failures, not one
The reactor stops at the module that fails, so
claude-code-enforcer,adopt,protogen-maven-plugin-test,grpc-exampleandassemblywere all SKIPPED. With the first floor met the run reachesadopt, which fails too, at 87 against a floor of 88 — a failure the weekly job had never got to see. Both are fixed here.markdown-common — 82% → 97% (floor 91)
Tests written to the decisions PIT found unwatched, each stating the reading it pins:
MarkdownDocumentgains the readings PIT found unwatched — a raw line, the first non-blank one, a comment held open across a fenced sample inside it, a list kept open by a continuation indented exactly to its content, and a tab counting on to the next four-column stop both at the margin and inside a list item.LineTerminators, until now exercised only fromadopt, gets both directions of its conversion.The nine survivors left are boundary mutants on an index the title always occupies and on calls the settle loop makes twice over — equivalent under the loop rather than gaps.
adopt — 87% → 90% (floor 88)
Three gaps that share a shape: a value an operator types, or a file a checkout may or may not carry, read by a method no test asks anything of.
GuardRuleshad no test at all, though what it returns decides how much of somebody else's build the installed guard enforces.ofnow answers in any case and with room around the name, and refuses an unknown one naming what it accepts.--parallelwas parsed and bounded but never exercised, so neither end of the bound was pinned. Both ends are now accepted and everything outside them refused — zero, a negative, a word, one past the maximum — beside the default that adopts one repository at a time.--rulesis read the same way, blank included.WorkflowGuardInstaller.isInstalledis what a verification asks, and nothing called it. A checkout carrying both guard files reads as guarded, one carrying neither or having lost the script does not, and the project's own workflow at the guard's path does not stand in for the adoption's — the marker is what tells the two apart.Verification
mvn -B install -Ppitestover the whole reactor: all 13 modules SUCCESS,markdown-commonat 97% andadoptat 90%. Tests only — no production code and no threshold was changed, so both floors still guard exactly what they did.🤖 Generated with Claude Code
https://claude.ai/code/session_01Jbmrw5FtTYTmWyvQ37uZXb
Generated by Claude Code