Software Refactoring is the process of factoring the design module, each modules factored into the components which is more readable and easier to understand. The related components of a program may be dispersed through the code. The program modularization is usually carried out manually by analyzing the software. To re-factorize the program, the components must be identified and function of the components deducted. Software refactoring is the program refining the factored modules, their specifications and abstracted data in to manageable parts.
Refactoring : Improving the Design of Existing Code
As the application of object technology–particularly the Java programming language–has become commonplace, a new problem has emerged to confront the software development community. Significant numbers of poorly designed programs have been created by less-experienced developers, resulting in applications that are inefficient and hard to maintain and extend.
Increasingly, software system professionals are discovering just how difficult it is to work with these inherited. “non-optimal” applications. For several years, expert-level object programmers have employed a growing collection of techniques to improve the structural integrity and performance of such existing software programs. Referred to as “Refactoring”, these practices have remained in the domain of experts because no attempt has been made to transcribe the lore into a form that all developers could use until now.
In Refactoring : Improving the Design of Existing Software renowned object technology mentor Martin Fowler breaks new ground, demystifying these master practices and demonstrating how software practitioners can realize the significant benefits of this new process.
Refactoring Improve the Design of Software
Without refactoring, the design of the program will decay. As people change code – changes to realize short-term goals or changes made without a full comprehension of the design of the code – the code loses its structure. It becomes harder to see the design by reading the code. Refactoring is rather like tidying up the code. Work is done to remove bits that are not really in the right place. Loss of the structure of code has a cumulative effects. The harder it is to see the design in the code, the harder it is to preserve it, and the more rapidly it decays. Regular refactoring helps code retain its shape.
Poorly designed code usually takes more code to do the same thing, often because the code quite literally does the same thing in several places. Thus a important aspect of improving design is to eliminate duplicate code. The importance of this lies in future modifications to the code. Reducing the amount of code won’t make the system run any faster, because the effect on the footprint of the programs rarely is significant. Reducing the amount of code does, however, make a big difference in modification of the code.
The more code there is, the more hard it is to modify correctly. There’s more code to understand. You change this bit of code here, but the system doesn’t do what you expect because you didn’t change that bit over there that does much the same thing in a slightly different context. By eliminating the duplicates, you ensure that the code says everything once and only once, which is the essence of good design.
Refactoring and Performance
A common concern with refactoring is the effect it has on the performance if a program. To make the software easier to understand, you often make changes that will cause the program to run more slowly. This is an important issue. Software has been rejected for being too slow, and faster machines merely move the goalposts. Refactoring certainly will make software go more slowly, but it also makes the software more amenable to performance tuning. The secret to fast software, in all but hard real-time context, is to write tunable software first and then to tune it for sufficient speed.