ExampleA bank system has been operational for 10 years and has been updated by hundreds of developers over that time period. The code is duplicative with several variations in structural design for similar products. Some of its classes have a large number of instance variables and methods. Methods are often long and exhibit an adhoc structure that is difficult to understand. In recent years, it has become more common for changes to have unintended side effects that have caused regression tests to fail and production issues to occur. The lead developer approaches management and proposes a code refactoring as a way to reduce risk and improve the turnaround time for change requests. She restructures the code to reduce duplication and to make classes and methods a reasonable size. She also structures the code with the aim of making it easier to add and update products as this is the most common type of change to the system. A simple product can now be added to the system with a few lines of code.
|Overview: Code Refactoring|
The process of improving the design of code without changing its functionality.