Software Code Clone Detection Using AST

Abstract

The research which exists suggests that a considerable portion (10-15%) of the source code of large-scale computer programs is duplicate code. Detection and removal of such clones promises decreased software maintenance costs of possibly the same magnitude. Previous work was limited to detection of either near misses differing only in single lexemes, or near misses only between complete functions. This paper presents simple and practical methods for detecting exact and near miss clones over arbitrary program fragments in program source code by using abstract syntax trees. Previous work also did not suggest practical means for removing detected clones. Since our methods operate in terms of the program structure, clones could be removed by mechanical methods producing in-lined procedures or standard preprocessor macros.A tool using these techniques is applied to a C production software system of some 500K source lines, and the results confirm detected levels of duplication found by previous work. The tool produces macro bodies needed for clone removal, and macro invocations to replace the clones. The tool uses a variation of the well-known compiler method for detecting common sub-expressions. This method determines exact tree matches; a number of adjustments are needed to detect equivalent statement sequences, commutative operands, and nearly exact matches. We additionally suggest that clone detection could also be useful in producing more structured code, and in reverse engineering to discover domain concepts and their implementations.

Authors and Affiliations

G. Anil kumar , Dr. C. R. K. Reddy , Dr. A. Govardhan

Keywords

Related Articles

A Survey Paper of Bellman-Ford Algorithm and Dijkstra Algorithm for Finding Shortest Path in GIS Application

GIS application is very useful in transportation management. A Road network analysis is an important function of GIS, and the shortest path analysis is the key issue of network analyses. In Most of GIS application, Dijks...

Offensive Decoy Technology For Cloud Data Attacks

Cloud Computing enables multiple users to, share common computing resources, and to access and store their personal and business information. These new paradigms have thrown new data security challenges. The majority of...

‘On Demand Service Management’ For Next Generation Mobile Networks [LTE] Using Agents

The novelty of our work is the development of an optimal service provisioning and customer experience management framework, adding value to the mobile user community and also to the business development of network servic...

 Extracting Multiwords From Large Document Collection Based N-Gram

 Multiword terms (MWTs) are relevant strings of words in text collections. Once they are automatically extracted, they may be used by an Information Retrieval system, suggesting its users possible conceptual interes...

Future Research Challenges of Peer-to-Peer Systems

PCs have become much more powerful, and they are able to handle the data processing locally rather than on central servers. Because of this, peer-to-peer computing can now occur when individual computers bypass central s...

Download PDF file
  • EP ID EP99849
  • DOI -
  • Views 114
  • Downloads 0

How To Cite

G. Anil kumar, Dr. C. R. K. Reddy, Dr. A. Govardhan (2014). Software Code Clone Detection Using AST. International Journal of P2P Network Trends and Technology(IJPTT), 9(1), 33-39. https://europub.co.uk/articles/-A-99849