~/talk

Better code through boring(er) tests

Talkat Red Dot Ruby Conference 2017 · 2017-06-22..06-23· [testing]
github:bhaibel
slides:none on file

Tests get hated because they mirror bad code and brittle assumptions and this talk gives concrete fixes: stop directly testing private methods by making small methods public, extracting a class or adding introspection; remove duplication by extracting real application behavior into a repository pattern or class instead of shared test helpers; avoid “inventing the universe” setup by moving important setup into application-level factories (not just factory_girl shorthands) or by stubbing external HTTP with webmock to keep tests boring and refactorable.

AI-written summary · about

  1. 0:00Start
  2. 5:06TESTING PRIVATE METHODS - THE PROBLEM
  3. 5:52TESTING PRIVATE METHODS - ALTERNATIVES
  4. 6:28TESTING PRIVATE METHODS - EXTRACT SIMPLE CLASS
  5. 7:12TESTING PRIVATE METHODS - DEFER THE DECISION
  6. 7:55DUPLICATE TESTS - THE PROBLEM
  7. 9:21DUPLICATE TESTS - THE SHARED EXAMPLE GROUP SMELL
  8. 10:26DUPLICATE TESTS - THE DIRECT MODULE TEST SMELL
  9. 10:49DUPLICATE TESTS - THE EXTRACT CLASS FIX
  10. 11:08DUPLICATE TESTS - THE KEY IDEA
  11. 11:45INVENTING THE UNIVERSE - THE PROBLEM
  12. 12:06INVENTING THE UNIVERSE - THE PREMATURE FIX SMELL
  13. 14:08INVENTING THE UNIVERSE - SHARED CONTEXT SMELL
  14. 16:24INVENTING THE UNIVERSE - FACTORY_GIRL SMELL
  15. 20:36A 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.