~/talk

How to design a test suite you’ll love to maintain

Talkat GopherCon Singapore 2023 · 2023-11-02..11-03· [testing, developer-experience]
links:none on file
slides:none on file

Refactors show concrete rules: move tests into a test package so only public API is exercised; replace magic values (66% becomes an explicit Swedish tax rate) and remove optional fields so tests don’t hide unused inputs; eliminate if-statements in test bodies by supplying expectation helpers and defaults; push price and tax calculations into line-item and tax-rate objects so calculator only coordinates collaborators; use option/builder patterns for concise setup and use mocks to verify calls instead of duplicating return-value assertions.

AI-written summary · about

  1. 0:00Introduction to test suites
  2. 1:44Reviewing test cases
  3. 4:13Identifying test problems
  4. 6:00Moving to test package
  5. 8:28Refactoring assertions
  6. 10:12Removing if statements
  7. 11:35Highlighting test differences
  8. 13:03Reducing boilerplate
  9. 14:46Builder vs options pattern
  10. 16:52Refactoring calculator logic
  11. 18:20Separating concerns
  12. 19:44Testing price calculation
  13. 20:45Improving tax rate handling
  14. 21:49Updating test cases
  15. 22:30Removing redundant tests
  16. 23:12Key refactoring constraints
  17. 24:56Encouraging intentional design
  18. 26:18Summary and Q&A
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.