This document discusses techniques for refactoring legacy code without tests. It recommends starting by performing safe refactors to reflect evolving knowledge of the system and put it in a testable state. Characterization tests are used to describe the existing behavior of units of code as a baseline. Dependencies need to be identified and isolated through extraction methods or interfaces to allow injection of fakes for testing. The overall goals are to fight hidden and global dependencies and leave the codebase in a better state than when refactoring began.
Related topics: