~/talk

Better Code Through Boring(er) Tests

Talkat RubyConf 2016 · 2016-11-10..11-12· [testing]
github:bhaibel
slides:none on file

Tests often become a maintenance nightmare and the fix is concrete: three refactorings that reduce brittleness and duplication. The talk shows replacing testing private methods with small public collaborators or extracted objects (a shim object that later gets refactored away), turning shared module specs into a dedicated class, and moving heavy setup out of tests into constructors or application-level factories rather than into FactoryGirl helpers. Examples use mini test and RSpec idioms and report that these changes make both tests and app code simpler and more stable.

AI-written summary · about

  1. 0:00Start
  2. 6:14TESTING PRIVATE METHODS - THE PROBLEM
  3. 7:08TESTING PRIVATE METHODS - ALTERNATIVES
  4. 7:57TESTING PRIVATE METHODS - EXTRACT SIMPLE CLASS
  5. 9:01TESTING PRIVATE METHODS - DEFER THE DECISION
  6. 10:05DUPLICATE TESTS - THE PROBLEM
  7. 12:05DUPLICATE TESTS - THE SHARED EXAMPLE GROUP SMELL
  8. 14:40DUPLICATE TESTS - THE KEY IDEA
  9. 15:23INVENTING THE UNIVERSE - THE PROBLEM
  10. 17:03INVENTING THE UNIVERSE - THE PREMATURE FIX SMELL
  11. 18:22INVENTING THE UNIVERSE - SHARED CONTEXT SMELL
  12. 21:22INVENTING THE UNIVERSE - FACTORY_GIRL SMELL
  13. 22:36INVENTING THE UNIVERSE - THE PLAIN FACTORY FIX
  14. 25:56A MAGIC TRICK
~/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.