Semantic Code Clone Detection Using Parse Trees and Grammar Recovery
Rajkumar Tekchandani, Maninder Singh, R. Bhatia · 2013
Code cloning is the common requirement for most of the software applications. Code clones are the similar code fragments that exist at different locations in a software system. This type of reuse approach of existing code is called code cloning and the pasted code fragment is called as clone of the original. Code duplication exists in one of the two categories: Syntactic or semantic. Existing techniques of semantic code clone detection deals with program dependence graphs. In this paper, we proposed an algorithm that finds the semantic code clones on the basis of parse trees and formal grammars. This paper finds the similar code fragments those are structurally divergent but semantically equivalent on the basis of parse trees and grammar recovery. It also provides the design and implementation of proposed approach followed by results.