The examples I’ve been working with for this series have assumed that you are doing "Green Field” development. This means that we are writing an application from scratch and can make sure all of the things that make code testable are incorporated into our design from the start. The biggest one of these things being the user of dependency injection. But what if you are working on “legacy” code that still uses static dependencies and not dependency injection? Is TDD and unit testing out of reach due to a decision made at the beginning of the project? Not necessarily.
↧