Skip to main content

What is Code refactoring?



Refactoring is "the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure.

If we are making a refactoring, or behavior-preserving code modification:
  • all our unit tests should pass before and after the modification
  • we should not need to modify any tests, or write any new ones
  • we expect cleaner code when we are done
  • we do not expect new behavior

Comments