Property-Based Testing - Examples from Business Applications
summary
Journey from failing with QuickCheck to practical success with Hedgehog: property tests target a Postgres-backed task/job queue and a small Wai/Servant web app. Round‑trip JSON tests expose a surprising Unicode handling bug in the API pipeline. Search‑and‑sort queries are validated by comparing DB results to an in‑memory simplified model, catching ordering/aggregation errors. Job‑runner properties assert things like no job locked after graceful shutdown, every job is attempted, no double pickup, and concurrency limits are respected.
AI-written summary · about
chapters (22)
- 0:00Introduction
- 0:20About Saurabh
- 2:36Infrastructure
- 4:46Hedgehog Library
- 4:58How do you write properties
- 7:22Reverse list twice
- 7:47Properties in real life apps
- 8:08PropertyBased vs ExampleBased
- 10:36Round tripping
- 20:25Associativity and Commutativity
- 25:45No Property Test
- 27:31Comparing Against Another System
- 28:35Implement a Simplified Model
- 28:55Simplifying Stateful Systems
- 29:34Indepth Example
- 29:54Quick Overview
- 30:18Job Filtering
- 31:27Filtering
- 33:35Simplifying
- 33:57Job Monitor
- 40:22metered usage
- 40:56other resources
related talks
01h 31mIntroduction to Property-Based Testing
51mProperty-Based Testing
46mProperty-based testing:You won't look at your tests the same way ever again
01h 24mIntroduction to Property Based Testing
29mHardening Applications with Property Tests
36mProperty-Based Testing: Unveiling the Truth on Test Reduction
21mProperty-based testing - let your testing library work for you
23mProperty based testing is a mindset
