Please log in to watch this conference skillscast.
Property-based testing (PBT) is a valuable tool in the functional programming world: it generates test inputs for you (finding tricky edge cases you wouldn't be able to find manually) and lets you specify and verify laws and invariants about your code with ease. Virtually all PBT tools nowadays shrink the failing inputs to a minimal (and thus much more helpful) counterexample before presenting it to you. Implementing shrinkers can be tricky, though. I'll walk through the common shrinking algorithms (seen in QuickCheck, Hedgehog, ScalaCheck, etc.), their inherent problems, and most importantly: how to implement shrinking in a way that doesn't suffer from them!
YOU MAY ALSO LIKE:
- How to do Property-based Testing Shrinkers Right (SkillsCast recorded in December 2022)
- Scala Days 2023 (Online Conference on 1st - 30th December 2023)
- Teaching Haskell...To High Schoolers! (SkillsCast recorded in December 2022)
- Teaching Haskell...To High Schoolers! (SkillsCast recorded in December 2022)
How to do Property-based Testing Shrinkers Right
Martin Janiczek
Martin Janiczek loves to start things and little one-off experiments. He has a drive for teaching and unblocking others.