Back to Basics: Unit Tests
summary
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
chapters (8)
- 0:00Introduction to unit testing
- 3:00Why start with unit tests
- 16:06Writing first scanner test
- 23:37Falsifying and verifying tests
- 36:28Adding a testing framework
- 49:05Advanced test features
- 57:36Good test properties
- 1:01:10Q&A and closing
related talks
01h 02mBack to Basics: C++ Testing
01h 01mBack to Basics: Test-driven Development
01h 03mBack to Basics: Testing in C++
01h 01mBack to Basics: Unit Testing in C++
59mC++ Unit testing - the good, the bad & the ugly
05m650 line C++ unit test library (easy to use)
53mC++ Unit testing - the good, the bad & the ugly
01h 01mBack to Basics: Debugging and Testing in C++ Software Development
