Omitting Code Clones Based on Ranking the Called Clones

Shahenda S. Sarhan, Zyad Dhafer · International Review on Computers and Software (IRECOS) · 2016

Code clones represent a stumbling blocking the way of having a more readable, maintainable and less complicated source codes, free of bugs and errors. Many studies had been proposed for detecting and omitting the four types of cloned codes based on pattern matching, syntax parsing, tree parsing and refactoring which is the most commonly used technique to remove the code clones from software, while maintaining its original behavior. In this paper, we propose an automated refactoring technique and its correspondence algorithm to omit code clones of type 1 and type 2. The proposed technique performance was tested and evaluated using four open source Java projects JFreeChart, JRuby, JCommon and Apache ant. The performance of the source codes was indicated based on number of metrics as the lines of code, number of blank lines, method’s count and cyclomatic complexity before and after applying the proposed technique. The experimentation results indicated that the proposed technique had showed superiority over the state-of-the-art through omitting the cloned codes with the possibility of maintaining the stability and correctness of behavior of the source codes under consideration.

Read the paper · More papers on PaperTik