(From the bookWorkingEffectively with Legacy Code)
When you have to make a change in a legacy code base, here is an algorithm you can use.
1. Identify change points.2. Find test points.3. Break dependencies.4. Write tests.5. Make changes and refactor.