Fuzz testing (v1)#90
Draft
ikripaka wants to merge 27 commits into
Draft
Conversation
6fba823 to
dade0b0
Compare
* feat: add imports support * feat: filter files with `fn main` * fix: apply linting suggestions from review * feat: add dependency installation. Refactor code a bit * fix: `ArtifactsResolver::contains_main` function, refactor docstring * chore: format code with `cargo fmt` * refactor: delete redundant files in `fixtures` * fix: apply linting suggestions from review * fix: linter * upd readme * refactor: separate `collector.rs` from the `resolver.rs` and apply linter suggestions --------- Co-authored-by: Artem Chystiakov <artem.ch31@gmail.com>
69fb9bd to
fad166c
Compare
* feat: update Simplex with unstable features * fix version --------- Co-authored-by: Artem Chystiakov <artem.ch31@gmail.com>
…ns for witness and arguments respectively * extend ui tests to test random generation * add new `RandomArguments` and `RandomWitness` traits for classifying random generation * add random generation expansion in the `include_simf!` macro * add `rand_core` and `rand` dependencies in the workspace
* update macros (add From implementations and other helpers for proptests) * update ui tests * update interface of program creation (change ArgumentsTrait into the Into<Arguments>) * add 2 property tests in fixtures/tests/prop_testing.rs
* add one more contract for testing * adapt previous one with new way of testing
* add program trait helpers generation in the macros * fix little warnings * remove SimplexProgram * change dependence onto AsRef<Program> trait instead of SimplexProgram
* fix warning with failure case persistence in the proptest
…, Wit> and UserFuzzStrategy * user also has choice to declare with extension or without
* add a macros implementation for proptesting * add Clone for EsploraProvider * add possibility to run proptests via the cli
macros: * rename proptest -> fuzz * remove redundant #[must_use] * change naming of tests under the hood for fuzzing provider: remove unused Clone implementation strategies: * fragment and separate them into separate crates * add Interesting strategy fuzz_engine: * add FinalTransactionBuilder, which uses dummy program as input fixtures: * remove SimpleStorage example (very complex by now)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add RandomArguments and RandomWitness trait implementations for witnesses and arguments, respectively, for the generation of input values in PropTests.
(By now, we have a first version - generating Witness and Arguments together with passing them as input into the contract)
RandomArgumentsandRandomWitnesstraits for classifying random generationinclude_simf!macrorand_coreandranddependencies in the workspaceAdd the
fuzzmodule tosmplx-test, where the logic is implemented.Later, we need to decide how we would like to implement property tests.
Fuzz testing run strategies using
proptest::TestRunnerby using it only as a random generator.In the latest implementation, we don't rely on the correct
proptest::Strategyimplementation and propagation.Now we can set any number of parameters and generate them easily with Rng defined in proptest.
Draft tests can be found in
simplex/fixtures/tests/prop_testing.rstogether with the macro implementation.Moreover, besides tests, we have different start strategies implemented for Args and Wit generation: