@godzillaba/mutest
v1.6.2
Published
Mutation testing for Solidity. Uses [Gambit](https://github.com/Certora/gambit) to generate mutants and [Foundry](https://github.com/foundry-rs/foundry) to test them.
Downloads
927
Readme
mutest
Mutation testing for Solidity. Uses Gambit to generate mutants and Foundry to test them.
Usage
npx @godzillaba/mutest src/Counter.solPass one or more Solidity files. Mutest will:
- Create parallel copies of your project (8 by default)
- Generate mutants with Gambit (e.g.
++->--, assignments replaced) - Run
forge testagainst each mutant across the worker copies - Report which mutants were killed (tests caught them) or survived (coverage gap)
Surviving mutants are written to gambit_out/survivors.json.
Re-testing survivors
Run without arguments to re-test only the survivors from a previous run:
npx @godzillaba/mutestThis reads gambit_out/survivors.json (or falls back to gambit_out/gambit_results.json) and re-runs the test suite against those mutants. Useful after improving your tests to check if previously surviving mutants are now caught.
Options
--workers <n> / -w <n> — number of parallel workers (default: 8).
npx @godzillaba/mutest --workers 4 src/Counter.sol--test-cmd <cmd> / -t <cmd> — override the test command. The command runs via bash -c with the worker directory as cwd. Defaults to forge test --optimize false --threads 1 --root <workerDir>.
npx @godzillaba/mutest --test-cmd "npx hardhat test" src/Counter.sol