[ANN] QCheck 0.24

I’m happy to announce the 0.24 release of qcheck, qcheck-core, qcheck-alcotest, and qcheck-ounit, along with a 0.6 release of ppx_deriving_qcheck :tada:

QCheck is a library for randomized property-based testing, inspired by Haskell’s seminal QuickCheck library. The 0.24 release contains a range of improvements to the integrated shrinking of QCheck2, initially introduced in the 0.18 release. As a consequence, its shrinking algorithms should act more predictably, reduce faster, and report smaller counterexamples. In essence, the 0.24 release is what we hoped 0.18 would be. The release also adds missing result, int32, and int64 combinators, as well as more documentation.

If you’ve previously given QCheck2’s integrated shrinking a spin, I encourage you to try it again with the patched 0.24 release. For new users, the 0.24 release is also a good candidate to check out! :smiley:
Please share any problems you encounter on the qcheck repo: GitHub - c-cube/qcheck: QuickCheck inspired property-based testing for OCaml.

Full change log:

  • [qcheck-alcotest] Add an optional speed_level parameter to to_alcotest
  • Adjust the QCheck2.Gen.list shrinker to produce minimal counterexamples at size 3 too
  • Replace the QCheck2 OCaml 4 Random.State.split hack with a faster one
  • Improve the QCheck2.Gen.list shrinker heuristic and utilize the improved shrinker in other QCheck2 {list,array,bytes,string,function}* shrinkers
  • Use split and copy in Random.State underlying QCheck2 to avoid non-deterministic shrinking behaviour
  • Add missing documentation strings for QCheck.{Print,Iter,Shrink,Gen} and QCheck2.Gen.
  • Add result combinators to QCheck, QCheck.{Gen,Print,Shrink,Observable}, and QCheck2.{Gen,Print,Observable}.
  • Add missing combinators QCheck{,2}.Print.int{32,64}, QCheck.Gen.int{32,64}, QCheck{,2}.Observable.int{32,64}, and deprecate QCheck.Gen.{ui32,ui64}
  • Document dune usage in README

Happy testing! :smiley: :keyboard:

15 Likes

FYI, QCheck 0.25 is now available from the opam repository :smiley:

The 0.25 release contains a combination of all-round fixes, documentation, and polishing:

  • Restore Test.make’s max_fail parameter which was accidentally broken in 0.18
  • Adjust stats computation of average and standard deviation to limit precision loss, print both using scientific notation, and workaround MinGW float printing to also pass expect tests
  • Fix dune snippets missing a language specifier in README.adoc causing asciidoc to error
  • Add a note to QCheck{,2.Gen}.small_int_corners and QCheck{,2}.Gen.graft_corners about internal state, and fix a range of documentation reference warnings
  • Reorganize and polish the README, rewrite it to use qcheck-core, and add a QCheck2 integrated shrinking example
  • Document QCHECK_MSG_INTERVAL introduced in 0.20
  • Add QCheck{,2}.Gen.map{4,5} combinators

The accompanying ppx_deriving_qcheck.0.7 release offers:

  • Support ppxlib.0.36.0 based on the OCaml 5.2 AST

Thanks to @Pat-Lafon and @patricoferris for contributing PRs! :tada:

Happy testing! :smiley: :keyboard:

8 Likes