Setup

You now know how to craft well-designed code using TDD. But the reality for most programmers is that you’re not working on new code most of the time. Instead, you’re slogging through vast amounts of existing code that was not built using TDD—legacy code. And most of that vastness exposes a terrifying wasteland of difficult, poorly designed, hastily constructed code.

How do you begin to deal with this sea of legacy code? Can you still practice TDD in such a codebase, or is TDD applicable only to pristine codebases? In this chapter, you’ll learn some techniques that will help you begin to tackle this serious and ever-present challenge.

You’ll learn a small set of techniques and thoughts around safe refactoring of code when you don’t have ...

Get Modern C++ Programming with Test-Driven Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.