PSMutant

0.3.2

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

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

Install-PSResource -Name PSMutant

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

**A per-mutant timeout that resolves too low is now refused instead of faking a perfect
score.** The budget is `max(timeoutFloorSeconds, baseline x timeoutFactor)`, and with a small
enough floor *and* factor it could resolve to zero. A zero-second budget expires immediately,
an expired mutant counts as a kill, and so every mutant was killed on the clock rather than on
behaviour -- 100%, exit 0, over tests that never ran. The budget must now be at least as long
as your unmutated suite took, and a config that asks for less fails with a message saying so.

If this affects you, your reported score was wrong in the flattering direction, and the run
that fails after upgrading is the honest one.

**A config path that escapes the source root is now refused.** Every path in a config is
copied into a temp sandbox and mutated there; a leading `..` survived that mapping, so a path
like `../shared/Util.ps1` was mutated **where it lives**, in your working tree. Interrupt such
a run and the mutated file stays on disk. Paths that merely contain `..` and still resolve
inside -- `src/../src/a.ps1` -- keep working.

FileList

Version History

Version Downloads Last updated
0.3.2 (current version) 9 8/23/2026
0.3.1 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