On Using Machine Learning to Identify Knowledge in API Reference Documentation

Davide Fucci, Alireza Mollaalizadehbahnemiri, Walid Maalej
7/23/2019
cs.SE

Official code: dfucci/api-doc-kn-identification (4 stars, Python, Apache-2.0, last commit 2022-06-08).

Abstract

Using API reference documentation like JavaDoc is an integral part of software development. Previous research introduced a grounded taxonomy that organizes API documentation knowledge in 12 types, including knowledge about the Functionality, Structure, and Quality of an API.

Show full abstract

We study how well modern text classification approaches can automatically identify documentation containing specific knowledge types. We compared conventional machine learning (k-NN and SVM) and deep learning approaches trained on manually annotated Java and .NET API documentation (n = 5,574). When classifying the knowledge types individually (i.e., multiple binary classifiers) the best AUPRC was up to 87%. The deep learning and SVM classifiers seem complementary. For four knowledge types (Concept, Control, Pattern, and Non-Information), SVM clearly outperforms deep learning which, on the other hand, is more accurate for identifying the remaining types. When considering multiple knowledge types at once (i.e., multi-label classification) deep learning outperforms naïve baselines and traditional machine learning achieving a MacroAUC up to 79%. We also compared classifiers using embeddings pre-trained on generic text corpora and StackOverflow but did not observe significant improvements. Finally, to assess the generalizability of the classifiers, we re-tested them on a different, unseen Python documentation dataset. Classifiers for Functionality, Concept, Purpose, Pattern, and Directive seem to generalize from Java and .NET to Python documentation. The accuracy related to the remaining types seems API-specific. We discuss our results and how they inform the development of tools for supporting developers sharing and accessing API knowledge. Published article: https://doi.org/10.1145/3338906.3338943

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Code and Data for the "On Using Machine Learning to Identify Knowledge in API Reference Documentation" paper

45PythonJul 1, 20194 years agoApache-2.0

Similar Papers

Cite this paper

@article{fucci2019using,
  title  = {On Using Machine Learning to Identify Knowledge in API Reference Documentation},
  author = {Davide Fucci and Alireza Mollaalizadehbahnemiri and Walid Maalej},
  year   = {2019},
  eprint = {1907.09807},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1907.09807}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1907.09807.svg)](https://codeofpaper.com/paper/1907.09807)

Discussion