nick8325 / quickcheck

Automatic testing of Haskell programs.
Other
706 stars 119 forks source link

Fix discard ratio and maxSuccess interacting poorly #371

Closed MaximilianAlgehed closed 4 months ago

MaximilianAlgehed commented 4 months ago

Fixes #338

MaximilianAlgehed commented 4 months ago

@rewbert thoughts?

Rewbert commented 4 months ago

This whole discard thing is such a thorn in my side. The choice to compute sizes in this way seems to have been arbitrarily chosen initially (Koen looked guilty when I asked him about this!), so in my mind this is "equally arbitrary".

I have thought a lot about this, and have even tried out a few different approaches altogether, but have not landed in anything that is obviously superior. I think the question of sizes might be a more complicated one than it appears initially.

Regarding the eventual future merge of the parallel branch, this will not impact me negatively.

MaximilianAlgehed commented 4 months ago

For posterity, I had to factor out computeSize from State because the computeSize definition was set too early based on the Args arguments to quickCheckWith and thereby would ignore withMaxSuccess and withDiscardRatio.