首页 | 本学科首页   官方微博 | 高级检索  
     

基于对象类型的API补全方法
引用本文:唐泽,李传艺,葛季栋,骆斌. 基于对象类型的API补全方法[J]. 软件学报, 2022, 33(5): 1736-1757
作者姓名:唐泽  李传艺  葛季栋  骆斌
作者单位:计算机软件新技术国家重点实验室(南京大学), 江苏 南京 210023
基金项目:国家自然科学基金(No.61802167, 61972197, 61802095), 江苏省自然科学基金(No.BK20201250), 华为-南京大学下一代程序设计创新实验室合作协议子项目资助
摘    要:近年来, 随着软件技术在各行各业、不同领域的应用不断扩展与深入, 同时伴随着软件架构、服务计算等技术的不断发展, 软件行业涌现出了功能丰富且规模庞大的第三方API或库, 软件开发者在实现软件功能的时候也越来越依赖这些API. 但学习这些API的使用是非常困难且耗时的, 主要有两方面的原因: 1)相关文档的缺失和错误; ...

关 键 词:API补全  对象类型  插件
收稿时间:2021-08-11
修稿时间:2021-10-09

Method of API Completion Based on Object Type
TANG Ze,LI Chuan-Yi,GE Ji-Dong,LUO Bin. Method of API Completion Based on Object Type[J]. Journal of Software, 2022, 33(5): 1736-1757
Authors:TANG Ze  LI Chuan-Yi  GE Ji-Dong  LUO Bin
Affiliation:State Key Laboratory for Novel Software Technology (Nanjing University), Nanjing 210023, China
Abstract:In recent years, with the continuous expansion and deepening of the application of software technology in various industries and fields, as well as the development of software architecture, services computing, etc., the software industry has emerged with feature-rich and large-scale third-party APIs or Libraries. Software developers are increasingly relying on these APIs when implementing software functions. However, learning the usage of these APIs is very difficult and time-consuming. There are two main reasons: 1) missing or wrong documents; 2) few sample codes for API usage. Therefore, designing automatic API completion methods to help developers use the API correctly and quickly has great application value. However, most of the existing API automatic completion methods regarding the code segments to be completed as plain text, ignoring the impact of the object types of APIs. So, in this paper, we explore the role of the object types in completing APIs. Besides, inspired by the object state diagram, we design and implement an concrete API completion method that uses the types of the objects as a novel feature. Specifically, first extract the subsequence of the same object type from the API call sequence and use a deep learning model to encode the state of each object. Then, use the objects'' states to generate a state representation of the entire method block. In order to evaluate the proposed method, we conduct comprehensive experiments on six popular java projects. The experimental results prove that the proposed API completion method achieves significantly higher predicting accuracy than the baseline approaches.
Keywords:API completion  object type  plug-in
点击此处可从《软件学报》浏览原始摘要信息
点击此处可从《软件学报》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号