Code is Cheap, Thinking is Expensive
Purposes of Refactoring
Refactoring has several purposes
- change Architecture
- change, improve, maintainability
- change, improve, testability
Changing the Architecture
- Lift the Architecture out of the code using an SCL
- Refactor the Architecture, not the code
Improving Maintainability
- often, maintainability implies a change to the Architecture (see Changing the Architecture)
- otherwise, refactor the code
Improving Testability
- often, testability implies a change to the Architecture (see Changing the Architecture)
- otherwise, refactor the code