4.4 Article

Discovering API Directives from API Specifications with Text Classification

Journal

JOURNAL OF COMPUTER SCIENCE AND TECHNOLOGY
Volume 36, Issue 4, Pages 922-943

Publisher

SPRINGER SINGAPORE PTE LTD
DOI: 10.1007/s11390-021-0235-1

Keywords

Application programming interface (API) directive; API specification; imbalanced learning; text classification

Funding

  1. National Key Research and Development Plan of China [2018YFB1003900]
  2. National Natural Science Foundation of China [61902181]
  3. China Postdoctoral Science Foundation [2020M671489]
  4. CCF-Tencent Open Research Fund [RAGR20200106]

Ask authors/readers for more resources

The paper proposes an approach leveraging text classification to discover API directives from API specifications, characterizing sentences and employing an under-sampling strategy to handle the imbalance between API directives and non-directives. The approach achieves a high F-measure value of up to 82.08% and statistically outperforms the state-of-the-art method by up to 29.67% in terms of F-measure.
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.

Authors

I am an author on this paper
Click your name to claim this paper and add it to your profile.

Reviews

Primary Rating

4.4
Not enough ratings

Secondary Ratings

Novelty
-
Significance
-
Scientific rigor
-
Rate this paper

Recommended

No Data Available
No Data Available