一句话:提出语法-语义融合嵌入的联合代码表示,并定义调用关系粒度,用监督深度学习检测功能性代码克隆。
代码克隆检测是软件工程的基础技术,但现有方法难以有效提取源代码的语法与语义信息,因而在检测“功能性”代码克隆时效果不佳。本文提出一种联合代码表示,利用融合嵌入技术学习源代码中隐藏的语法与语义特征;同时引入新的功能粒度:将具有调用者-被调用者关系的连通方法视为一个功能,无此类关系的方法表示单一功能。在此基础上,训练监督深度学习模型进行功能性代码克隆检测。作者在大型 C++ 程序数据集上评估,实验结果表明融合学习在检测功能性代码克隆方面显著优于现有最佳技术。
Clone detection of source code is among the most fundamental software engineering techniques. Despite intensive research in the past decade, existing techniques are still unsatisfactory in detecting "functional" code clones. In particular, existing techniques cannot efficiently extract syntax and semantics information from source code. In this paper, we propose a novel joint code representation that applies fusion embedding techniques to learn hidden syntactic and semantic features of source codes. Besides, we introduce a new granularity for functional code clone detection. Our approach regards the connected methods with caller-callee relationships as a functionality and the method without any caller-callee relationship with other methods represents a single functionality. Then we train a supervised deep learning model to detect functional code clones. We conduct evaluations on a large dataset of C++ programs and the experimental results show that fusion learning can significantly outperform the state-of-the-art techniques in detecting functional code clones.
DOI 原文 ·
@inproceedings{paperbot6030,
title = {Functional code clone detection with syntax and semantics fusion learning},
author = {Chunrong Fang and Zixi Liu and Yangyang Shi and Jeff Huang and Qingkai Shi},
booktitle = {ISSTA},
year = {2020},
doi = {10.1145/3395363.3397362}
}