Test Driven Development - The C++ Variations

michaelfeathers

Developer Community Track
Laptop required
Session type: 
tutorial
Intended audience and experience level: 

Experienced C++ developers who want to apply TDD in their organizations.

Prerequisites: 

Attendees should bring laptops with GCC 4.x (or higher) or Microsoft Visual C++ 6.0 (or higher) installed. A testing framework will be provided.

It isn’t hard to find information about TDD these days. There are several books on the subject, and plenty of web resources; however, almost all of them are written with the assumption that you’ll be using Java, C#, or a dynamically typed language in your work. Hardly any of them are written with C++ in mind.

TDD in C++ presents special challenges. The language is large and it presents many options. Developers must select among a variety of language constructs, all of which have different trade offs with respect to testability, design evolution, and dependency management. C++ also has failure modes that are significantly different than other languages.

In this tutorial, you will learn how to do TDD in C++. You’ll learn how to drive the creation of templates, interfaces, and plain old C++ objects (POCOs). You’ll also learn how to establish a TDD compatible C++ style appropriate for your team.

000 - 030 Introduction (The TDD Cycle) Demo 030 - 090 Simple Exercise (single object TDD) Review (how does TDD feel?, what are your concerns?) Survey of C++ Programming Styles + TDD challenges break

090 - 120 Biasing toward interfaces + templates, dependency management Test stubbing patterns 120 - 180 Multi-object TDD exercise Discussion: What does TDD do to notions of good design in C++?

michaelfeathers

Michael Feathers has been involved in the XP/Agile community since is inception. While designing biomedical instrumentation software in the late 1990s, he met several of the members of the Chrysler C3 team at a conference and was persuaded by them to try XP practices. Subsequently, he joined Object Mentor where he has spent most of his time transitioning teams to XP. Michael is also the author of ‘Working Effectively with Legacy Code.