Skip to content

ci: self-mutation on PSMutant 0.9.0, with NumberBoundary and ArithmeticOperator - #217

Merged
TaekeK merged 1 commit into
mainfrom
ci/psmutant-0.9.0
Oct 24, 2026
Merged

TaekeK merged 1 commit into
mainfrom
ci/psmutant-0.9.0

Conversation

@TaekeK

@TaekeK TaekeK commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Moves self-mutation to PSMutant 0.9.0 and turns on its two new operators, NumberBoundary and ArithmeticOperator. StringLiteral is still the only opt-in operator left off.

Their first run scored 98.9%, with 19 survivors. Sorted:

One real fault, fixed (opens 0.7.2). Get-PSCxModuleVersion took the report's producedBy version from Get-Module's first answer. With two versions of PSComplexity imported side by side, that is whichever PowerShell lists first, not the one writing the report. It now reads the manifest beside src/, which is always the version that ran. CHANGELOG and ReleaseNotes are updated.

Four test gaps, now tested:

  • Union order (Ast.ps1): the existing fixture, continue/break/continue, reads the same reversed, so a walk numbered downwards also passed. Added a case that doesn't read the same reversed.
  • A self-call through ${function:...} with an argument after it, so CommandElements[0] and [-1] differ.
  • Find-PSCxRunConfigFile under a case-insensitive comparison returns the first path's spelling. The assertion is case-sensitive, because Should-Be compares strings without case and let the mutant through.
  • A blank line after a further comment still separates a declaration from its unit. PSMutant's copy of this code has the same test.

Declared equivalent, beside the code. These are # PSMutant-Equivalent: comments, as PSMutant's own source uses. Most are an index [0] -> [-1] into a list that holds exactly one item by then, or a counter that is only ever compared with -gt 0 or against a line number of at least 1. Where one line held two identical mutants, it is split so each declaration names exactly one. Position = 0 -> (-1) on -Path sits in the config beside the existing 0 -> 1: checked on 7.5 and 7.6, it binds identically.

All gates run locally on 7.6.8:

  • unit tests: 1316 passed;
  • order independence;
  • lint;
  • CI parity;
  • coverage 100%;
  • complexity 15/15;
  • release consistency (0.7.2);
  • self-mutation: 1673 mutants, every undeclared one killed. The last survivor, the config-spelling mutant, was rechecked by planting it by hand.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q2xHDB6dJmcwLt5EfS2QVP

…icOperator

The two new operators found one fault: the report's producedBy version came
from Get-Module's first answer, which with two versions loaded names an
arbitrary one. It now reads the manifest beside src/ (0.7.2).

Four were test gaps: union order (the fixture read the same reversed), a
function-drive self-call with an argument, the config path's spelling under
a case-insensitive comparison, and a blank line after a further comment.
The rest index lists that hold one item by then, and are declared inline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q2xHDB6dJmcwLt5EfS2QVP
@TaekeK
TaekeK merged commit 3d95cb7 into main Oct 24, 2026
3 of 4 checks passed
@TaekeK
TaekeK deleted the ci/psmutant-0.9.0 branch October 24, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant