Check the test coverage. If not sufficient, add more
Tests should pass before attempting to refactor
Ensure public access points/interfaces are well tested
Depending on the refactoring level, ensure some of the lower level aspects are tested as well
https://refactoring.guru/refactoring/techniquesarrow-up-right
Encapsulate fields
Type checking/ cases => polymorphism
Large method => smaller multiple methods
Large class => smaller classes with limited responsibility
Hard constant value => variable with a constant value. Gives a better name and allows searchability
Last updated 4 years ago