~/talk

Will Your C++ Program Still Be Correct Next Year?

Talkat C++ on Sea 2025 · 2025-06-23..06-25· [testing, c-and-cpp]
slides:none on file

A practical testing philosophy that treats tests as executable requirements, not just examples: a word-histogram example reveals real bugs, fixes, and design choices — moving from std::map to unordered_map breaks order-sensitive assertions so tests change to unordered-range checks; splitting implementation into a freestanding per-word function makes private logic testable; using doctest, Catch2, Google Test shows matchers, custom printers and death tests for preconditions; mocks are useful but overused; clear, focused tests catch regressions and guide better APIs.

AI-written summary · about

  1. 0:00Introduction
  2. 3:16Test types purpose
  3. 10:16Tests document expectations
  4. 11:41Testing histogram with doctest
  5. 15:24Adding size and empty to histogram
  6. 17:11Given-when-then in tests
  7. 19:22Range equality with Catch2
  8. 23:03Performance with unordered_map
  9. 25:53Avoiding over-constrained tests
  10. 26:14Testing private functionality
  11. 31:24Testing helper functions
  12. 33:12Custom split versus ranges
  13. 34:30Preconditions without contracts
  14. 37:40Mocks for preconditions
  15. 41:31Violation handler parameters
  16. 44:02Rethinking remove and insert
  17. 46:36Good test characteristics
  18. 48:29Testing dogmas warning
  19. 50:18Never flaky tests
  20. 51:27Long-term correctness
  21. 52:14Old code lessons
  22. 52:37Recommended testing talks
~/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.