~/talk

Clean Test Code

TalkinPolishat 4Developers 2022 Online · 2022-04-04..04-07· [testing]
links:none on file
slides:none on file

Argues that poorly written tests can be worse than no tests and recommends refactoring legacy code before adding tests. Advocates focused, parameterized unit tests with a Given-When-Then structure (one When only), using parameter arrays for multiple cases, and avoiding brittle UI assertions by using data-selectors and harnesses. Shows practical examples: using a Pact mock server for real HTTP calls against a stubbed provider and a command-handler test asserting three side effects (persist, change context, emit event), and warns that aiming for an arbitrary 80% coverage target is a dangerous anti-pattern.

AI-written summary · about

  1. 0:00Introduction
  2. 1:07Test code problems
  3. 8:51Clean test anatomy
  4. 14:30Layer testing
  5. 20:55State and acceptance tests
  6. 23:01Practical test patterns
  7. 31:16Module and abstraction testing
  8. 35:30Summary
~/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.