A novel approach in detecting code clones in Java using DFS
Vishwachi Choudhary, Sonam Gupta · International Journal of ADVANCED AND APPLIED SCIENCES · 2017
Code is the rudimentary element of any software.Code clones may be defined as the segments of the program which are akin to one another.The similarity may be either syntactic or semantic.Cloning is easy to implement but hard to detect.Many researches have been carried out in order to find the methods for detecting these clones of code as problems are encountered at the time of maintenance due to these clones in codes.This further increases the cost of maintenance.The objective of our work is to precisely detect the code clones.Here, an approach is proposed based on the Abstract Syntax Tree method.The purpose for adopting AST is that it gives better detection results as compared to other techniques and is considered to be the best approach for detecting type 3 code clones.Furthermore, AST offers syntactic knowledge which can be leveraged to filter certain types of clones.The results obtained clearly shows that the technique adopted is able to precisely detect the near-miss clones as compared to the tools namely NICAD and CLAN.