Re:Rust testing or verifying: Why not both?
by shepmaster on Friday September 04, 2020 @03:32PM
(#24378158)
As a previous user of quickcheck and now user of proptest, I can say that proptest feels much better to use because it doesn't tie quite as directly to a single type (as a sibling comment mentions).
With quickcheck, I had to define `MyTypeWithAnOddOffset` and `MyTypeWithAnEvenOffset` (or equivalent formulation) and composing things was tedious or hard.
With proptest [1], things flow much nicer.
[1]: https://github.com/shepmaster/jetscii/blob/2b1039a9fb8d8ad9c...
Re:Rust testing or verifying: Why not both?
by adreid on Friday September 04, 2020 @02:42PM
(#24377690)
Burnt Sushi only uses the type to generate values.
Proptest lets you constrain the values more precisely.
Eg you can create a btreemap with up to 5 entries where the keys are some subset of ints (say) and the values are some subset of some other type.
This can capture many of the constraints of a functions precondition and can be implemented efficiently in both fuzzers and verifiers.
I was under the impression that burntsushi's implementation of quickcheck [0] was the most popular property-based testing library for Rust. Was I mistaken or was there a reason the authors chose another library as inspiration?
[0] https://github.com/BurntSushi/quickcheck