• Home
  • Search
  • Clone detection using abstract syntax trees
  • Cite Icon1345
  • https://doi.org/10.1109/icsm.1998.738528Copy DOI Icon

Clone detection using abstract syntax trees

  • Mar 16, 1998
  • I.d Baxter +4 more
Show More
  • Abstract
  • Literature Map
  • References
  • Citations
  • Similar Papers
Abstract

Existing research suggests that a considerable fraction (5-10%) of the source code of large scale computer programs is duplicate code (clones). 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 lexems, or near misses only between complete functions. The 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 400 K 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.

Similar Papers
  • Book Chapter
  • Citations1

Comprehending Code Fragment in Code Clones: A Literature-Based Perspective

  • Nov 22, 2019
  • Sarveshwar Bharti +1
  • Conference Article
  • Citations1

ASPDup: AST-Sequence-based Progressive Duplicate Code Detection Tool for Onsite Programming Code

  • Nov 01, 2020
  • Yaoshen Yu +4
  • Research Article
  • Citations12

A comparative study on the intensity and harmfulness of late propagation in near-miss code clones

  • Jan 22, 2016
  • Software Quality Journal
  • Manishankar Mondal +2
  • Research Article
  • Citations4

On the impact of multiple source code representations on software engineering tasks — An empirical study

  • Dec 27, 2023
  • Journal of Systems and Software
  • Karthik Chandra Swarna +3
  • Conference Article
  • Citations2

How Compact Will My System Be? A Fully-Automated Way to Calculate LoC Reduced by Clone Refactoring

  • Dec 01, 2019
  • Tasuku Nakagawa +3
  • Conference Article
  • Citations638

Deep learning code fragments for code clone detection

  • Aug 25, 2016
  • Martin White +3
  • Conference Article
  • Citations1

Research on the Model of Legacy Software Reuse Based on Code Clone Detection

  • Sep 01, 2013
  • Meng Fanqi +1
  • Conference Article
  • Citations1

A Fast Detecting Method for Clone Functions Using Global Alignment of Token Sequences

  • Feb 15, 2020
  • Da-Young Lee +5
  • Research Article
  • Citations40

Program Characterization Using Runtime Values and Its Application to Software Plagiarism Detection

  • Sep 01, 2015
  • IEEE Transactions on Software Engineering
  • Yoon-Chan Jhi +5
  • Book Chapter
  • Citations1

Are Textual Prompts in Large Language Models Sufficient for Vulnerability Detection?

  • Jun 27, 2025
  • Puya Pakshad +1
  • Research Article

A Large-Scale Empirical Evaluation of LLMs for Automated Self-Admitted Technical Debt Repayment

  • Feb 10, 2026
  • ACM Transactions on Software Engineering and Methodology
  • Mohammad Sadegh Sheikhaei +3
  • Research Article

Hybrid Attention Approach for Source Code Comment Generation

  • Jul 14, 2025
  • Information Technology and Control
  • Yao Meng
  • Conference Article
  • Citations166

Deep learning similarities from different representations of source code

  • May 28, 2018
  • Michele Tufano +5
  • Research Article
  • Citations6

A method to remove variations in source codes

  • Jan 01, 1996
  • Information and Software Technology
  • Norihide Hattori +1
  • Conference Article
  • Citations3

Supporting clone analysis with tag cloud visualization

  • Nov 16, 2014
  • Manamu Sano +4
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.