SOURCE CODE RETRIEVAL USING
SEQUENCE BASED SIMILARITY
Yoshihisa Udagawa
Faculty of Engineering, Tokyo Polytechnic University, Atsugi City, Kanagawa, Japan
udagawa@cs.t-kougei.ac.jp
ABSTRACT
Duplicate code adversely affects the quality of software systems and hence should be detected. We discuss an approach that improves source code retrieval using structural information of source code. A lexical parser is developed to extract control statements and method identifiers from Java programs. We propose a similarity measure that is defined by the ratio of the number of sequential fully matching statements to the number of sequential partially matching statements. The defined similarity measure is an extension of the set-based Sorensen-Dice similarity index. This research primarily contributes to the development of a similarity retrieval algorithm that derives meaningful search conditions from a given sequence, and then performs retrieval using all derived conditions. Experiments show that our retrieval model shows an improvement of up to 90.9% over other retrieval models relative to the number of retrieved methods. KEYWORDS
Java source code, Control statement, Method identifier, Similarity measure, Derived sequence retrieval model
1. INTRODUCTION
Several studies have shown that approximately 5%–20% of a program can contain duplicate code
[2, 13]. Many such duplications are often the result of copy-paste operations, which are simple and can significantly reduce programming time and effort when the same functionality is required.
In many cases, duplicate code causes an adverse effect on the quality of software systems, particularly the maintainability and comprehensibility of source code. For example, duplicate code increases the probability of update anomalies. If a bug is found in a code fragment, all the similar code fragments should be investigated to fix the bug in question [11, 15]. This coding practice also produces code that is difficult to maintain and understand, primarily because it is difficult for maintenance engineers to determine which fragment is the original one and whether the copied fragment is intentional. Tool support that efficiently and effectively retrieves similar code is required to support software engineers' activities.
Different approaches for identifying similar code fragments have been proposed in code clone detection. Based on the level of analysis applied to the source code, clone detection techniques DOI : 10.5121/ijdkp.2013.3404 57
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 ...
热门文档