~/talk

Lets Generate Tests

Talkat ElixirDaze 2017 · 2017-03-02..03-03· [testing]
speakerdeck:keathley
slides:none on file

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

  1. 0:00Start
  2. 7:16Write as few tests as possible
  3. 7:28Warning: Contrived Strawman Argument incoming!
  4. 9:37Pattern Matching
  5. 10:34Guard clauses
  6. 11:20What have we gained?
  7. 13:00There are bugs in your code
  8. 13:41Race conditions?
  9. 16:24Invariant: "a function, quantity, or property that remains unchanged when a specified transformation is applied."
  10. 16:42Basic Property Tests
  11. 21:21A Real-ish Example
  12. 31:14Conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.