A New Approach to Testing with ScalaCheck / Property Based Testing
summary
ScalaCheck is presented as a property-based testing tool that runs hundreds to thousands of randomized cases and automatically shrinks failing inputs to minimal counterexamples. The talk covers writing properties (e.g., max on lists, monoid/monad laws), building and combining custom generators with weights and labels to inspect input distributions, and integrating tests with sbt/specs2 so failures yield reproducible seeds instead of opaque examples.
AI-written summary · about
chapters (25)
- 0:00Introduction
- 1:10Traditional test limits
- 3:26Property based testing
- 8:19ScalaCheck properties
- 10:10ScalaCheck test example
- 13:18Generators creation
- 17:24Generator transforms
- 20:29Collection generators
- 23:03Generator weights
- 27:11PBT domains
- 29:35PBT restrictions
- 32:13Debugging counterexamples
- 35:07Sorted lists properties
- 38:05Unit test integration
- 39:34Monoids laws
- 40:43Monoid integers example
- 42:29Associativity identity laws
- 45:04String monoids
- 46:37Monoid products
- 48:15Parallel execution
- 50:06Function comparisons
- 51:36ScalaCheck benefits
- 54:13Integer overflow checks
- 55:37Migrating to PBT
- 57:11Q&A
related talks
56mProperty based Testing for Functional Domain Models
31mProperty-based testing - let your testing library work for you
53mPractical ScalaCheck
25mPowerful Testing with test.check
48mDomain Invariants & Property-Based Testing for the Masses
46mTesting in the world of Functional Programming
47mProperty-Based Testing
18mProperty-based testing beginning with SwiftCheck
