Refactoring is the process of altering an application’s source code without changing its external behavior. The purpose of code refactoring is to improve some of the nonfunctional properties of the code, such as readability, complexity, maintainability and extensibility. Refactoring can extend the life of source code, preventing it from becoming legacy code.