~/talk

Dirty Tests and How to Clean Them

Talkat TestCon Europe 2022 · 2022-10-26..10-27· [testing]
slides:none on file

Argues that test code deserves the same refactoring and review as production code and demonstrates it on a calculator API suite: converts duplicated setup into a beforeEach setup, extracts a API call wrapper holding RestTemplate and ObjectMapper, introduces a builder defaults pattern for test data, replaces magic literals with named constants, and renames tests for intent. Uses JUnit 5 and Spring test plumbing, keeps behavior identical (tests still pass) and warns static analyzers like SonarQube never replace human review.

AI-written summary · about

  1. 0:00Clean test code mission
  2. 1:16Test code deserves clean standards
  3. 3:00Test code quality perception
  4. 7:18Investing in future efficiency
  5. 9:05Clean code definitions
  6. 10:32Key principles of clean tests
  7. 15:29Test code smells and anti-patterns
  8. 18:18Live demo: dirty Java tests
  9. 21:55Refactoring tests with setup and names
  10. 24:01Extracting common logic
  11. 26:55Using constants and builders
  12. 29:45Separating domain and platform
  13. 32:38Important versus replaceable values
  14. 34:32Refactoring without changing tests
  15. 36:19Reviewing tests like production code
  16. 37:26Q&A: parameterized tests and levels
  17. 40:35Static analysis and human review
  18. 45:16Closing remarks
~/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.