arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2111.11435cs.SEcs.LG
收藏

基于层次依赖结构和图注意网络的Source Code上下文语义精确学习

Precise Learning of Source Code Contextual Semantics via Hierarchical Dependence Structure and Graph Attention Networks

Peking University(北京大学);Beijing Forestry University(北京林业大学);Swinburne University of Technology(斯威本科技大学)

Zhehao Zhao, Bo Yang, Ge Li, Huai Liu, Zhi Jin

摘要:

深度学习被广泛用于各种软件工程任务,例如,程序分类和缺陷预测。虽然该技术消除了所需的过程中的功能工程,源代码模型的建设显着影响这些任务的性能。最近的工作主要集中在补充AST为基础的源代码模型,通过引入上下文依赖从CFG提取。然而,它们都没有注意到基本块的表示,这是上下文依赖的基础。在本文中,我们集成AST和CFG,提出了一种新的源代码模型嵌入层次依赖。在此基础上,我们还设计了一个基于图注意力机制的神经网络,具体介绍了基本块的语法结构,即:其对应的AST,在源代码模型中提供了足够的信息,填补了空白。我们已经评估了这个模型上的三个实际的软件工程任务,并与其他国家的最先进的方法进行比较。实验结果表明,该模型可以显著提高性能。例如,与性能最好的基线相比,我们的模型将参数的规模减少了50%,在程序分类任务上的准确率提高了4%。

英文摘要:

Deep learning is being used extensively in a variety of software engineering tasks, e.g., program classification and defect prediction. Although the technique eliminates the required process of feature engineering, the construction of source code model significantly affects the performance on those tasks. Most recent works was mainly focused on complementing AST-based source code models by introducing contextual dependencies extracted from CFG. However, all of them pay little attention to the representation of basic blocks, which are the basis of contextual dependencies. In this paper, we integrated AST and CFG and proposed a novel source code model embedded with hierarchical dependencies. Based on that, we also designed a neural network that depends on the graph attention mechanism.Specifically, we introduced the syntactic structural of the basic block, i.e., its corresponding AST, in source code model to provide sufficient information and fill the gap. We have evaluated this model on three practical software engineering tasks and compared it with other state-of-the-art methods. The results show that our model can significantly improve the performance. For example, compared to the best performing baseline, our model reduces the scale of parameters by 50\% and achieves 4\% improvement on accuracy on program classification task.

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

↑