proptest-rs / proptest

Hypothesis-like property testing for Rust
Apache License 2.0
1.74k stars 161 forks source link

Improve edge case testing #504

Open PSeitz opened 2 months ago

PSeitz commented 2 months ago

To improve on https://github.com/proptest-rs/proptest?tab=readme-ov-file#limitations-of-property-testing, it would be nice if the default distribution would try to cover following edges cases for numbers (u64, i64 etc.):

NUM::MIN
NUM::MAX
NUM::MIN + 1
MIN::MAX -1
NUM::MAX / 2
NUM::MAX / 2 - 1
NUM::MAX / 2 + 1
1<<1
1<<2
1<<3
1<<4
...

This would already cover a lot of use cases. This could be done e.g. that one of those edge case values would be sampled with a 1% probability.

matthew-russo commented 2 months ago

This seems fairly straight forward for numeric types.

Mild amount of overlap with #284.

matthew-russo commented 2 months ago

369 for prior art -- will give that a look in a bit