PSMutant

0.3.1

Mutation testing for PowerShell. Injects small faults (flip -eq to -ne, $true to $false, N to N+1, drop -not) into your scripts using the PowerShell AST and reports how many your Pester suite catches - the metric line coverage cannot give you. Runs mutants in a throwaway sandbox so your source is never modified. Requires Pester 5.0.0 or later AT RUN TIME, and delibera
Mutation testing for PowerShell. Injects small faults (flip -eq to -ne, $true to $false, N to N+1, drop -not) into your scripts using the PowerShell AST and reports how many your Pester suite catches - the metric line coverage cannot give you. Runs mutants in a throwaway sandbox so your source is never modified. Requires Pester 5.0.0 or later AT RUN TIME, and deliberately does not declare it as a RequiredModule: PSMutant runs under whichever Pester >= 5 you have loaded rather than importing one for you. Install Pester yourself if you do not already have it.
Show more

Minimum PowerShell version

7.2

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name PSMutant -RequiredVersion 0.3.1

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name PSMutant -Version 0.3.1

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) Fortigi. MIT licensed.

Package Details

Author(s)

  • Fortigi

Tags

mutation-testing testing pester ast quality test-quality coverage

Functions

Invoke-PSMutation

Dependencies

This module has no dependencies.

Release Notes

**Breaking: the module now exports one function.** `Invoke-PSMutation` is the whole surface.
If you called `Get-PSMutationCandidate` or `Set-PSMutationText`, they are gone -- they were
never documented, and the object they returned was never a declared contract. What you should
depend on instead is the report JSON, which now has a published schema.

**Your config is checked more strictly, and mistakes are errors rather than silence.** A
misspelled key used to be ignored, which quietly weakened the run: `thresholds.brake` left the
break gate unable to fail at all, and a misspelled operator was dropped and then reported as
though it had run. A value of the wrong type did the same -- `"timeoutFactor": "four"` left the
per-mutant timeout empty, and an expired timeout counts as a kill, so the score was higher than
the tests earned. Both are refused now, and the message names the key and suggests the nearest
valid one.

If you have been running with a typo, this release will fail your config where it previously
ran. That is the point: the run it was giving you was not measuring what you thought.

**Both formats are published as JSON Schemas**, in `schemas/v1/`. Point your config at
`config.schema.json` with a `$schema` key and it can be checked before a run instead of minutes
into one. Validate a report against `report.schema.json` if you build anything on top of it --
a dashboard, a ratchet, a merge tool. Extra fields are allowed on purpose, so a validating
reader keeps working when a later release records more.

**Reports say how they were produced**: a schema version, the module version, a timestamp, and
how long the baseline, the whole run and the per-mutant timeout took.

**`-RecheckFrom` does less work.** It skips mutants your config already declared unkillable,
and a recheck report can now seed another recheck, so the loop narrows as you write assertions.

**`Get-Help Invoke-PSMutation` returns the real documentation** -- every parameter described,
with worked examples. It was previously serving an internal note by accident.

**Score colours are correct.** A config without colour bands used to print every score green,
including 0%.

FileList

Version History

Version Downloads Last updated
0.3.2 9 8/23/2026
0.3.1 (current version) 24 8/21/2026
0.2.2 7 8/18/2026
0.2.1 6 8/18/2026
0.2.0 8 8/17/2026
0.1.0 89 7/3/2026
Show more