面向函数的代码克隆检测
DOI:
作者:
作者单位:

北京信息科技大学

作者简介:

通讯作者:

中图分类号:

TP311.5

基金项目:

北京市自然科学基金(重点研究专题项目)(No.Z160002);网络文化与数字传播北京市重点实验室开放课题(No.ICDD2017XX)


Function-oriented Code Clone Detection
Author:
Affiliation:

1.Beijing Information Science &2.Technology University

Fund Project:

Beijing natural science foundation (key research project) (No.Z160002);Open project of Beijing key laboratory of network culture and digital communication (No.ICDD2017XX)

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    在软件开发过程中绝大多数克隆代码集中在函数内部,为了更加快速有效的检测出克隆代码,提出了一种基于函数内部特征矩阵的代码克隆检测算法。该算法通过提取函数内部特征,从而达到将具体代码的比较转化为对特征矩阵进行相似度计算。实验结果表明,该算法可以检测出所有克隆函数,并与基于字符串代码克隆检测算法和基于串匹配的程序代码相似性识别方法相比,该算法在运行时间及精度上均优于基于字符串代码克隆检测算法和基于串匹配的程序代码相似性识别方法。其次,通过使用n-grams算法对函数名进行相似度检测,使得该算法在运行效率上得到了显著提升。

    Abstract:

    In the process of software development, most of the clone code is concentrated inside the function. In order to detect the clone code more quickly and effectively, a code clone detection algorithm based on the internal characteristic?matrix of the function is proposed. By extracting the internal characteristic?of the function, the algorithm converts the comparison of the specific code into the similarity calculation of the characteristic?matrix. The experimental results show that the algorithm can detect all clone functions, and compared with the string-based code clone detection algorithm and the string matching based program code similarity recognition method , the algorithm is superior to the string-based code clone detection algorithm and the string matching based program code similarity recognition method in terms of time and precision. In addition, by using the n-grams algorithm to perform similarity detection on the function name, the algorithm has been significantly improved in operational efficiency.

    参考文献
    相似文献
    引证文献
引用本文

武泽权,牟永敏,张志华. 面向函数的代码克隆检测[J]. 科学技术与工程, 2019, 19(35): 259-264.
wuzequan, and. Function-oriented Code Clone Detection[J]. Science Technology and Engineering,2019,19(35):259-264.

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2019-05-22
  • 最后修改日期:2019-08-31
  • 录用日期:2019-07-28
  • 在线发布日期: 2020-01-02
  • 出版日期:
×
律回春渐,新元肇启|《科学技术与工程》编辑部恭祝新岁!
亟待确认版面费归属稿件,敬请作者关注