Stateful property-based testing: with a game logic case study
summary
Builds an Elixir prototype of EVE space‑combat core and tests it with a stateful property‑based framework for Erlang/Elixir, finds a real concurrency bug where unloading races with modifier removal, and fixes it by ignoring already‑gone items. Tests generate long command traces then shrink them — demo shows 37→4 and the case study shrinks a 27‑command failure to 9 steps. The repo is ~900 LOC, example tests were ~350 LOC but stateful PBT covers bugs in 177 LOC and reproduces minimal counterexamples.
AI-written summary · about
chapters (28)
- 0:00Intro
- 0:14Topics
- 1:38EVE Online
- 3:45Core Rules
- 4:55LIAR Goals
- 6:00Defined APIs
- 8:53Flaws
- 11:38Finding Properties
- 12:41One More Thi... Flaw
- 14:16Stateful PBT
- 15:03Almost Stateless...
- 16:15Library Example
- 17:45Case Study: Concurrency Bug
- 21:03Shrinking
- 21:39Symbolic Calls
- 22:04Actual Calls
- 22:51Captured Logs
- 23:58Setup
- 24:21Crash
- 26:38Validating the Fix
- 27:26Other Bugs Revealed
- 27:41Lines of Code
- 30:41Five Callbacks
- 31:05command "filtering"
- 32:24precondition
- 34:06Stateful Test
- 34:31General Notes
- 35:30LIAR Specific
related talks
36mIntroduction to stateful property based testing
23mProperty based testing is a mindset
33mLets Generate Tests
26mThe missing piece of testing
20mUnlock The Power Of Property-Based Testing
46mProperty-based testing:You won't look at your tests the same way ever again
51mProperty-Based Testing
42mSurprise yourself with Property Based Testing
