Kent Beck came up with a metaphor of the two hats. When I use refactoring to develop software, I divide my time between two distinct activities: adding functionality and refactoring. When I add functionality, I shouldn’t be changing existing code; I’m just adding new capabilities. I measure my progress by adding tests and getting the tests to work. When I refactor, I make a point of not adding functionality; I only restructure the code. I don’t add any tests (unless I find a case I missed earlier); I only change tests when I have to accommodate a change in an interface.
- Chapter 2 Principles in Refactoring
- from Refactoring: Improving the Design of Existing Code
- Publisher: Addison-Wesley Professional
- Released: November 2018
Share this highlighthttp://www.safaribooksonline.com/a/refactoring-improving-the/20660030/