• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

J4 ›› 2011, Vol. 33 ›› Issue (12): 78-83.

• 论文 • 上一篇    下一篇

一种新的检测结构克隆的方法

郭〓婧,吴军华   

  1. (南京工业大学电子与信息工程学院,江苏 南京211816)
  • 收稿日期:2011-05-16 修回日期:2011-09-27 出版日期:2011-12-24 发布日期:2011-12-25

A New Method of Detecting the Structural Clone

GUO Jing,WU Junhua   

  1. (School of Electronics and Information Engineering,Nanjing University of Technology,Nanjing 211816,China)
  • Received:2011-05-16 Revised:2011-09-27 Online:2011-12-24 Published:2011-12-25

摘要:

结构克隆是一种运用相似原理与思想结构的克隆,它不拘泥于语句表达和顺序。本文首先用程序依赖图来检测克隆代码,并在检测过程中运用程序切片技术。针对结构克隆的特征,对需要改进的问题进行总结,对程序依赖图的特征类型进一步泛化和量化来计算相似度。这有利于在数值上更好地评估相似度,并提高克隆检测的查全率。

关键词: 结构克隆, 程序依赖图(PDG), 程序切片, 相似度

Abstract:

The structural clone is a clone with a similar principle and thinking structure, which does not rigidly adhere to the order of statements and expressions. Program dependence graph can better reflect the program's internal relations, and the expression becomes more intuitive to understand. So we first detect the clone code based on the program dependence graph and the process using the  program slicing techniques.Then we summarize  the characteristics of the structural clone, quantify and generalize the characteristics of the program dependence graph to calculate the similarity. It is useful to get a better assessment of similarity and improve the rate of clone.

Key words: structural clone;program dependence graph;program slicing;similarity