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

Fuzz Shrinking feature #351

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

Fuzz Shrinking feature #351

wants to merge 19 commits into from

Conversation

MeditationDuck
Copy link
Member

@MeditationDuck MeditationDuck commented Oct 10, 2024

Fuzz Shrinking

1. Fuzz Test

To generate a crash log when the fuzz test is failing:

wake test tests/fuzz_test.py

2. Shrinking

To shrink the fuzz using the latest failure in the fuzz test:

wake test -SH

you can specify the test path. It verifies the testing target is the same:

wake test tests/fuzz_test.py -SH

Or specify a crash log directly:

wake test -SH .wake/logs/crashes/20241010_035704.txt

3. Reproduce the Error by Shrunk File

To reproduce the shrunk test:

wake test -SR

You can also specify the test here as well:

wake test tests/test_fuzz.py -SR

Alternatively, specify a shrunk data file:

wake test -SR .wake/logs/shrank/20241010_042322.bin

Shrinking phase

Shrinking tries to remove flows using two algorithms.
First, remove multiple flows thus it is faster, we print the progress of the removed flow.

Second, try to remove flow one by one.

✅ remove flow by flow kind (takes O(n))

✅ remove flow by brute force (takes O(n^2)

✅ flow fail because of removed flow dependency and it is not the target fail flow, can be removed.(checked precondition and un-executed flow will be removed in brute force shrink)

  • I clicked on "Allow edits from maintainers"

@jaczkal
Copy link
Member

jaczkal commented Oct 11, 2024

Does it also produce a crash log for failed invariants on assertions?

@jaczkal jaczkal requested a review from michprev October 11, 2024 14:04
@MeditationDuck
Copy link
Member Author

yes

@MeditationDuck
Copy link
Member Author

Now, shrinking work with this

wake test -SH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants