基于结构特征聚类的相似代码检索方法  被引量:1

Similar Code Retrieval Based on the Clustering of Structural Features

在线阅读下载全文

作  者:王克朝[1,2] 王甜甜[2] 王知非[1] 任向民[1] 林海成 

机构地区:[1]哈尔滨学院软件学院,哈尔滨150086 [2]哈尔滨工业大学计算机科学与技术学院,哈尔滨150001

出  处:《科学技术与工程》2015年第11期221-225,共5页Science Technology and Engineering

基  金:哈尔滨学院青年基金(HUYF2014-007);黑龙江省普通高校青年学术骨干项目(1254G037);黑龙江省教育规划青年专项课题(GJD1214038);国家自然科学基金资助项目(61202092);高等学校博士学科点专项科研基金资助项目(20112302120052);哈尔滨科技创新人才研究专项资金项目(RC2013QN010001和2014RFQXJ062);黑龙江省自然科学基金(F201127)资助

摘  要:针对基于图的相似代码检测方法复杂度高、对代码多样化识别能力有限等问题,提出基于结构特征聚类的方法。首先将代码表示为控制依赖树,在此基础上执行代码标准化,消除代码表达方式的多样化,以便识别语法表示不同,而语义相似的代码;然后采用特征向量描述程序的结构信息,将复杂的图的相似度求解问题转换为简单的相似向量的聚类问题,快速提取可能相似的候选代码。实验结果表明,方法与Gabel等人提出的方法相比,可以识别更多的代码多样化。The traditional graph based similar code detection approaches usually have high complexity, and are limited in recognizing code variations. In this paper, we propose a similar code retrieval approach based on the clustering of structural features. Source codes are represented as control dependence trees, and code normalization is performed to eliminate code variations so as to recognize the syntactically different but semantically similar codes. Then, vectors are computed to describe the structural information of source code, and the difficult graph similarity problem is reduced to a simpler vector clustering problem. Candidate similar codes are quickly extracted. Test results show that our method can recognize more code variations than that of the method proposed by Gabel et al.

关 键 词:相似代码 语义分析 向量聚类 

分 类 号:TP311.12[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象