Test Driven Development is a key Agile Practice. With TDD, programmers get instant feedback that their code does what they intend. This class shows the motivations behind TDD, but does not stop there. Attendees get first hand experience at TDD, writing well tested code. You will see how tests can prevent many bugs and memory leaks. We’ll use CppUTest, an open source test harness, to collect, organize and automate C++ unit tests.
Students should bring laptops. We will pair program in the class, so solo’s can team up. CDs are provided with test harness and exercise. Laptops need to be able to compile with gcc or Microsoft Visual C++ V6 or later.
Outline
Lecture and Questions
• What is Test Driven Development?
• Why is TDD Important?
• Design for Testability
• TDD Cycle
• Starting Point for Every C++ class
• Testing with Fake Objects
• CppUTest Overview
Demo TDD
TDD Exercise (students are given a series of tests to implement one at a time, these tests give them the feeling for the right size test in TDD.)
TDD Exercise Part 2 (Delete everything and do the exercise writing your own tests and code)
Review and Questions