~/talk

The Magic Tricks of Testing

Talkat RailsConf 2013 · 2013-04-29..05-02· [testing]
slides:none on file

Argues that unit testing follows a six-cell grid with precise rules: test incoming queries by asserting return values, test incoming commands by asserting direct public side effects, and ignore private methods plus outgoing queries to avoid over‑specification. For outgoing commands the rule is to set expectations on outgoing commands and use mocks so tests stay fast and stable; mentions Ruby/Rails tooling and use mocks (moxin). Presents these rules in 28 minutes and claims the approach yields fewer, cheaper-to-maintain tests.

AI-written summary · about

  1. 0:00The state of testing
  2. 1:35Why tests are hated
  3. 3:20Principles of good tests
  4. 5:56Understanding message origins
  5. 7:44Queries vs commands
  6. 9:34Testing incoming messages
  7. 13:34Testing messages to self
  8. 15:50Testing outgoing queries
  9. 22:11Testing outgoing commands
  10. 23:21Using mocks safely
  11. 30:01Summary of testing magic
~/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.