Improve your Tests with Property State-Machine Tests
summary
Demonstrates property state‑machine testing with the new Karat library built on ScalaCheck (plus ScalaCheck-effect and HTTP4s integrations), using temporal logic style specifications and action generators instead of white‑box invariants. Concrete results include reproducing the LevelDB literature bug as 17 then 33‑step counterexamples, and finding a crafted bounded‑queue bug after ~1,000+ runs; test shrinking yields minimal failing traces and reproducible seeds. The approach treats systems as black‑box HTTP APIs, verifies temporal properties across complete traces, and successfully uncovers both implementation and spec errors.
AI-written summary · about
chapters (17)
- 0:00Introduction
- 1:10About speaker
- 2:11Why property-based testing
- 3:15Unit vs property tests
- 4:21Core concepts
- 8:19Stateful testing explained
- 12:35Demo with ScalaCheck
- 18:59Edge cases challenge
- 21:51Limitations of stateful testing
- 22:13Property state-machine testing
- 23:36Key components
- 25:25Introducing Karat
- 29:40Karat concepts to tests
- 30:02Testing HTTP APIs
- 35:24Benefits of state-machine testing
- 38:43Debugging with shrinking
- 40:11Recap and key takeaways
related talks
01h 00mA New Approach to Testing with ScalaCheck / Property Based Testing
48mDomain Invariants & Property-Based Testing for the Masses
31mProperty-based testing - let your testing library work for you
20mType-level Property Based Testing
46mTesting in the world of Functional Programming
26mThe missing piece of testing
36mIntroduction to stateful property based testing
56mProperty based Testing for Functional Domain Models
