Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fuzz corpus saving and replay in standard format #2552

Open
mds1 opened this issue Aug 2, 2022 · 3 comments
Open

feat: fuzz corpus saving and replay in standard format #2552

mds1 opened this issue Aug 2, 2022 · 3 comments
Assignees
Labels
A-testing Area: testing C-forge Command: forge Cmd-forge-test Command: forge test T-feature Type: feature

Comments

@mds1
Copy link
Collaborator

mds1 commented Aug 2, 2022

Component

Forge

Describe the feature you would like

#991 was closed by #1658, but as documented by this comment there's some other related work, so pulling that into separate issues.


Follows #2551 to allow saving and replaying entire fuzz campaigns instead of just failures.

  • Capture fuzz campaigns via ResultCache (Or some other mechanism TBD).
  • Persist fuzz campaigns to /cache/fuzz/corpus-latest.json.
  • Re-use foundry.toml flag to specify outdir.
  • Add a replay proptest strategy that is powered by a corpus.json file.
  • Extend --fuzz-input-file option to additionally take a corpus.json file & forge test to trigger replay.
  • Ensure /cache/fuzz is removed with forge clean.
  • Consider a --generate-test-cases flag to autogenerate concrete tests from the fuzz inputs. these can be logged to the console for the user to put anywhere, or inserted directly below the failed fuzz test in the test file

Including the generated dictionary (perhaps as an optional flag if it's too big?) would be useful as well

Additional context

No response

@aviggiano
Copy link

Relevant discussion regarding the standardization of the corpus between fuzzing and property based testing tools:

crytic/medusa#234

@0xalpharush
Copy link
Contributor

I don't have a strong sense of what the right format would be but it would be nice to extend the export of #7899 to include the traces of unit tests as well

@grandizzy
Copy link
Collaborator

I don't have a strong sense of what the right format would be but it would be nice to extend the export of #7899 to include the traces of unit tests as well

Good idea, I created #8114 to track this, please add ant other relevant comment there. thank you!

@grandizzy grandizzy changed the title feat: fuzz corpus saving and replay feat: fuzz corpus saving and replay in standard format Jun 8, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
@grandizzy grandizzy self-assigned this Oct 15, 2024
@grandizzy grandizzy removed this from the v1.0.0 milestone Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testing Area: testing C-forge Command: forge Cmd-forge-test Command: forge test T-feature Type: feature
Projects
Status: Todo
Development

No branches or pull requests

6 participants