您的位置:首页  > 论文页面

使用哈希值和标识符冲突率的克隆代码检测的误检消除方法

发表时间:2011-10-31  浏览量:1360  下载量:639
全部作者: 边奕心,王甜甜,苏小红,马培军
作者单位: 哈尔滨工业大学计算机科学与技术学院
摘 要: 针对采用基于token的克隆代码检测方法检测语法相似的克隆代码时存在的部分误检问题,提出一种使用哈希值和标识符冲突率消除克隆代码检测的部分误检方法。该方法首先通过语句的哈希值判断语句结构的相似性,然后计算标识符冲突率,通过冲突率的变化,确定误检的消除方向和消除情况。对于存在误检的克隆代码,最终通过修改克隆代码的相对行号消除误检。实验结果表明:该方法可以消除由于插入结构相同的语句而引起的克隆代码误检问题,并在此基础上,有效消除了语句形式相同但由于语句顺序颠倒而引起的克隆代码误检问题,提高了克隆代码检测及克隆代码相关缺陷检测的准确性,有利于后续克隆代码重构的研究。
关 键 词: 计算机应用;克隆代码;哈希值;标识符冲突率;误检;重构
Title: Method for eliminating false positives of cloned code detection with Hash value and identifier conflict ratio
Author: BIAN Yixin, WANG Tiantian, SU Xiaohong, MA Peijun
Organization: Computer Science and Technology School, Harbin Institute of Technology
Abstract: There are some disadvantages when detecting syntax similar clone code with clone code detection method based on token method. To solve these problems, this paper proposes a method to eliminate part false detection of clone code detection with statement Hash value and identifier conflict ratio. At first, statement Hash value was compared to determine the statement structure similarity. Then the identifier conflict ratio was computed to decide the direction of false detection elimination and results. Finally, the statement relative line number is modified to eliminate false detection. The experimental results show that the method can eliminate clone code false detection caused by inserting the same structure statement and the reverse order statements of same structure. It improves the accuracy of clone code detection and clone code related defects as well as benefits the study of clone code refactoring.
Key words: computer application; clone code; Hash value; identifier conflict ratio; false detection; refactoring
发表期数: 2011年10月第20期
引用格式: 边奕心,王甜甜,苏小红,等. 使用哈希值和标识符冲突率的克隆代码检测的误检消除方法[J]. 中国科技论文在线精品论文,2011,4(20):1877-1881.
 
0 评论数 0
暂无评论
友情链接