~/talk

Properties of Unit Tests

Talkat Meeting C++ 2022 · 2022-11-17..11-19· [testing]
github:arnemertz
slides:none on file

Clear, practical checklist of what makes unit tests useful: concrete properties (correctness, isolation, readability), design consequences (dependency injection, stronger domain types), and tool/CI realities (gtest/catch2 behaviors, shuffling tests, fast local feedback versus 40m–15h CI runs). Includes numbers and targets—20 second cycles, 1:1 test-to-production ratio, typical test-case length ~10 lines—and shows when to prefer unit, integration, or infra tests and how to structure tests so failures point to the real bug.

AI-written summary · about

  1. 0:00Introduction
  2. 1:07Defining unit tests
  3. 3:52The testing pyramid
  4. 6:24Use cases for unit tests
  5. 11:05Tests as documentation
  6. 14:06General test guidelines
  7. 15:06Ensuring test correctness
  8. 18:09Black box vs gray box
  9. 20:25Code coverage goals
  10. 22:19Strong typing for testing
  11. 24:07Readability and design
  12. 26:18Single responsibility tests
  13. 29:02Test usability check
  14. 30:41Organizing test order
  15. 31:23Discoverability and structure
  16. 33:01Speed and feedback loops
  17. 35:59Decoupling slow code
  18. 39:37Simplicity and yagni
  19. 40:42Independence and selection
  20. 43:54Determinism and threads
  21. 46:49Dependency injection
  22. 49:46Conclusion
  23. 50:29Q&A
  24. 1:02:43Wrap up
~/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.