ISSN 1000-1239 CN 11-1777/TP

计算机研究与发展 ›› 2019, Vol. 56 ›› Issue (8): 1605-1620.doi: 10.7544/issn1000-1239.2019.20190185

所属专题: 2019人工智能前沿进展专题

• 人工智能 • 上一篇    下一篇

基于深度学习的程序理解研究进展

刘芳,李戈,胡星,金芝   

  1. (北京大学信息科学技术学院 北京 100871) (高可信软件技术教育部重点实验室(北京大学) 北京 100871) (liufang816@pku.edu.cn)
  • 出版日期: 2019-08-01
  • 基金资助: 
    国家“九七三”重点基础研究发展计划基金项目(2015CB352201);国家自然科学基金项目(61620106007,61751210)

Program Comprehension Based on Deep Learning

Liu Fang, Li Ge, Hu Xing, Jin Zhi   

  1. (School of Electronics Engineering and Computer Science, Peking University, Beijing 100871) (Key Laboratory of High Confidence Software Technologies (Peking University), Ministry of Education, Beijing 100871)
  • Online: 2019-08-01

摘要: 程序理解通过对程序进行分析、抽象、推理从而获取程序中相关信息,在软件开发、维护、迁移等过程中起重要作用,因而得到学术界和工业界的广泛关注.传统程序理解很大程度上依赖开发人员的经验,但随着软件规模及其复杂度不断增大,完全依赖开发人员的先验知识提取程序特征既耗时耗力,又很难充分挖掘出程序中隐含特征.深度学习是一种数据驱动的端到端的方法,它根据已有数据构建深度神经网络对数据中隐含的特征进行挖掘,已经在众多领域中获得成功应用.将深度学习技术运用于程序理解中,根据具体任务以及大量数据自动地学习程序数据中蕴含的特征,可以充分地挖掘出程序中隐含的知识,提高程序理解的效率.对基于深度学习的程序理解研究工作进行综述,首先对程序所包含的性质进行分析,然后介绍主流的程序理解模型,包括基于序列、结构以及执行过程的程序理解模型.随后展示基于深度学习的程序理解在程序分析中的应用,主要针对代码补全、代码注释生成、代码检索等任务.最后,分析并总结程序理解研究所面临的挑战.

关键词: 程序理解, 程序分析, 软件工程, 深度学习, 数据挖掘

Abstract: Program comprehension is the process of obtaining relevant information in programs by analyzing, abstracting, and reasoning the programs. It plays an important role in software development, maintenance, migration, and other processes. It has received extensive attention in academia and industry. Traditional program comprehension relies heavily on the experience of developers. However, as the scale and complexity of software continue to grow, it is time-consuming and laborious to rely solely on the developer’s prior knowledge to extract program features, and it is difficult to fully exploit the hidden features in the program. Deep learning is a data-driven end-to-end method. It builds deep neural networks based on existing data to mine the hidden features in data, and has been successfully applied in many fields. By applying deep learning technology to program comprehension, we can automatically learn the features implied in programs, which can fully exploit the knowledge implied in the program and improve the efficiency of program comprehension. This paper surveys the research work of program comprehension based on deep learning in recent years. Firstly, we analyze the properties of the program, and then introduce mainstream program comprehension models, including sequential models, structural models, and execution traces based models. Furthermore, the applications of deep learning-based program comprehension in program analysis are introduced, which mainly focus on code completion, code summarization and code search, etc. Finally, we summarize the challenges in program comprehension research.

Key words: program comprehension, program analysis, software engineering, deep learning, data mining

中图分类号: