- Extract Class
- Introduce Null Object
- Move Field
- move code into single class files
- delete commented code
- Inline Method
- Extract Method
- move code within file
- Extract Method
- Introduce Explaining Variable
- Replace Magic Number with Symbolic Constant
- Extract Method
- Move Field
- Inline Temp
- Extract Method
- replace class with struct
- Replace Constructor with Factory Method
This took 90 minutes. In the process, a 54-line method became 18 lines. The Move Field operation was one I verified with my tests, running them for hard coded true and false values, and seeing that in each case there was a fail, whereas when I used the moved value all tests passed. The last Extract Method was the place the tests caught a mistake I made:
