文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > 计算机软件及应用 > SOURCE CODE RETRIEVAL USING SEQUENCE BASED SIMILARITY
侵权投诉

SOURCE CODE RETRIEVAL USING SEQUENCE BASED SIMILARITY

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

第1页

你可能喜欢

热门文档

相关文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email