proptest-rs / proptest

Hypothesis-like property testing for Rust
Apache License 2.0
1.63k stars 152 forks source link

Add iterative runner #396

Open define-null opened 8 months ago

define-null commented 8 months ago

This PR adds possibility to perform state machine testing with model that is aware of the system under test, as suggested in the https://github.com/proptest-rs/proptest/issues/378 I don't expect this code to be merged as is because while the approach is a fork with some modifications of the existing test_runner, there are some nuances here as well.

Some important changes additionally to iterative way of generating the transitions:

Would love to hear some feedback about the PR

define-null commented 5 months ago

Thank you for spending time to reviewing this.

Why would someone use the SequentialRunner instead of just using the IterativeRunner with no checking of the SutState?

One of the use-cases for the existing SequentialRunner that I can see is when the developer has a well-defined self-contained reference model. If that's the case and one would like to have strong guarantees that model implementation is separate from the system under test - SequentialRunner would be prefered. Thus, I guess, the choice of the terminology - Reference, as reference model, rather than just the Model as in the IterativeRunner case.

But otherwise everything that one may want to implement using SequentialRunner would be possible to do with IterativeRunner as well.