Home // International Journal On Advances in Software, volume 10, numbers 3 and 4, 2017 // View article
Effects of an Apriori-based Data-mining Algorithm for Detecting Type 3 Clones
Authors:
Yoshihisa Udagawa
Keywords: Code clone; Apriori-based algorithm; Maximal frequent sequence; Longest common subsequence(LCS) algorithm; Java source code.
Abstract:
A code clone is a fragment of source code that appears at least twice in software source code. Code clones introduce difficulties in software maintenance because an error in one fragment is reproduced in code clones. It is significant to detect every code clones for making software maintenance easy and reliable. This paper describes software clone detection techniques using an Apriori-based sequential data mining algorithm. The Apriori-based algorithm is used because it is designed to find all frequent items that occur no less than a user-specified threshold named the minimum support (minSup). Since clones are slightly modified by adding, removing, or changing source code in general, the algorithm for detecting code clones has to deal with both match and mismatch portions of source code. The essential idea of the proposed approach is a combination of a partial string match using the longest-common-subsequence (LCS) and an Apriori-based algorithm for finding frequent sequences. Generally, Apriori-based algorithms extract vast numbers of frequent sequences especially when the minSup is small, creating an obstacle to the detection of code clones. The novelties of our approach include pruning processes that depend on characteristics of a programming language, techniques to reduce the number of frequent sequences, and functions to control repetitive subsequences. We evaluate the effectiveness of the proposed algorithm based on experimental results using the source code of the Java SDK SWING graphics package. The results show that the proposed sequential data mining algorithm maintains the performance at a practical level until the minSup reaches two. This paper also shows some mined sequences and source code to demonstrate that the proposed algorithm works from short sequences to long ones.
Pages: 477 to 489
Copyright: Copyright (c) to authors, 2017. Used with permission.
Publication date: December 31, 2017
Published in: journal
ISSN: 1942-2628