Lets Generate Tests
summary
Claims that property-based testing with Elixir (QuickCheck-style generators) finds real bugs not caught by example tests; models users as a finite state machine, generates ~20 random commands, runs them serially and in parallel against a small Phoenix channels lunch-vote app, then uses shrinking to produce a minimal failing sequence. Concrete result: it uncovers a race where two concurrent votes lose an increment, reproducible by the shrunken command list.
AI-written summary · about
chapters (12)
- 0:00Start
- 7:16Write as few tests as possible
- 7:28Warning: Contrived Strawman Argument incoming!
- 9:37Pattern Matching
- 10:34Guard clauses
- 11:20What have we gained?
- 13:00There are bugs in your code
- 13:41Race conditions?
- 16:24Invariant: "a function, quantity, or property that remains unchanged when a specified transformation is applied."
- 16:42Basic Property Tests
- 21:21A Real-ish Example
- 31:14Conclusion
related talks
23mProperty based testing is a mindset
26mThe missing piece of testing
42mSurprise yourself with Property Based Testing
25mPowerful Testing with test.check
32mGenerative Testing: Properties, State and Beyond
20mUnlock The Power Of Property-Based Testing
45mProperty based tests for the masses
36mStateful property-based testing: with a game logic case study
