Surgical Refactoring

This is a skill that takes practice. The following video is an excellent introduction into why this is important and how to do this

The essence of this idea is to make sure that your refactoring is small and contained and doesn’t make changes that blast through the code

Example

You are working on a job to modify an endpoint and discover that there are 20 endpoints pull of cut and paste code abuse with methods that are a hundred lines long each. It is clearly impossible to unit test the business logic in these methods.