arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2203.11790cs.SEcs.LGcs.PL
收藏

基于代码表示的程序语义学习的实证研究

Learning Program Semantics with Code Representations: An Empirical Study

Nanyang Technological University(南洋理工大学);Singapore Management University(新加坡管理大学);Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);Zhejiang Sci-Tech University(浙江理工大学)

Jing Kai Siow, Shangqing Liu, Xiaofei Xie, Guozhu Meng, Yang Liu

摘要:

程序语义学习是各种代码智能任务的核心和基础,漏洞检测,克隆检测大量的现有作品提出了不同的方法来学习不同任务的程序语义,这些作品已经取得了最先进的性能。然而,目前,一个全面和系统的研究,评估不同的程序表示技术在不同的任务仍然缺乏。从这个出发点,在本文中,我们进行了实证研究,以评估不同的程序表示技术。具体来说,我们将当前主流的代码表示技术分为四类,即,基于结构、基于序列、基于树和基于图的程序表示技术,并评估其在三种不同和流行的代码智能任务上的性能,即,{Code Classification}、Vulnerability Detection和Clone Detection。我们进一步设计了三个{研究问题(RQ)},并进行了全面的分析,以调查的性能。通过大量的实验结果,我们得出结论:(1)在这些任务中,基于图的表示优于其他选定的技术。(2)与基于树和基于图的表示中使用的节点类型信息相比,节点文本信息对于学习程序语义更重要。(3)不同的任务需要特定于任务的语义来实现其最高性能,然而,从不同的维度(如控制依赖,数据依赖)组合各种程序语义仍然可以产生有希望的结果。

英文摘要:

Program semantics learning is the core and fundamental for various code intelligent tasks e.g., vulnerability detection, clone detection. A considerable amount of existing works propose diverse approaches to learn the program semantics for different tasks and these works have achieved state-of-the-art performance. However, currently, a comprehensive and systematic study on evaluating different program representation techniques across diverse tasks is still missed. From this starting point, in this paper, we conduct an empirical study to evaluate different program representation techniques. Specifically, we categorize current mainstream code representation techniques into four categories i.e., Feature-based, Sequence-based, Tree-based, and Graph-based program representation technique and evaluate its performance on three diverse and popular code intelligent tasks i.e., {Code Classification}, Vulnerability Detection, and Clone Detection on the public released benchmark. We further design three {research questions (RQs)} and conduct a comprehensive analysis to investigate the performance. By the extensive experimental results, we conclude that (1) The graph-based representation is superior to the other selected techniques across these tasks. (2) Compared with the node type information used in tree-based and graph-based representations, the node textual information is more critical to learning the program semantics. (3) Different tasks require the task-specific semantics to achieve their highest performance, however combining various program semantics from different dimensions such as control dependency, data dependency can still produce promising results.

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

↑