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

Begin implementing fuzzing #4454

Merged
merged 18 commits into from
Jun 24, 2024
Merged

Begin implementing fuzzing #4454

merged 18 commits into from
Jun 24, 2024

Conversation

gtrepta
Copy link
Contributor

@gtrepta gtrepta commented Jun 19, 2024

This introduces the most basic functionality for doing fuzz testing of a property in K.

It adds a function fuzz to the ktool.kfuzz pyk module which takes the location of an llvm-kompiled definition, a template configuration in kore containing input variables to be randomized, a strategy for substituting those variables (so far, only with integers using kintegers), and either a function to check the resulting kore or a flag to check the exit code of the interpreter. It will invoke hypothesis to randomize the inputs and run the interpreter.

@gtrepta gtrepta changed the title Being implementing fuzzing Begin implementing fuzzing Jun 19, 2024
@gtrepta gtrepta marked this pull request as ready for review June 19, 2024 14:09
pyk/src/tests/integration/ktool/test_fuzz.py Outdated Show resolved Hide resolved
pyk/src/tests/integration/ktool/test_fuzz.py Outdated Show resolved Hide resolved
pyk/src/tests/integration/ktool/test_fuzz.py Outdated Show resolved Hide resolved
pyk/src/pyk/ktool/kfuzz.py Outdated Show resolved Hide resolved
pyk/src/pyk/ktool/kfuzz.py Outdated Show resolved Hide resolved
pyk/src/pyk/ktool/kfuzz.py Outdated Show resolved Hide resolved
pyk/src/pyk/ktool/kfuzz.py Show resolved Hide resolved
pyk/src/pyk/ktool/kfuzz.py Outdated Show resolved Hide resolved
raise RuntimeError('Must pass one of check_func or check_exit_code, and not both!')

def test(subst_case: Mapping[EVar, Pattern]) -> None:
def sub(p: Pattern) -> Pattern:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider extracting this to kore.manip.

@gtrepta gtrepta requested a review from tothtamas28 June 21, 2024 20:54
pyk/src/tests/integration/ktool/test_fuzz.py Outdated Show resolved Hide resolved
pyk/src/tests/integration/ktool/test_fuzz.py Outdated Show resolved Hide resolved
pyk/pyproject.toml Outdated Show resolved Hide resolved
pyk/src/pyk/ktool/kfuzz.py Outdated Show resolved Hide resolved
pyk/src/pyk/ktool/kfuzz.py Outdated Show resolved Hide resolved
pyk/src/pyk/ktool/kfuzz.py Outdated Show resolved Hide resolved
pyk/src/pyk/ktool/kfuzz.py Outdated Show resolved Hide resolved
pyk/src/pyk/ktool/kfuzz.py Outdated Show resolved Hide resolved
pyk/src/tests/integration/ktool/test_fuzz.py Show resolved Hide resolved
@rv-jenkins rv-jenkins merged commit c14fbb4 into develop Jun 24, 2024
18 checks passed
@rv-jenkins rv-jenkins deleted the pyk/fuzzing branch June 24, 2024 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants