Code clones are pairs or groups of code segments which are identical or similar to each other. Generally the existence of code clones is considered to make it cumbersome to maintain the source code, so that various kinds of code clone detection tools have been developed. Simple ones divide the source code into a sequence of lines or tokens and find identical or similar sub-sequences. Differences among code clones, called gaps, may prevent clones from being detected or may make clones to be detected with being fragmented. In order to cope with gaps, various tools have been developed by using abstract syntax trees, comparing some metrics, or using program dependency graphs. In this paper we present a novel algorithm for detecting clones by focusing on gaps by function applications. Based on the algorithm we have implemented a tool for detecting code clones on programs written in Standard ML.
['Tsubasa Matsushita', 'Isao Sasano']
Detecting code clones with gaps by function applications