The Art of Refactoring

Software development is an activity that is performed iteratively. The structure of a system improves with time and becomes more complex. The software developer incorporates after each iteration new insights to the system. Unfortunately, because of this fact, the first solution that is delivered lacks often structure, performance, security and other cross-cutting aspects. Certain functional and non-functional requirements are elaborated during the software development. Therefore, the software developer starts from the initial implementation to extend the solution with each iteration. A web application that has just a single sign on will for instance be extended with a multi-factor authentication, a slow list loading will be improved with a paging approach, unnecessary loops are removed. During the project software developers tend not correct wrong design decision, they rather extend the existing solution in order to achieve the project goal. Such an iterative development is especially characteristic for agile approaches. This kind of development leads to technical dept. However, it is important to focus within each iteration to avoid technical dept and to integrate regular refactoring habits. Each coordinated work that has the goal to optimize the source code can be considered as a small refactoring unit. The goal of refactoring a system is always to improve the understanding, structure or performance of a system while the external behavior stays intact. Thus, refactoring a source code or a whole system, can be seen as a balance act between the amount of changes and preserved legacy logic.

Leave a Reply

Your email address will not be published. Required fields are marked *