Chapter 7
Dealing with Legacy Code
It’s rare during your development career to have the luxury of being able to start with a clean slate every time you begin a new project. More often than not you’re going to have to extend code written by someone else. Other times you’re simply joining the team to help out with the increased workload. Inevitably, the temptation is just not to do any unit testing. After all, it’s a massive task to create unit tests for the existing code, so why bother. But there are ways to approach this “no existing unit tests” scenario so that your code doesn’t fall apart when the application gets to Quality Assurance (QA). “It’s not my code” never was a very good excuse.
The process we take to introduce tests is as follows: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access