International Journal of Advanced and Applied Sciences
Int. j. adv. appl. sci.
EISSN: 2313-3724
Print ISSN: 2313-626X
Volume 4, Issue 5 (May 2017), Pages: 26-29
Title: A novel approach in detecting code clones in Java using DFS
Author(s): Vishwachi Choudhary *, Sonam Gupta
Affiliation(s):
Department of Computer Science and Engineering, Ajay Kumar Garg Engineering College (AKGEC), Ghaziabad, India
https://doi.org/10.21833/ijaas.2017.05.004
Abstract:
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.
© 2017 The Authors. Published by IASE.
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).
Keywords: Clones, Types, Abstract syntax trees, Templates
Article History: Received 9 January 2017, Received in revised form 5 April 2017, Accepted 7 April 2017
Digital Object Identifier:
https://doi.org/10.21833/ijaas.2017.05.004
Citation:
Choudhary V and Gupta S (2017). A novel approach in detecting code clones in Java using DFS. International Journal of Advanced and Applied Sciences, 4(5): 26-29
http://www.science-gate.com/IJAAS/V4I5/Choudhary.html
References:
Baxter ID, Yahin A, Moura L, Sant'Anna M, and Bier L (1998). Clone detection using abstract syntax trees. In the International Conference on Software Maintenance, IEEE, Bethesda, USA: 368-377. https://doi.org/10.1109/icsm.1998.738528 |
||||
Bellon S, Koschke R, Antoniol G, Krinke J, and Merlo E (2007). Comparison and evaluation of clone detection tools. Transactions on Software Engineering, 33(9): 577-591. https://doi.org/10.1109/TSE.2007.70725 |
||||
Kontogiannis KA, DeMori R, Merlo E, Galler M, and Bernstein M (1996). Pattern matching for clone and concept detection. Journal of Automated Software Engineering, 3(1–2): 77-108. https://doi.org/10.1007/BF00126960 |
||||
Koschke R (2007). Survey of research on software clones. In the Dagstuhl Seminar on Duplication, Redundancy, and Similarity in Software, 06301, LZI, Merzig, Germany: 1-24. Available online at: http://drops.dagstuhl.de/opus/volltexte/2007/962/pdf/06301.KoschkeRainer.962.pdf | ||||
Krinke J (2001). Identifying similar code with program dependence graphs. In the 8th Working Conference on Reverse Engineering, IEEE, Stuttgart, Germany: 301-309. https://doi.org/10.1109/WCRE.2001.957835 https://doi.org/10.1109/wcre.2001.957835 |
||||
Levenshtein A (1966). Binary codes capable of correcting deletions insertions and reversals. Soviet Physics Doklady, 10(8): 707-710. | ||||
Rattan D, Bhatia R, and Singh M (2013). Software clone detection: A systematic review. Information and Software Technology, 55(7): 1165-1199. https://doi.org/10.1016/j.infsof.2013.01.008 |
||||
Roy CK, Cordy JR, and Koschke R (2009). Comparison and evaluation of code clone detection techniques and tools: A qualitative approach. Science of Computer Programming, 74(7): 470-495. https://doi.org/10.1016/j.scico.2009.02.007 |