Refactoring
Last updated
Was this helpful?
Last updated
Was this helpful?
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
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