计算机工程与应用 ›› 2018, Vol. 54 ›› Issue (2): 55-61.DOI: 10.3778/j.issn.1002-8331.1608-0344

• 理论与研发 • 上一篇    下一篇

基于路径序列相似度判别的程序克隆检测方法

吕博然,吴军华   

  1. 南京工业大学 计算机科学与技术学院,南京 211800
  • 出版日期:2018-01-15 发布日期:2018-01-31

Clone detection method based on path sequence similarity determination

LV Boran, WU Junhua   

  1. School of Computer Science and Technology, Nanjing University of Technology, Nanjing 211800, China
  • Online:2018-01-15 Published:2018-01-31

摘要: 代码克隆是软件系统中常见现象。将程序代码通过静态分析,转换为由程序结点构成的路径执行序列,通过结点属性的定义,将程序代码相似度检测转化为离散序列距离,折线模型和序列相关度问题,针对上述三种模型计算不同代码执行路径间相似度,最终得出程序间克隆相似度。经过实验和数据分析,验证该方法的可行性。

关键词: 克隆检测, 控制流图, 程序结点, 执行序列, 路径相似

Abstract: Code clone is a common phenomenon in the software system. The program code is converted to path execution sequence constituted by program nodes, through static analysis, by attribute definitions of nodes in this paper, and the calculation for the similarity is solved by discrete sequence similarity detection distance, line model and sequence correlation coefficient, and similarity between different programs. The experiments and data analysis verify the feasibility of this approach.

Key words: clone detection, control flow graph, program node, execution sequence, path similarity