~/talk

Back to Basics: Unit Tests

Talkat CppCon 2020 · 2020-09-14..09-18· [testing]
name:Ben Saks
links:none on file
slides:none on file

Walks an existing C++ program from zero tests to a small suite that proves the scanner returns a no_more token on empty input, using istringstream for input and dependency injection to avoid std::cin. Tests start as a simple custom main, then move to Google Test (expect_eq, test suites, filtering), show how to falsify a test to ensure it fails, and outline next steps: multi-token tests, Google Mock for isolating the parser, and external code‑coverage tools.

AI-written summary · about

  1. 0:00Introduction to unit testing
  2. 3:00Why start with unit tests
  3. 16:06Writing first scanner test
  4. 23:37Falsifying and verifying tests
  5. 36:28Adding a testing framework
  6. 49:05Advanced test features
  7. 57:36Good test properties
  8. 1:01:10Q&A and closing
~/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.