~/talk

How to Improve Tests Thanks to 1 Line of Code?

Talkat PyOhio 2021 · on Saturday, 2021-07-31· [testing]
links:none on file
slides:none on file

Claim: one line — the test name — improves test design by forcing specificity. Advice: avoid vague names like test_age_verification or suffixes fail/error; prefer readable, precise names such as test_returns_true_for_22_years_old_person or explicit conventions like MethodUnderTest_Scenario_ExpectedResult. Don’t use white-noise words like must/should, avoid asserting unobservable implementation details, and keep assertions at a single level of abstraction so outcomes remain observable results.

AI-written summary · about

  1. 0:00Intro
  2. 0:14Example
  3. 0:29Typical starting point
  4. 0:55Wild west
  5. 2:27Use plain English sentences instead
  6. 3:14No white noise
  7. 3:35Name-Driven Testing
  8. 3:46Tests impeding refactoring
~/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.