You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(* NOTE: we keep this alias to not break code that uses [small_int]
for sizes of strings, arrays, etc. *)
let small_int = small_nat
Unfortunately Gen.small_nat changed distribution from the interval [0;10000[ to the interval [0;100[ with QCheck version 0.10. Since version 0.5.2 Gen.small_int and Gen.small_nat's distributions were caused by a chain of aliases: Gen.small_int = Gen.small_nat = Gen.nat:
A bit of digging tells me Gen.small_int had the distribution in the interval [0;10000[ since version 0.5, it was briefly changed in 0.5.1 to output negative ints (#10), and then restored in 0.5.2 which also introduced the deprecation.
I found out, because rerunning some of my pre-0.10 code using Gen.small_int didn't find the expected counterexamples anymore.
With QCheck tests depending on distributions, a narrower distribution imply that test inputs are confined to a smaller subset.
Potentially this could mean bugs flying under the radar...
If someone is indeed using Gen.small_int for sizes of strings, lists, etc. as the compatibility note says, an upgrade from pre-0.10 means they silently started confining their tests to, e.g., strings of size [0;100[ compared to the earlier [0;10000[.
I see a couple of possibilities from here:
do nothing - after all, this change in distribution was introduced with 0.10 in 2019, keeping this issue for documentation
make Gen.small_int an alias to Gen.nat: let small_int = nat
thus restoring the old distribution in the interest of backwards compatibility
remove Gen.small_int: it is unclear whether anyone else noticed. Also: it has been deprecated since January 2017.
Removing it would force users to notice and act accordingly.
The text was updated successfully, but these errors were encountered:
I just noticed something about the deprecated
Gen.small_int
...First of all:
Gen.small_nat
qcheck/src/core/QCheck.ml
Lines 184 to 186 in b065a81
Unfortunately
Gen.small_nat
changed distribution from the interval[0;10000[
to the interval[0;100[
with QCheck version 0.10. Since version 0.5.2Gen.small_int
andGen.small_nat
's distributions were caused by a chain of aliases:Gen.small_int = Gen.small_nat = Gen.nat
:qcheck/src/core/QCheck.ml
Lines 97 to 105 in 52e4193
QCheck version 0.10, introduced the
Gen.small_nat / Gen.nat / Gen.big_nat
distinction and broke the last alias, thusGen.small_nat
s distribution explicitlyGen.small_int
s distribution as a side-effect:qcheck/src/core/QCheck.ml
Lines 97 to 99 in a3c8618
A bit of digging tells me
Gen.small_int
had the distribution in the interval[0;10000[
since version 0.5, it was briefly changed in 0.5.1 to output negativeint
s (#10), and then restored in 0.5.2 which also introduced the deprecation.I found out, because rerunning some of my pre-0.10 code using
Gen.small_int
didn't find the expected counterexamples anymore.With QCheck tests depending on distributions, a narrower distribution imply that test inputs are confined to a smaller subset.
Potentially this could mean bugs flying under the radar...
If someone is indeed using
Gen.small_int
for sizes of strings, lists, etc. as the compatibility note says, an upgrade from pre-0.10 means they silently started confining their tests to, e.g., strings of size[0;100[
compared to the earlier[0;10000[
.I see a couple of possibilities from here:
Gen.small_int
an alias toGen.nat
:let small_int = nat
thus restoring the old distribution in the interest of backwards compatibility
Gen.small_int
: it is unclear whether anyone else noticed. Also: it has been deprecated since January 2017.Removing it would force users to notice and act accordingly.
The text was updated successfully, but these errors were encountered: