The strategy of enabling TDD
Now is the time to discuss solutions to the challenges described in the previous section. Since a picture is worth a thousand words, I will present a workflow diagram that should clarify how to introduce unit testing into a brownfield project:
Figure 12.1 – The workflow of enabling TDD in a project
Let’s go through the diagram and our options.
Consider rewriting
You might consider rewriting because the existing project might be based on an old framework with fewer developers and less support. However, the rewriting idea is controversial. If you tell the business that the project requires rewriting, you will be their least favorite individual. Trust me; nobody wants to hear this. However, good rewriting doesn’t need to be a big bang; it can be divided into smaller chunks of upgrades and can be appended to sprints. Obviously, choosing a modern framework that supports DI natively or through a third party...