Efficiently representing source code is essential for various software engineering tasks such as code classification and code clone detection. Existing approaches for representing source code primarily use AST, and only a few works focus on semantic graphs such as CFG and PDG, which contain essential information about source code that AST does not have. Even though some works tried to utilize multiple representations, they do not provide any insights about the costs and benefits of using multiple representations against a single appropriate representation for the task. Moreover, they use hand-crafted program features to solve a specific task and have limited use cases. The primary goal of this paper is to discuss the implications of utilizing multiple code representations, specifically AST, CFG, and PDG, and how each of them affects the performance of a task. In this process, we use an approach that can use program features from multiple code graphs while not specifically coupling this approach to a specific task or a language. Our approach stems from the idea of modeling AST as a set of paths and using a learning model to capture program properties. We modify an existing AST path-based approach to accept multiple code representations as input. We do this since it allows us to measure the performance boost provided by additional representations over AST. We evaluate our approach on three tasks: Method Naming, Program Classification, and Code Clone Detection. Our approach increases the performance on these three tasks by 11% (F1), 15.7% (Accuracy), and 9.3% (F1), respectively, over the baseline. We discuss the impact of semantic features from the CFG and PDG paths on performance and the additional overheads incurred through our approach. We envision this work providing researchers with a lens to evaluate combinations of source code representations for various tasks.


翻译:高效表示源代码对于代码分类、代码克隆检测等软件工程任务至关重要。现有源代码表示方法主要采用抽象语法树(AST),仅有少量工作关注控制流图(CFG)和程序依赖图(PDG)等语义图,这些图包含AST所不具备的关键源代码信息。尽管部分研究尝试利用多种表示方法,但并未阐明针对特定任务使用多种表示与单一恰当表示之间的成本效益。此外,这些方法依赖手工设计的程序特征解决特定任务,应用场景有限。本文旨在探讨多代码表示(特别是AST、CFG和PDG)的运用影响,以及每种表示如何影响任务性能。在此过程中,我们提出一种方法,既能从多代码图中提取程序特征,又不将其与特定任务或语言耦合。该方法源自将AST建模为路径集合的思想,通过学习模型捕获程序属性。我们改进了现有的AST路径方法,使其支持多代码表示输入——这一设计可评估额外表示方法相较于AST的性能提升幅度。在方法命名、程序分类和代码克隆检测三项任务上的评估显示,该方法较基线分别提升了11%(F1值)、15.7%(准确率)和9.3%(F1值)。我们探讨了CFG和PDG路径中语义特征对性能的影响,以及该方法引入的额外开销。本研究旨在为研究者提供评估不同源代码表示组合效用的视角。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
专知会员服务
23+阅读 · 2021年2月6日
近期必读的六篇 EMNLP 2020【知识图谱】相关论文和代码
专知会员服务
44+阅读 · 2020年11月10日
【ICLR2020】五篇Open代码的GNN论文
专知会员服务
48+阅读 · 2019年10月2日
最新BERT相关论文清单,BERT-related Papers
专知会员服务
53+阅读 · 2019年9月29日
GNN 新基准!Long Range Graph Benchmark
图与推荐
0+阅读 · 2022年10月18日
谷歌&HuggingFace| 零样本能力最强的语言模型结构
夕小瑶的卖萌屋
0+阅读 · 2022年6月23日
征稿 | International Joint Conference on Knowledge Graphs (IJCKG)
开放知识图谱
2+阅读 · 2022年5月20日
论文小综 | Using External Knowledge on VQA
开放知识图谱
10+阅读 · 2020年10月18日
【ACL】文本摘要研究工作总结
中国人工智能学会
30+阅读 · 2019年8月10日
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
强化学习的Unsupervised Meta-Learning
CreateAMind
18+阅读 · 2019年1月7日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
【论文】图上的表示学习综述
机器学习研究会
15+阅读 · 2017年9月24日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
Arxiv
10+阅读 · 2021年11月3日
VIP会员
最新内容
消耗优势:美军的“精确规模化”概念
专知会员服务
5+阅读 · 今天10:12
《离线语言支持系统:面向空战战术决策》
专知会员服务
5+阅读 · 今天9:53
俄乌战场地面机器人如何改写战争规则
专知会员服务
9+阅读 · 6月14日
《无人水面艇文献综述与结构设计》135页
专知会员服务
13+阅读 · 6月13日
相关资讯
GNN 新基准!Long Range Graph Benchmark
图与推荐
0+阅读 · 2022年10月18日
谷歌&HuggingFace| 零样本能力最强的语言模型结构
夕小瑶的卖萌屋
0+阅读 · 2022年6月23日
征稿 | International Joint Conference on Knowledge Graphs (IJCKG)
开放知识图谱
2+阅读 · 2022年5月20日
论文小综 | Using External Knowledge on VQA
开放知识图谱
10+阅读 · 2020年10月18日
【ACL】文本摘要研究工作总结
中国人工智能学会
30+阅读 · 2019年8月10日
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
强化学习的Unsupervised Meta-Learning
CreateAMind
18+阅读 · 2019年1月7日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
【论文】图上的表示学习综述
机器学习研究会
15+阅读 · 2017年9月24日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员