 |
|
|
|
 |
 |
 |
|
 |
|
 |
|
|
汪昕,陈驰,赵逸凡,彭鑫,赵文耘.基于深度学习的API误用缺陷检测.软件学报,2019,30(5):1342-1358 |
基于深度学习的API误用缺陷检测 |
API Misuse Bug Detection Based on Deep Learning |
投稿时间:2018-08-31 修订日期:2018-10-31 |
DOI:10.13328/j.cnki.jos.005722 |
中文关键词: API误用 使用规约 缺陷检测 深度学习 |
英文关键词:API misuse usage specification bug detection deep learning |
基金项目:国家重点研发计划(2016YFB1000801) |
作者 | 单位 | E-mail | 汪昕 | 复旦大学 软件学院, 上海 201203 上海市数据科学重点实验室(复旦大学), 上海 201203 | | 陈驰 | 复旦大学 软件学院, 上海 201203 上海市数据科学重点实验室(复旦大学), 上海 201203 | | 赵逸凡 | 复旦大学 软件学院, 上海 201203 上海市数据科学重点实验室(复旦大学), 上海 201203 | | 彭鑫 | 复旦大学 软件学院, 上海 201203 上海市数据科学重点实验室(复旦大学), 上海 201203 | pengxin@fudan.edu.cn | 赵文耘 | 复旦大学 软件学院, 上海 201203 上海市数据科学重点实验室(复旦大学), 上海 201203 | |
|
摘要点击次数: 1733 |
全文下载次数: 1081 |
中文摘要: |
开发人员经常需要使用各种应用程序编程接口(application programming interface,简称API)来复用已有的软件框架、类库等.由于API自身的复杂性、文档资料的缺失等原因,开发人员经常会误用API,从而导致代码缺陷.为了自动检测API误用缺陷,需要获得API使用规约,并根据规约对API使用代码进行检测.然而,可用于自动检测的API规约难以获得,而人工编写并维护的代价又很高.针对以上问题,将深度学习中的循环神经网络模型应用于API使用规约的学习及API误用缺陷的检测.在大量的开源Java代码基础上,通过静态分析构造API使用规约训练样本,同时利用这些训练样本搭建循环神经网络学习API使用规约.在此基础上,针对API使用代码进行基于上下文的语句预测,并通过预测结果与实际代码的比较发现潜在的API误用缺陷.对所提出的方法进行实现并针对Java加密相关的API及其使用代码进行了实验评估,结果表明,该方法能够在一定程度上实现API误用缺陷的自动发现. |
英文摘要: |
Developers often need to use various application programming interfaces (API) to reuse existing software frameworks, class libraries, and so on. Because of the complexity of the API itself, or the lack of documentation, developers often make some API misuses, which can lead to some code defects. In order to automatically detect API misuse defects, the API use specification is required and the API is tested according to the specification. However, API specifications that can be used for automatic detection are difficult to obtain, and the cost of manual writing and maintenance is high. To address the issue, this study applies the recurrent neural network model of deep learning to the task of learning API use specifications and the task of detecting the API misuse defect. In this study, based on a large number of open source Java code, the training sample of API use specification is extracted based on static analysis method, and then use the training sample to set up the recurrent neural network to learning API use specification. On this basis, this study makes a context-based prediction on the API use code, and finds out the potential API misuse defects by comparing the prediction results with the actual code. The method above is implemented, and it is evaluated with experiments about Java encryption related APIs and their used code. The results show that the proposed approach has the ability to a certain extent to automatically detect API misuse defects. |
HTML 下载PDF全文 查看/发表评论 下载PDF阅读器 |
|
|
|
|
|
|
 |
|
|
|
|
 |
|
 |
|
 |
|