Meta-tool to test a contract with various configs, using Echidna processes ("parade" is the proper name for a group of echidna)
Project description
This is an experimental script that uses configuration variance and a common corpus to try to throughly test a smart contract (or multiple contracts) with the Echidna smart-contract fuzzer (https://github.com/crytic/echidna).
It runs Echidna instances in parallel, and uses two basic ideas derived from my research:
-
swarm testing (https://agroce.github.io/issta12.pdf)
-
test length matters (https://agroce.github.io/ase08.pdf)
In particular, after an initial run to generate low-hanging-fruit easy pickings in terms of coverage, future runs will consist of a number of parallel runs (determined by an --ncores argument or however many cores Python thinks you have) where each run randomly omits some functions (if you have a list already, it's respected and added to), and the sequence length and search strategy are also varied.
Usage is almost like Echidna; in fact if you just use the same arguments as to Echidna, it'll probably work. E.g.,
> echidna-parade contract.sol --config config.yaml --contract TEST
will likely do something reasonable. By default "generations" of testing are 5 minutes in length, and the testing runs for an hour.
Our ISSTA tool paper explains more about the rationale and effectiveness of echidna-parade.
Try out the example in the 'examples' directory. Compare:
> echidna-test justlen.sol --config config.yaml --contract TEST
vs. what you can get with some knowledge of which functions not to omit from tests, and the same 120 seconds of testing with fast swarm generations:
> echidna-parade justlen.sol --config config.yaml --contract TEST --timeout 120 --initial_time 30 --gen_time 30 --ncores 8 --always "TEST.turn_on_length_checking()" "TEST.push_1()" "TEST.plus5()" "TEST.test_long_64()" "TEST.test_long_128()"
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for echidna_parade-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0019d7a24744b7af3eab277057f150f24c1bc1bb49971e18a2fc0215d0a4cd05 |
|
MD5 | 9bed2cc139130315c5c3f69332d8b057 |
|
BLAKE2b-256 | 88b6f3e8804782fcfcb80a153133e746df6101c570e5ac734254ec38f9df3e84 |
Hashes for echidna_parade-0.1.3-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbc0ad2346d76fdce92351a2da398dfd8178c53588ca505a2acced47950f1748 |
|
MD5 | 1c5eb1fb11a32d40171756f127f01188 |
|
BLAKE2b-256 | a6e5beb161f565707cf1b8901f261d79b7983789c5384d4806c6535e8771ef08 |