✨ Bias towards extreme values for integer and bigint #1149
Merged
+2,291
−2,306
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.
In a nutshell
Up to now, when trying to bias generated values to fall quickly in classical corner cases, fast-check used to generate integer values close to zero. It did a quite nice job to find bugs in lots of programs. But most of the time when we build algorithms, we have bugs close to zero but also close to our boundaries (ie min and max values).
This new development tries to push bias to the next level: bias should not only find bugs related to small values but also the ones related to largest ones. When we say: our algorithm should work with integer value, fast-check should trust you and try any integer values including crazy ones like Number.MAX_SAFE_INTEGER if you said it worked for it too.
Next steps: In the future, arbitraries on strings (outside of this review) will also bias towards classical strings causing issues.
✔️ New feature
❌ Fix an issue
❌ Documentation improvement
❌ Other: please explain
(✔️: yes, ❌: no)
Potential impacts
Impact generated values of all the arbitraries of fast-check.
As integer is a root arbitrary for barely any of the arbitraries offered in fast-check, mos of the arbitraries will be impacted by this change (regarding generated values).