can be roughly classified into four main groups, i.e., text-based, token-based, structure-based, and metrics-based.
(1) Text-based approaches
In this approach, the target source program is considered as a sequence of strings. Baker [2] described an approach that identifies all pairs of matching “parameterized” code fragments. Johnson [7] proposed an approach to extract repetitions of text and a matching mechanism using fingerprints on a substring of the source code. Although these methods achieve high performance, they are sensitive to lexical aspects, such as the presence or absence of new lines and the ordering of matching lines.
(2) Token-based approaches
In the token-based detection approach, the entire source system is transformed into a sequence of tokens, which is then analyzed to identify duplicate subsequences. A sub-string matching algorithm is generally used to find common subsequences. CCFinder [22] adopts the token-based technique to efficiently detect “copy and paste” code clones. In CCFinder, the similarity metric between two sets of source code files is defined based on the concept of “correspondence.” CP-Miner [11] uses a frequent subsequence mining technique to identify a similar sequence of tokenized statements. Token-based approaches are typically more robust against code changes compared to text-based approaches.
(3) Structure-based approaches
In this approach, a program is parsed into an abstract syntax tree (AST) or program dependency graph (PDG). Because ASTs and PDGs contain structural information about the source code, sophisticated methods can be applied to ASTs and PDGs for the clone detection. CloneDR [3] is one of the pioneering AST-based clone techniques. Wahler et al. [21] applied frequent itemset data mining techniques to ASTs represented in XML to detect clones with minor changes. DECKARD [6] also employs a tree-based approach in which certain characteristic vectors are computed to approximate the structural information within ASTs in Euclidean space.
Typically, a PDG is defined to contain the control flow and data flow information of a program. An isomorphic subgraph matching algorithm is applied to identify similar subgraphs. Komondoor et al. [8] have also proposed a tool for C programs that finds clones. They use PDGs and a program slicing technique to find clones. Krinke [10] uses an iterative approach (k-length patch matching) to determine maximal similar subgraphs. Structure-based approaches are generally robust to code changes, such as reordered, inserted, and deleted code. However, they are not scalable to large programs.
(4) Metrics-based approaches
Metrics-based approaches calculate metrics from code fragments and compare these metric vectors rather than directly comparing source code. Kontogiannis et al. [9] developed an abstract pattern matching tool to measure similarity between two programs using Markov models. Some common metrics in this approach include a set of software metrics called “fingerprinting” [7], a
58
arXiv:cs/0501006v1 [cs.LO] 4 Jan 2005 Formal Languages and Algorithms for Similarity based Retrieval from Sequence Databases ? A. Prasad Sistla ...
Each sequence was analyzed by the information-based similarity index using 4-tuples as “words.” The neighbor-joining phylogenetic tree is shown in Fig....
Database Retrieval Based on Spectral Similarity...Yang, “MACS: Music Audio Characteristic Sequence ...? ? ? ? Type II: Same analog source, ...
CONTENT-BASED COPY RETRIEVAL USING DISTORTION-BASED PROBABILISTIC SIMILARITY ...sequence, the similar local features are searched in the database via the ...
c literature retrieval service has steadily increased. One of the most ...computes a similarity score between papers using link-based similarity measure...
? ? ? ? Type II: Same analog source, ...based music retrieval based on spectral similarity....Yang, “MACS: Music Audio Characteristic Sequence ...
Content Based Image Retrieval using Color and ...Pin code 788011 *n.manimala888@gmail.com,$...FEATURE SIMILARITY MATCHING The Similarity matching ...
Similarity-Based Retrieval on Top of Relational Databases Abstract This paper presents an approach to realize a case retrieval engine on top of a ...
In particular, object-based video隐藏>> VIDEO RETRIEVAL USING DIALOGUE, KEYFRAME SIMILARITY AND VIDEO OBJECTS Paul Browne1 and Alan F. Smeaton1,2 Centre...
Content-based Image Database Retrieval Using Variances of Gray Level Spatial...The features and the similarity measure should be e cient enough to match ...
热门文档