To inspect the distribution of generators QCheck offers
As part of reworking the generator and extending our existing tests of Stdlib.Sys I found myself
Based on the above, I found myself
- wanting a generalization of
set_collect that would allow to describe and summarize several separately specified labelings for one test - currently set_collect is singular, whereas set_stats is plural (and add_stat lets us add more)
and envious about
labelExamples - to observe a sample from a label (e.g., "What's an example classified as a non-empty list?")
checkCoverage - to ensure a certain distribution (e.g., "At lease 10% of the test input is Some with a non-empty list")
along the lines of the Haskell and Elm APIs:
https://hackage.haskell.org/package/QuickCheck-2.15.0.1/docs/Test-QuickCheck.html#g:21
https://package.elm-lang.org/packages/elm-explorations/test/2.2.0/Fuzz#labelExamples
https://package.elm-lang.org/packages/elm-explorations/test/2.2.0/Test-Distribution
https://package.elm-lang.org/packages/elm-explorations/test/2.2.0/Test#reportDistribution
To inspect the distribution of generators
QCheckoffersGen.generate{,1}to observe samplesset_collectto label each sample with astringadd_statandset_statsto print a histogram and calculate avg/stddev/... based on some numeric property (e.g.,List.length)As part of reworking the generator and extending our existing tests of
Stdlib.SysI found myselfBased on the above, I found myself
set_collectthat would allow to describe and summarize several separately specified labelings for one test - currentlyset_collectis singular, whereasset_statsis plural (andadd_statlets us add more)and envious about
labelExamples- to observe a sample from a label (e.g., "What's an example classified as a non-empty list?")checkCoverage- to ensure a certain distribution (e.g., "At lease 10% of the test input isSomewith a non-empty list")along the lines of the Haskell and Elm APIs:
https://hackage.haskell.org/package/QuickCheck-2.15.0.1/docs/Test-QuickCheck.html#g:21
https://package.elm-lang.org/packages/elm-explorations/test/2.2.0/Fuzz#labelExamples
https://package.elm-lang.org/packages/elm-explorations/test/2.2.0/Test-Distribution
https://package.elm-lang.org/packages/elm-explorations/test/2.2.0/Test#reportDistribution