|
A common coding practice: cut and paste  One of the most commonly used coding practices is copy and paste. A portion of code that resembles what is needed is found in existing code. The developer doesn't want to create a subprogram and modify code that already in use, risking a possible introduction of errors. So the interesting section of code is copied and pasted where it is to be reused and lines are modified, added or removed to suit the specific needs of this reuse. The functionality that was required is developed with little effort. The other side of the coin If the duplicated code contained a defect, that defect was also copied. Some time later when the defect is reported it will be corrected in the first portion of code. Later again the same sort of bug will appear and time will need to be spent once again to find the location of the new defect, only to realize that it is in the portion of code that was duplicated. The duplication of the code was of course forgotten, and this can happen as many times as the code was copied. How to be more efficient? With the similar code search functionality of the IBM Logiscope CodeReducer tool, when you correct a defect in an application you can very easily localize all portions of code that resemble the corrected code and correct the defect once and for all in all its duplications. How to proceed? Using IBM Logiscope CodeReducer is very straightforward: you simply select the modified code and ask for all portions of code that resemble it in the rest of the application. The results are displayed with easy access to the source code allowing to check if the similar code portions contain the defect and correct them if necessary. To find out more please send an email to Kalimetrix or fill in the information request form.
|