Generating Generators
summary
Herbert automatically turns EDN Herbert schemas into test.check generators and also produces predicates via conform? so the same schema can be used to generate inputs and check outputs, with shrinking of failures. Examples include vector-of-ints with binding into gen/elements and regex-constrained strings. Practical limits: generators from schemas handle quantifiers and optional keys but struggle with complex negation/conjunction limitations (filters that cause gen to give up or throw) and there is a known nested binding bug and some performance edge cases.
AI-written summary · about
chapters (17)
- 0:00Background
- 0:50Overview
- 2:31Herbert Schemas
- 3:34Patterns
- 4:47Quantifiers
- 5:59Herbert API
- 7:47Property-based testing
- 11:09Properties
- 15:31Generators & Combinators
- 18:11Vector and an Element
- 21:57Optional Keys
- 24:22Bindings
- 25:43Property from Schemas
- 27:01Herbert check
- 29:45Herbert Summary
- 31:48Generator Limitations
- 35:54To Do
related talks
48mContracts & Clojure: The Best-Yet Compromise of Types and Tests
25mPowerful Testing with test.check
43mspec loves data structures
01h 03mMaybe Not
24mSpeculative Development
30mAdventures in homoiconicity
42mZeder - Production Rule Systems in Clojure
40mCreating DSLs A tale of spec tacular success and failure
