-
Book Overview & Buying
-
Table Of Contents
Test-Driven Development with C++
By :
This chapter took us past the simple ability to confirm true and false values. You can now verify anything you need to make sure it matches what you expect.
We simplified the confirm macros by putting the code into overloaded functions with a templated version to handle other types. You saw how to confirm simple data types and work with pointers by dereferencing them first.
The code needed to be refactored, and you saw how TDD helps when you need to make design changes to your code. I could have written the code in this book to make it seem like the code was written perfectly from the very beginning. But that wouldn’t help you because nobody writes perfect code from the beginning. As our understanding grows, we sometimes need to change the code. And TDD gives you the confidence to make those changes as soon as they become known instead of waiting – because problems that you delay have a tendency to get bigger instead of going away.
And you should be gaining...