set of method-level metrics including McCabe’s cyclomatic complexity [14], and a characteristic vector to approximate the structural information in ASTs [6].
Our approach is classified as a structure-based comparison. It features a sequence of statements as a retrieval condition. We have developed a lexical parser to extract source code structure, including control statements and method identifiers. The extracted structural information is input to a vector space model [1,12,17], an extended Sorensen-Dice model [4,16,19], and the proposed source code retrieval model, named the “derived sequence retrieval model” (DSRM). The DSRM takes a sequence of statements as a retrieval condition and derives meaningful search conditions from the given sequence. Because a program is composed of a sequence of statements, our retrieval model improves the performance of source code retrieval.
The remainder of this paper is organized as follows. In Section 2, we present an outline of the process and the target source code of our research. In Section 3, we define source code similarity metrics. Retrieval results are discussed in Section 4. In Section 5, we analyze performance in elapsed time, and Section 6 presents conclusions and suggestions for future work.
2. RESEARCH PROCESS
2.1. Outline
Figure 1 shows an outline of our research process. Generally, similarity retrieval of source code is performed for a specific purpose. From this perspective, the original source code may include some uninteresting fragments. We have developed a lexical parser and applied it to a set of original Java source codes to extract interesting code, which includes class method signatures, control statements, and method calls. Our parser traces a variable type declaration and class instantiation to generate an identifier-type list. This list is then used to translate a variable identifier to its data type. A method call preceded by an identifier is converted into the method calls preceded by the data type of the identifier.
Code matching is performed using three retrieval models. The first model is the proposed DSRM, which takes a sequence of statements as a retrieval condition. The second model is based on the collection of statements, and is referred to as the derived collection retrieval model (DCRM). The DCRM is an extension of the Sorensen-Dice model of index [4,16,19]. The final retrieval model is the vector space model (VSM) [1,12,17], which has been developed to retrieve a natural language document. Source code can be perceived as a highly structured document; therefore, comparison with DSRM, DCRM, and VSM provides a baseline performance evaluation of how structure of a document will affect retrieval results.
59
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 ...
热门文档