Building test check Generators
summary
Practical guide to building test.check generators using core combinators (elements, fmap, bind, let macro), the size parameter (0–200) heuristic, and helpers like sample/generate, recursive and scale/frequency utilities. Shows a working recursive generator for nested directories plus a gen that emits vectors of file-append changes, replaces failing such-that with fmap to avoid rejection, and uses no-shrink for UUIDs. Explains bind vs fmap tradeoffs for composing generators and why bind makes shrinking harder but the composed generators still produce usable failing examples.
AI-written summary · about
chapters (10)
- 0:00Start
- 1:30Roadmap
- 2:49Basic Data Generators
- 7:43Value Proposition
- 8:14Universality & Purity
- 11:57Example collection-and-element
- 14:23Example a 2d matrix
- 24:58Summary: Building Things
- 26:27What does size mean eactly?
- 27:58string vectors
related talks
25mPowerful Testing with test.check
32mGenerative Testing: Properties, State and Beyond
36mTesting Stateful and Concurrent Systems Using test.check
53mPractical ScalaCheck
26mThe missing piece of testing
33mLets Generate Tests
23mProperty based testing is a mindset
46mTesting in the world of Functional Programming
