Skip to content

Fuzz testing (v1)#90

Draft
ikripaka wants to merge 21 commits into
devfrom
feat/proptest
Draft

Fuzz testing (v1)#90
ikripaka wants to merge 21 commits into
devfrom
feat/proptest

Conversation

@ikripaka

@ikripaka ikripaka commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator
  • This PR suggests a bug fix and I've added the necessary tests.
  • This PR introduces a new feature and I've discussed the update in an Issue or with the team.
  • This PR is just a minor change like a typo fix.

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)

  • 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

Add the fuzz module to smplx-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::TestRunner by using it only as a random generator.
In the latest implementation, we don't rely on the correct proptest::Strategy implementation 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.rs together with the macro implementation.

Moreover, besides tests, we have different start strategies implemented for Args and Wit generation:

  • InterestingRandom - uses additional predefined interesting values
  • RandomValuePool - uses values from the pool and tries to insert them into both structs if it happens
  • Random - pure random values generation

@ikripaka ikripaka self-assigned this Jun 8, 2026
Base automatically changed from dev to master June 9, 2026 11:57
@ikripaka ikripaka changed the base branch from master to dev June 10, 2026 08:49
@ikripaka ikripaka force-pushed the feat/proptest branch 2 times, most recently from 6fba823 to dade0b0 Compare June 16, 2026 14:02
@ikripaka ikripaka force-pushed the feat/proptest branch 3 times, most recently from 69fb9bd to fad166c Compare June 18, 2026 07:14
@ikripaka ikripaka changed the title Mutant testing (v1) Fuzz testing (v1) Jun 30, 2026
Base automatically changed from dev to master June 30, 2026 19:43
ikripaka added 16 commits July 1, 2026 10:51
…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
ikripaka added 5 commits July 1, 2026 10:51
* 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)
@ikripaka ikripaka changed the base branch from master to dev July 1, 2026 07:58
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.

1 participant