~/talk

"Testing. Why so serious?"

Talkat RubyC 2017 · 2017-06-03..06-04· [testing]
links:none on file
slides:none on file

Argues that using test doubles and RSpec features like instance_double cuts suite time from ~15 minutes to ~1 minute for ~4,000 specs by stubbing external calls (ActiveRecord find/update/destroy, Pusher notify) and testing service objects’ behavior instead of data flow. Presents four concrete rules: mock roles not objects, mock your own API, avoid mocking peers or internals, and measure which method calls are actually slow. Shows examples of brittle mocks (replacing find with where breaks tests) and working replacements that keep tests fast and flexible.

AI-written summary · about

  1. 0:00Introduction
  2. 0:22Doubles in testing
  3. 1:57Sociable vs solitary tests
  4. 3:25Mocks and magic
  5. 4:10Common mocking problems
  6. 7:35Mock roles not objects
  7. 10:27Mock your own API
  8. 12:38Mock peers not internals
  9. 13:21Why mocks can be slow
  10. 14:04Testing with real data
  11. 19:41When to mock database calls
  12. 25:00Classic testing vs mocking
  13. 26:28Speed vs comfort in tests
  14. 27:35Handling external data flows
  15. 28:44Further resources
~/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.