Enhancing generic code clone detection model through protected access modifier rule and weightage - Siti An Nasihah, Mohd Napi (2016)
Code clone is a common term used to refer codes that have been repeated multiple times in a program. There are four types of code clone which are type I, type II, type III and type IV. Code clone detection models have been used to detect clones apart from code clone detection approaches by applying the protected access modifier rule and weightage. The major challenge faced in detecting code clone using models is the lack of generality in detecting all clone types. This is due to the use of different code clone detection approaches in the models that represents different representation of the source codes; hence it affecting the type of code clones detected. Based on this weakness, it is essential to propose a code clone detection model that can support different type of code. To overcome this weakness, Generic Code Clone Detection model that consists of five processes which are Pre-processing, Transformation, Parameterization, Categorization or called as pooling and Match Detection process has been proposed. A prototype has been developed to detect all code clone types in Java. The proposed method was evaluated in two case studies comprised of three Java applications. The result shows the Generic Code Clone Model prototype was able to detect Type I, Type II, Type III and Type IV clone pairs. The results imply that the Generic Code Clone Model was able to detect all code clone types in Java applications and the generated Generic Code Clone Model have better visualization of the code clone detection results.