RANDOM DATA GENERATION WITH SCALACHECK
summary
Shows how to reuse ScalaCheck’s Gen.sample and Arbitrary to produce one-off random inputs for integration tests, then derive whole case classes with shapeless-derived arbitraries instead of hand fixtures. Adds a controllable seeded reproducibility (read from env) so failing random runs can be replayed, documents when to write custom Arbitrary (currency, constrained strings, age bounds), cautions against using ScalaCheck-generated data to bulk-populate DBs, and reports many real bugs found after adoption.
AI-written summary · about
chapters (13)
- 0:00Start
- 0:40Unit test vs. Integration test
- 1:13COMMON APPROACHES
- 3:22PROPERTY BASED TESTING - CONS
- 10:52RANDOM DATA GENERATOR - WIP
- 15:22EASIER TO MAINTAIN
- 15:51IMPROVED READABILITY
- 16:41BUGS
- 17:29ARBITRARY OF CUSTON TYPE
- 18:24CUSTOMISE YOUR ARBITRARY
- 21:03INDUCTIVE HEURISTICS TO THE RESCUE!
- 21:41shapeless.cached Implicit
- 23:41WRAP UP
related talks
53mPractical ScalaCheck
01h 00mA New Approach to Testing with ScalaCheck / Property Based Testing
31mProperty-based testing - let your testing library work for you
29mRandomness In Tests (Don't Do It)
38mPurely Random
14mChance Makes Good Tests
36mTesting for Lawful Good Adventures
25mPowerful Testing with test.check
