4.4 Article

Leveraging Stack Overflow to detect relevant tutorial fragments of APIs

Journal

EMPIRICAL SOFTWARE ENGINEERING
Volume 28, Issue 1, Pages -

Publisher

SPRINGER
DOI: 10.1007/s10664-022-10235-1

Keywords

API tutorials; Stack overflow; Semi-supervised; Transfer learning

Ask authors/readers for more resources

This paper introduces a new method called SO2RT for detecting relevant tutorial fragments of APIs using Stack Overflow (SO) posts. The method reduces the effort required for labeling the relevance between tutorial fragments and APIs, and its effectiveness is confirmed through experiments and user studies.
Developers often use learning resources such as API tutorials and Stack Overflow (SO) to learn how to use an unfamiliar API. An API tutorial can be divided into a number of consecutive units that describe the same topic, denoted as tutorial fragments. We consider a tutorial fragment explaining the API usage knowledge as a relevant fragment of the API. Discovering relevant tutorial fragments of APIs can facilitate API understanding, learning, and application. However, existing approaches, based on supervised or unsupervised approaches, often suffer from either high manual efforts or lack of consideration of the relevance information. In this paper, we propose a novel approach, called SO2RT, to detect relevant tutorial fragments of APIs based on SO posts. SO2RT first automatically extracts relevant and irrelevant (API, QA) pairs (QA stands for question and answer) and (API, FRA) pairs (FRA stands for tutorial fragment). It then trains a semi-supervised transfer learning based detection model, which can transfer the API usage knowledge in SO Q&A pairs to tutorial fragments by utilizing the easy-to-extract (API, QA) pairs. Finally, relevant fragments of APIs can be discovered by consulting the trained model. In this way, the effort for labeling the relevance between tutorial fragments and APIs can be reduced. We evaluate SO2RT on Java and Android datasets containing 21,008 (API, QA) pairs. Experimental results show that SO2RT improves the state-of-the-art approaches in terms of F-Measure on both datasets. Our user study further confirms the effectiveness of SO2RT in practice. We also show a successful application of the relevant fragments to API recommendation.

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