Sciweavers

SAS
2001
Springer

Using Slicing to Identify Duplication in Source Code

14 years 4 months ago
Using Slicing to Identify Duplication in Source Code
Programs often have a lot of duplicated code, which makes both understanding and maintenance more difficult. This problem can be alleviated by detecting duplicated code, extracting it into a separate new procedure, and replacing all the clones (the instances of the duplicated code) by calls to the new procedure. This paper describes the design and initial implementation of a tool that finds clones and displays them to the programmer. The novel aspect of our approach is the use of program dependence graphs (PDGs) and program slicing to find isomorphic PDG subgraphs that represent clones. The key benefits of this approach are that our tool can find non-contiguous clones (clones whose components do not occur as contiguous text in the program), clones in which matching statements have been reordered, and clones that are intertwined with each other. Furthermore, the clones that are found are likely to be meaningful computations, and thus good candidates for extraction.
Raghavan Komondoor, Susan Horwitz
Added 30 Jul 2010
Updated 30 Jul 2010
Type Conference
Year 2001
Where SAS
Authors Raghavan Komondoor, Susan Horwitz
Comments (0)