- 博客(0)
- 资源 (2)
- 收藏
- 关注
Using Slicing to Identify Duplication in Source Code.pdf
一个论文,关于代码重构的--使用切片识别源代码中的重复部分。
采用了PDG(程序依赖图)和一个叫Codesurfer的软件。
可以识别交织的重复代码,生成新的函数。
本文具有很好的启发价值。
Programs often have a lot of duplicated code, which makes
both understanding and maintenance more dicult. 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 nds 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 nd isomorphic PDG
subgraphs that represent clones. The key benets of this approach are
that our tool can nd non-contiguous clones (clones whose components
do not occur as contiguous text in the program), clones in which match-
ing statements have been reordered, and clones that are intertwined with
each other. Furthermore, the clones that are found are likely to be mean-
ingful computations, and thus good candidates for extraction.
2009-03-03
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人