18 ms·
> If we're going to shrink big values to small ones, why not just start with small values in the first place. Because you want to test things in the order that
by dllthomas 10y ago
> If we're going to shrink big values to small ones, why not just start with small values in the first place.
Because you want to test things in the order that will most quickly find you a small error. This winds up being a trade-off, and as you say QuickCheck doesn't start with arbitrarily large inputs. But just testing all small inputs in order is often not the best choice.
For example, if your function takes an unsigned 32 bit integer, and you've tested inputs 0 through 15161, do you expect you're more likely to find an error next testing 15162, or 4294967295?