Writing Fuzz Test#
Important
At the current development stage, there are some manual steps required to start the Fuzzing Session. In principle:
Prerequisites:
- Add dependencies specific to your program to
trident-tests/fuzz_tests/Cargo.toml
(such as anchor-spl etc.). - Add necessary
use
statements intotrident-tests/fuzz_tests/<FUZZ_TEST_NAME>/accounts_snapshots.rs
to import missing types.
Writing Fuzz Tests
- Include desired Programs Include Programs.
- Specify pseudo-random accounts to re-use Accounts to re-use.
- Specify instruction data Instruction Data.
- Specify instruction accounts Instruction Accounts.
Run and Debug
Note
For better fuzzing results and experience you can also manually adjust the following:
- Define Invariants checks Invariants Checks.
- Specify instruction sequences Instruction sequences.
- Specify custom data types Custom Data types.
- Well structured data Arbitrary.
- AccountsSnapshots macro AccountsSnapshots.