upgrade slither-mutate readme

pull/2391/head
bohendo 8 months ago
parent 9dee8a2a50
commit 640d675e5d
No known key found for this signature in database
  1. 20
      slither/tools/mutator/README.md

@ -2,15 +2,24 @@
`slither-mutate` is a mutation testing tool for solidity based smart contracts.
## Usage
## Quick Start
`slither-mutate <codebase> --test-cmd <test-command> <options>`
In a foundry project with **passing** tests that are run with `forge test`, you can mutate all solidity files in the `src` folder by running the following:
To view the list of mutators available `slither-mutate --list-mutators`
`slither-mutate src --test-cmd='forge test'`
You can provide flags to `forge` as part of the `--test-cmd` parameter or target a single file path instead of the whole `src` directory, for example:
`slither-mutate src/core/MyContract.sol --test-cmd='forge test --match-contract="MyContract"'`
### CLI Interface
```shell
$ slither-mutate --help
usage: slither-mutate <codebase> --test-cmd <test command> <options>
Experimental smart contract mutator. Based on https://arxiv.org/abs/2006.11597
positional arguments:
codebase Codebase to analyze (.sol file, project directory, ...)
@ -24,10 +33,11 @@ options:
--timeout TIMEOUT Set timeout for test command (by default 30 seconds)
--output-dir OUTPUT_DIR
Name of output directory (by default 'mutation_campaign')
--verbose output all mutants generated
-v, --verbose log mutants that are caught as well as those that are uncaught
-vv, --very-verbose log mutants that are caught, uncaught, and fail to compile. And more!
--mutators-to-run MUTATORS_TO_RUN
mutant generators to run
--contract-names CONTRACT_NAMES
list of contract names you want to mutate
--quick to stop full mutation if revert mutator passes
--comprehensive continue testing minor mutations if severe mutants are uncaught
```

Loading…
Cancel
Save