~/talk

So writing tests feels painful. What now?

Talkat RailsConf 2024 · 2024-05-07..05-09· [testing, developer-experience]
slides:none on file

Painful RSpec work turns into a concrete refactor: an RSpec + FactoryBot test initially stubs Stripe::Subscription.new and stubs Trial.start, uses allow/expect to mock update and reaches green only after blocking external Stripe calls (WebMock errors show up). That brittle test prompts extracting a notified_update_with_trial method on the subscription, moving assertions into the Stripe subscription spec, and reducing stubbing and duplication. Expect hands‑on examples of the failing test, the stubbing sequence, and the minimal refactor that actually makes tests easier to trust.

AI-written summary · about

  1. 0:00Testing pain introduction
  2. 1:51Why testing feels overwhelming
  3. 3:58Pet crowdfunding example
  4. 7:30What tests are really for and why they matter
  5. 8:56Navigating messy tests
  6. 13:34Hidden dependencies revealed
  7. 15:00Taking a break
  8. 15:42Characterization tests
  9. 16:45Trustworthy tests reduce fear of change
  10. 17:49Reducing class responsibilities
  11. 21:21Encapsulating behavior
  12. 23:08Refactoring worth it
  13. 23:51Testing feedback loops
  14. 24:55Small testing improvements
  15. 26:00Quality in software design
  16. 27:24Closing thoughts
~/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.