~/talk

The Science of Unit Tests

Talkat CppCon 2020 · 2020-09-14..09-18· [testing, software-architecture]
links:none on file
slides:none on file

Argues unit tests function as small scientific instruments: write tests to falsify “code is correct” hypotheses, not to prove implementations; demonstrates the black-box conundrum with a simple Cup class and shows behavior-driven testing resolves it by exercising observable behaviors rather than internals; recommends concrete tooling: mocks, friend-access white-box hooks only when necessary, test-framework floating‑point comparisons, and mutation testing to calibrate tests; warns about flaky tests, external test servers, and a legacy codebase of half a million lines with only 0.1 unit‑tested.

AI-written summary · about

  1. 0:00Welcome and introduction
  2. 0:51Unit tests and experimental science
  3. 3:59Rule zero existence of tests
  4. 4:40Black box testing conundrum
  5. 7:45White box testing pitfalls
  6. 11:34Behavior driven development
  7. 14:21Bugs and falsifiability
  8. 16:26Empirical science foundations
  9. 20:19Software as physical system
  10. 22:06Test driven development as lab technique
  11. 23:52Calibrating unit tests
  12. 24:32Brittle tests and error propagation
  13. 27:19Precision in test results
  14. 29:05Reproducibility and flaky tests
  15. 33:55Handling non-determinism
  16. 38:46Accuracy in testing
  17. 40:10False positives and negatives
  18. 43:40Undetected bugs and risks
  19. 45:03Science to become correct
  20. 46:29Unit testing as scientific method
  21. 49:01Summary and call to action
  22. 49:43Q&A session
~/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.