首页|Discovering API Directives from API Specifications with Text Classification

Discovering API Directives from API Specifications with Text Classification

扫码查看
Application programming interface (API) libraries are extensively used by developers. To correctly program with APIs and avoid bugs, developers shall pay attention to API directives, which illustrate the constraints of APIs. Unfortunately, API directives usually have diverse morphologies, making it time-consuming and error-prone for developers to discover all the relevant API directives. In this paper, we propose an approach leveraging text classification to discover API directives from API specifications. Specifically, given a set of training sentences in API specifications, our approach first characterizes each sentence by three groups of features. Then, to deal with the unequal distribution between API directives and non-directives, our approach employs an under-sampling strategy to split the imbalanced training set into several subsets and trains several classifiers. Given a new sentence in an API specification, our approach synthesizes the trained classifiers to predict whether it is an API directive. We have evaluated our approach over a publicly available annotated API directive corpus. The experimental results reveal that our approach achieves an F-measure value of up to 82.08%. In addition, our approach statistically outperforms the state-of-the-art approach by up to 29.67%in terms of F-measure.

Application programming interface (API) directiveAPI specificationimbalanced learningtext classification

Jing-Xuan Zhang、Chuan-Qi Tao、Zhi-Qiu Huang、Xin Chen

展开 >

College of Computer Science and Technology,Nanjing University of Aeronautics and Astronautics,Nanjing 210016,China

Key Laboratory of Safety-Critical Software(Nanjing University of Aeronautics and Astronautics),Ministry of Industry and Information Technology,Nanjing 210016,China

Key Laboratory of Complex Systems Modeling and Simulation(Hangzhou Dianzi University),Ministry of Education Hangzhou 310018,China

School of Computer Science and Technology,Hangzhou Dianzi University,Hangzhou 310018,China

展开 >

2018YFB1003900619021812020M671489RAGR20200106

2021

计算机科学技术学报(英文版)
中国计算机学会

计算机科学技术学报(英文版)

CSTPCDCSCDSCIEI
影响因子:0.432
ISSN:1000-9000
年,卷(期):2021.36(4)
  • 45