Detecting higher-level similarity patterns in programs
Open Access
- 1 September 2005
- journal article
- Published by Association for Computing Machinery (ACM) in ACM SIGSOFT Software Engineering Notes
- Vol. 30 (5) , 156-165
Abstract
Cloning in software systems is known to create problems during software maintenance. Several techniques have been proposed to detect the same or similar code fragments in software, so-calledsimple clones. While the knowledge of simple clones is useful, detecting design-level similarities in software could ease maintenance even further, and also help us identify reuse opportunities. We observed that recurring patterns of simple clones - so-calledstructural clones- often indicate the presence of interesting design-level similarities. An example would be patterns of collaborating classes or components. Finding structural clones that signify potentially useful design information requires efficient techniques to analyze the bulk of simple clone data and making non-trivial inferences based on the abstracted information. In this paper, we describe a practical solution to the problem of detecting some basic, but useful, types of design-level similarities such as groups of highly similar classes or files. First, we detect simple clones by applying conventional token-based techniques. Then we find the patterns of co-occurring clones in different files using the Frequent Itemset Mining (FIM) technique. Finally, we perform file clustering to detect those clusters of highly similar files that are likely to contribute to a design-level similarity pattern. The novelty of our approach is application of data mining techniques to detect design level similarities. Experiments confirmed that our method finds many useful structural clones and scales up to big programs. The paper describes our method for structural clone detection, a prototype tool called Clone Miner that implements the method and experimental results.Keywords
This publication has 23 references indexed in Scilit:
- The Performance of Linear Time Suffix Sorting Algorithms2005
- Beyond templates2005
- Eliminating redundancies with a "composition with adaptation" meta-programming technique2003
- CCFinder: a multilinguistic token-based code clone detection system for large scale source codeIEEE Transactions on Software Engineering, 2002
- Design and implementation of generics for the .NET Common language runtime2001
- Parameterized Duplication in Strings: Algorithms and an Application to Software MaintenanceSIAM Journal on Computing, 1997
- Pattern matching for clone and concept detectionAutomated Software Engineering, 1996
- Investigating reverse engineering technologies for the CAS program understanding projectIBM Systems Journal, 1994
- Suffix Arrays: A New Method for On-Line String SearchesSIAM Journal on Computing, 1993
- Design recovery for maintenance and reuseComputer, 1989