TDD Clinic: C++
Test Driven Development is the core of the technical Agile practices. With TDD, programmers get instant feedback that their code does what they intend. This class shows the motivations and mechanics of TDD, but does not stop there. Attendees get first hand experience at TDD, writing well tested code in the challenging world of C++. Attendees see how TDD helps to prevent many bugs and memory leaks from ever making the bug list. CppUTest, an open source test harness, is used to collect, organize and automate C++ unit tests.
Students should bring laptops. Students will pair program in the class, so solo’s can team up. Media is provided with test harness and exercise. Laptops need to be able to compile with gcc or Microsoft Visual C++ V6 or later.
Outline
- Why is TDD Important?
- What is Test Driven Development?
- TDD Cycle
- TDD Demo
- Brief CppUTest Overview
- Starting Point for Every C++ class
- Design for Testability
- TDD Exercise
- Testing with Fake Objects
- Review and Questions
In the TDD Exercise students are given a series of tests to implement one at a time, these tests give them the feeling of pairing with an experienced TDD practitioner. As the exercise proceeds, provided tests wane and the attendees write their own tests.
About two hours of the 180 minute time slot will be in hands-on exercises.
- Understand the motivations behind TDD.
- Experience the TDD Micro-cycle first hand.
- Get the feel of working in small verifiable tests.
- Understand the right way to start a new class in C++.
- Go home with CppUTest installed on your computer ready for real work.

Download session PDF
Add to calendar