~/talk

Breaking the bank with test contract

Talkat Clojure/conj 2024 · 2024-10-23..10-25· [testing]
github:arohner
slides:none on file

Claim: test.contract (Clojure) gives fast, deterministic generative tests that replace slow integration setups by modeling stateful protocols. Uses test.check QuickCheck-style generators, pure-state models, shrinking (an example failing sequence shrinks from ~50 calls to 2), and three primitives: verify (model vs real), mock (pure in-memory substitute), and test proxy (dual-call shadowing). Applied at a 150,000-line bank codebase with ~150 tests, it removes test containers and flaky network deps and proves the mock matches production behavior.

AI-written summary · about

  1. 0:00Introduction
  2. 1:32Side effects and nondeterminism
  3. 3:17Why test
  4. 4:08Quick Check
  5. 9:05Traditional advice
  6. 10:28The missing axis
  7. 11:23Determinist simulation testing
  8. 15:23Lessons learned
  9. 15:59Why we killed our N test suite
  10. 16:20My Approach
  11. 16:35Application
  12. 17:45Closure protocol
  13. 18:36Closure model
  14. 20:39Verify model
  15. 21:37Mocks
  16. 24:49Injection errors
  17. 25:20Shrinking
  18. 27:03Recap
  19. 27:38Limitations
  20. 29:23Lessons
  21. 29:33Define the correctness
  22. 31:02Weve used test contract
  23. 31:55What do we need
  24. 33:15Consistency model
  25. 33:29Consistency chart
  26. 36:22Summary
~/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.