~/talk

High Cost Tests and High Value Tests

Talkat RubyConf 2017 · 2017-11-15..11-17· [testing]
slides:none on file

An inventory management Rails app gets tested with Capybara system tests, mid-level workflow/service objects and fast unit specs, and the numbers matter: about 180 specs total, system tests run 0.5–3s each, 22 system specs take ~13s so 12% of specs cost 75% of runtime, and the slowest four tests are 40% of run time. Edge cases get unit tests that run in milliseconds, factory_bot associations and end-to-end tests cause most long-term cost, and faster focused tests make failures easy to locate.

AI-written summary · about

  1. 0:00Start
  2. 2:27I could just write integration tests
  3. 3:38I'm making a decision
  4. 3:53What does worth it mean?
  5. 4:50How can you measure cost and value?
  6. 7:00How do tests cost time?
  7. 7:24runs A lot
  8. 8:07fixed
  9. 8:30How do tests save time?
  10. 8:57Running the test is faster than manual testing
  11. 10:03Bugs Faster
  12. 11:17Forever
  13. 12:20Strategy Tactics
  14. 17:36System tests are 12% of the code and 75% of the output
  15. 18:48Another project
  16. 20:15Balance 1 time spent
  17. 20:55down
  18. 21:24Short term cost is not related to test type
  19. 22:23runtime failure
  20. 22:38complexity
  21. 24:00No individual test causes a slow suite
  22. 28:27Failure paths: Bad Input
  23. 28:54System Test Workflow Test Unit test
  24. 32:09A lot of Copy/Paste
  25. 32:46Logic change is far away from method under test
  26. 33:05Capybara is not a unit test framework
  27. 33:58TDD is Dead
  28. 34:29Unit tests cost too much to write
  29. 35:06True if framework doesn't handle tests
  30. 35:16Unit tests force hard to understand designs
  31. 36:12Really good legacy code strategy
  32. 36:26Strategies
  33. 36:42fail?
  34. 38:09Create the minimum amount of objects needed to trigger the failure
  35. 38:32Use multiple test failures as an opportunity
  36. 39:09Use integration tests to save development time
~/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.