TDD may not adjust to legacy code straight away. You may have to fiddle a bit with the steps to make it work. Understand that your TDD may change in this case, because somehow, you are no longer performing the TDD you were used to. This chapter will introduce you to the world of legacy code, taking as much as we can from TDD.Â
We'll start afresh, with a legacy application that is currently in production. We'll alter it in small ways without introducing defects or regressions, and we'll even have time to have an early lunch!
The following topics are covered in this chapter:
- Legacy code
- Dealing with legacy code
- REST communication
- Dependency injection
- Tests at different levels: end-to-end, integration, and unit