~/talk

To Mock or Not to Mock

Talkat Rocky Mountain Ruby 2012 · 2012-09-19..09-21· [testing]
slides:none on file

Argues that mock use must match the test’s goal and gives concrete measures: ActiveRecord base exposes 301 public methods so isolation is hard, end-to-end tests prove safety at high cost, and isolation TDD (the Goose approach) yields tiny fast suites—he cites 3–4k specs in under 3–4 seconds. Recommends four strategies (maximize realism, mock boundaries, case-by-case, grow OO), warns Rails forces tradeoffs, and notes a homegrown test-double library gimme and the company TestDouble.

AI-written summary · about

  1. 0:00Start
  2. 1:18Maximally Realistic Test
  3. 5:29Avoid over Mocking
  4. 6:12Types of Tests
  5. 6:26End-to-End Test
  6. 6:44End-to-End Tests
  7. 6:58Dog Feeder Class
  8. 10:48Roll Your Own Stubs
  9. 11:10Example for Mocha
  10. 13:23Motivations for Tests Acceptance
  11. 14:27Regression
  12. 15:01Test Driven Design
  13. 17:54Slow Feedback
  14. 18:28Mocking Boundaries
  15. 21:36Developer Freedom
  16. 31:14Inherited Surface Area
  17. 35:27Testable Libraries for Ruby
~/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.