paperbot · PL 论文追踪

全部论文 待读 收藏

P2 CCGraph

CCGraph:基于图核的程序依赖图代码克隆检测
ASE Proceedings of the 35th IEEE/ACM International Conference on Automated Software Engineering2020匹配度 3/10 · 该论文属于基于PDG的传统程序分析与代码克隆检测,与用户核心关注的LLM/Agent、浮点程序分析、贝叶斯程序分析均无直接交集;仅可作为静态分析技术在软件工程中的相邻背景参考。引用 46 inbox
Yue Zou, Bihuan Ban, Yinxing Xue, Yun Xu
crossref: 2026-09-12

AI 速览

一句话:提出 CCGraph,通过归一化 PDG、两级过滤与基于改进 WL 图核的近似图匹配来高效检测代码克隆。

代码克隆检测对软件维护、缺陷检测等具有重要意义,而基于程序依赖图(PDG)的方法虽能同时刻画语法与结构信息,却大多依赖子图同构进行精确图匹配,因而耗时严重且漏检较多。本文提出新的 PDG 克隆检测器 CCGraph:首先对 PDG 结构做归一化,并通过度量代码的特征向量设计两级过滤策略以快速剪除无关候选;随后采用基于改进 Weisfeiler-Lehman(WL)图核的近似图匹配算法完成克隆检测。实验结果表明,CCGraph 在保持较高准确率的同时,召回率与 F1 值均有更优表现,能够检出比其他两个相关最新工具更多的语义克隆,并且效率显著优于现有基于 PDG 的工具。

问题
现有基于 PDG 的代码克隆检测工具多使用子图同构做精确图匹配,导致时间开销大且漏检大量(尤其是语义)克隆。
方法
对 PDG 结构进行归一化,基于代码特征向量构建两级过滤策略,并使用改进 WL 图核的近似图匹配算法检测克隆。
评估
与两个相关的最先进工具进行对比实验,从准确率、召回率、F1 值、语义克隆检出数量以及运行效率等方面评估 CCGraph。
原文摘要(Abstract)

Software clone detection is an active research area, which is very important for software maintenance, bug detection, etc. The two pieces of cloned code reflect some similarities or equivalents in the syntax or structure of the code representations. There are many representations of code like AST, token, PDG, etc. The PDG (Program Dependency Graph) of source code can contain both syntactic and structural information. However, most existing PDG-based tools are quite time-consuming and miss many clones because they detect code clones with exact graph matching by using subgraph isomorphism. In this paper, we propose a novel PDG-based code clone detector, CCGraph, that uses graph kernels. Firstly, we normalize the structure of PDGs and design a two-stage filtering strategy by measuring the characteristic vectors of codes. Then we detect the code clones by using an approximate graph matching algorithm based on the reforming WL (Weisfeiler-Lehman) graph kernel. Experiment results show that CCGraph retains a high accuracy, has both better recall and F1-score values, and detects more semantic clones than other two related state-of-the-art tools. Besides, CCGraph is much more efficient than the existing PDG-based tools.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot5962,
  title = {CCGraph},
  author = {Yue Zou and Bihuan Ban and Yinxing Xue and Yun Xu},
  booktitle = {ASE},
  year = {2020},
  doi = {10.1145/3324884.3416541}
}