Efficient representation of source code is essential for various software engineering tasks such as code search and code clone detection. One such technique for representing source code involves extracting paths from the AST and using a learning model to capture program properties. Code2vec is a commonly used path-based approach that uses an attention-based neural network to learn code embeddings which can then be used for various software engineering tasks. However, this approach uses only ASTs and does not leverage other graph structures such as Control Flow Graphs (CFG) and Program Dependency Graphs (PDG). Similarly, most recent approaches for representing source code still use AST and do not leverage semantic graph structures. Even though there exists an integrated graph approach (Code Property Graph) for representing source code, it has only been explored in the domain of software security. Moreover, it does not leverage the paths from the individual graphs. In our work, we extend the path-based approach code2vec to include semantic graphs, CFG, and PDG, along with AST, which is still largely unexplored in the domain of software engineering. We evaluate our approach on the task of MethodNaming using a custom C dataset of 730K methods collected from 16 C projects from GitHub. In comparison to code2vec, our approach improves the F1 Score by 11% on the full dataset and up to 100% with individual projects. We show that semantic features from the CFG and PDG paths are indeed helpful. We envision that looking at a mocktail of source code representations for various software engineering tasks can lay the foundation for a new line of research and a re-haul of existing research.


翻译:源代码的有效表达方式对于诸如代码搜索和代码克隆检测等各种软件工程任务至关重要。 代表源代码的一种技术就是从 AST 中提取路径, 并且使用学习模型来捕捉程序属性。 代码2vec 是一种常用的基于路径的方法, 使用基于关注的神经网络来学习代码嵌入, 然后可用于各种软件工程任务。 但是, 这种方法只使用 AST, 并且没有利用控制流程图( CFG) 和 程序依赖性图( PDG) 等其他图形结构。 同样, 代表源代码的最新方法中大多数仍然使用 AST, 并且不使用语义图结构结构结构结构结构结构结构。 尽管存在一种代表源代码的综合图形方法( Code 属性图), 但它只是在软件安全领域探索。 此外, 它不能利用各个图表的路径。 在我们的工作中, 我们扩展基于路径的方法代码方法的代码, 包括语义图、 CFG1 和 PDG, 以及 AST 的源, 这在软件工程的域域中基本上还没有被解析定的线条线。 我们从 CSD2 的 SealG 数据模型中, 正在用一个数据模型项目里用一个新的数据格式化的方法, 。 我们用一个从 Cmamad 的方法, 向一个从 Crodrodrodrodrodrodrod 向一个新的路径向一个新的路径向一个新的路径向一个数据模型向一个新的路径, 。

0
下载
关闭预览

相关内容

专知会员服务
88+阅读 · 2021年6月29日
最新《Transformers模型》教程,64页ppt
专知会员服务
286+阅读 · 2020年11月26日
商业数据分析,39页ppt
专知会员服务
158+阅读 · 2020年6月2日
【深度学习视频分析/多模态学习资源大列表】
专知会员服务
91+阅读 · 2019年10月16日
ExBert — 可视化分析Transformer学到的表示
专知会员服务
31+阅读 · 2019年10月16日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
144+阅读 · 2019年10月12日
强化学习最新教程,17页pdf
专知会员服务
169+阅读 · 2019年10月11日
[综述]深度学习下的场景文本检测与识别
专知会员服务
77+阅读 · 2019年10月10日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
99+阅读 · 2019年10月9日
已删除
将门创投
7+阅读 · 2020年3月13日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
Arxiv
13+阅读 · 2020年4月12日
Continual Unsupervised Representation Learning
Arxiv
7+阅读 · 2019年10月31日
Arxiv
10+阅读 · 2018年3月22日
VIP会员
相关VIP内容
专知会员服务
88+阅读 · 2021年6月29日
最新《Transformers模型》教程,64页ppt
专知会员服务
286+阅读 · 2020年11月26日
商业数据分析,39页ppt
专知会员服务
158+阅读 · 2020年6月2日
【深度学习视频分析/多模态学习资源大列表】
专知会员服务
91+阅读 · 2019年10月16日
ExBert — 可视化分析Transformer学到的表示
专知会员服务
31+阅读 · 2019年10月16日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
144+阅读 · 2019年10月12日
强化学习最新教程,17页pdf
专知会员服务
169+阅读 · 2019年10月11日
[综述]深度学习下的场景文本检测与识别
专知会员服务
77+阅读 · 2019年10月10日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
99+阅读 · 2019年10月9日
相关资讯
已删除
将门创投
7+阅读 · 2020年3月13日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
Top
微信扫码咨询专知VIP会员