~/talk

C++ Fundamentals: Unit Testing

Talkat Core C++ 2024 · 2024-11-26..11-28· [c-and-cpp, testing]
slides:none on file

Shows concrete C++ unit testing patterns using Google Test: writing TEST, TEST_F/TEST_P fixtures and parametric cases, and using mock expectations to control dependencies and capture arguments. Demonstrates TDD flow (write failing test, implement minimal code), refactoring toward dependency injection, and measuring coverage — warns that 90% coverage can be meaningless without meaningful assertions. Example units include a filename validator and a custom vector iterator; tests expose real bugs and guide safe refactors and checks across -O0 vs -O2 builds.

AI-written summary · about

  1. 0:00Introduction to unit testing
  2. 1:07Why unit testing matters
  3. 3:41Unit vs integration testing
  4. 6:06Test Driven Development basics
  5. 9:00Reducing fear of code changes
  6. 10:22Dependency injection for tests
  7. 12:51Refactoring for testability
  8. 14:16Benefits of unit tests
  9. 17:31Maintainable and trustworthy tests
  10. 20:23Writing good test cases
  11. 26:52Test case design exercise
  12. 30:02Google Test framework overview
  13. 33:15Assertions in Google Test
  14. 38:18Fixtures in Google Test
  15. 40:25Parameterized tests
  16. 44:20Mocking dependencies
  17. 52:53Best practices summary
  18. 55:25Concluding example and Q&A
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.