arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.18202cs.SE
收藏

TGMM:结合解析树与 GPU 以实现可扩展的多语言、多粒度代码克隆检测

TGMM: Combining Parse Tree with GPU for Scalable Multilingual and Multi-Granularity Code Clone Detection

Yuhang Ye, Yuekun Wang, Yinxing Xue, Yueming Wu, Yang Liu

AI总结:

本文提出基于解析树与 GPU 的 TGMM,支持多语言、多粒度 Type-3 克隆检测,在执行时间和精确率上优于七种现有工具,并验证了其跨语言扩展能力。

摘要:

编程语言和软件系统的快速演进,使得实现多语言且可扩展的克隆检测工具成为必要。然而,同时满足上述要求十分困难,大多数现有工具只关注其中一项挑战。在本工作中,我们提出 TGMM,这是一种基于树和 GPU 的工具,用于多语言、多粒度代码克隆检测。通过基于用户提供的语法文件生成解析树,TGMM 能够提取指定粒度的代码块,并高效检测 Type-3 克隆。为展示 TGMM 的性能,我们在召回率、精确率和执行时间方面将其与七种最先进工具进行比较。TGMM 在执行时间和精确率上排名第一,同时其召回率与其他工具相当。此外,我们分析了 TGMM 跨 30 种主流编程语言的语言可扩展性。其中共有 25 种语言得到支持,其余五种目前缺少必要的语法文件。最后,我们在五种常见粒度上分析了九种流行语言的克隆特征,希望为未来研究人员提供启发。TGMM 的源代码可在 https://github.com/TGMM24/TGMM.git 获取。

英文摘要:

The rapid evolution of programming languages and software systems has necessitated the implementation of multilingual and scalable clone detection tools. However, it is difficult to achieve the above requirements at the same time. Most existing tools only focus on one challenge. In this work, we propose TGMM, a tree and GPU-based tool for multilingual and multi-granularity code clone detection. By generating parse trees based on user-provided grammar files, TGMM can extract code blocks at a specified granularity and detect Type-3 clones efficiently. In order to show the performance of TGMM, we compare it with seven state-of-the-art tools in terms of recall, precision, and execution time. TGMM ranks first in execution time and precision, while its recall is comparable to the others. Moreover, we analyzed the language extensibility of TGMM across 30 mainstream programming languages. Out of these, a total of 25 languages were supported, while the remaining five currently lack the necessary grammar files. Finally, we analyzed the clone characteristics of nine popular languages at five common granularities, hoping to inspire future researchers. The source code of TGMM is available at: https://github.com/TGMM24/TGMM.git.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑