API method recommendation without worrying about the TASK-API knowledge gap

Qiao Huang, Xin Xia, Zhenchang Xing, David Lo, Xinyu Wang

Research output: Chapter in Book/Report/Conference proceedingConference PaperResearchpeer-review

Abstract

Developers often need to search for appropriate APIs for their programming tasks. Although most libraries have API reference documentation, it is not easy to find appropriate APIs due to the lexical gap and knowledge gap between the natural language description of the programming task and the API description in API documentation. Here, the lexical gap refers to the fact that the same semantic meaning can be expressed by different words, and the knowledge gap refers to the fact that API documentation mainly describes API functionality and structure but lacks other types of information like concepts and purposes, which are usually the key information in the task description. In this paper, we propose an API recommendation approach named BIKER (Bi-Information source based KnowledgE Recommendation) to tackle these two gaps. To bridge the lexical gap, BIKER uses word embedding technique to calculate the similarity score between two text descriptions. Inspired by our survey findings that developers incorporate Stack Overflow posts and API documentation for bridging the knowledge gap, BIKER leverages Stack Overflow posts to extract candidate APIs for a program task, and ranks candidate APIs by considering the query's similarity with both Stack Overflow posts and API documentation. It also summarizes supplementary information (e.g., API description, code examples in Stack Overflow posts) for each API to help developers select the APIs that are most relevant to their tasks. Our evaluation with 413 API-related questions confirms the effectiveness of BIKER for both class- and method-level API recommendation, compared with state-of-the-art baselines. Our user study with 28 Java developers further demonstrates the practicality of BIKER for API search.

Original languageEnglish
Title of host publicationASE'18 - Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering
Subtitle of host publicationSeptember 3–7, 2018 Montpellier, France
EditorsChristian Kastner, Gordon Fraser
Place of PublicationNew York NY USA
PublisherAssociation for Computing Machinery (ACM)
Pages293-304
Number of pages12
ISBN (Electronic)9781450359375
DOIs
Publication statusPublished - 2018
EventAutomated Software Engineering Conference 2018 - Corum Conference Center, Montpellier, France
Duration: 3 Sep 20187 Sep 2018
Conference number: 33rd
http://www.ase2018.com/

Conference

ConferenceAutomated Software Engineering Conference 2018
Abbreviated titleASE 2018
CountryFrance
CityMontpellier
Period3/09/187/09/18
Internet address

Keywords

  • API documentation
  • API recommendation
  • Stack overflow
  • Word embedding

Cite this

Huang, Q., Xia, X., Xing, Z., Lo, D., & Wang, X. (2018). API method recommendation without worrying about the TASK-API knowledge gap. In C. Kastner, & G. Fraser (Eds.), ASE'18 - Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering: September 3–7, 2018 Montpellier, France (pp. 293-304). New York NY USA: Association for Computing Machinery (ACM). https://doi.org/10.1145/3238147.3238191
Huang, Qiao ; Xia, Xin ; Xing, Zhenchang ; Lo, David ; Wang, Xinyu. / API method recommendation without worrying about the TASK-API knowledge gap. ASE'18 - Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering: September 3–7, 2018 Montpellier, France . editor / Christian Kastner ; Gordon Fraser. New York NY USA : Association for Computing Machinery (ACM), 2018. pp. 293-304
@inproceedings{bc0a55f7e3a74f6da7623782851fb0b8,
title = "API method recommendation without worrying about the TASK-API knowledge gap",
abstract = "Developers often need to search for appropriate APIs for their programming tasks. Although most libraries have API reference documentation, it is not easy to find appropriate APIs due to the lexical gap and knowledge gap between the natural language description of the programming task and the API description in API documentation. Here, the lexical gap refers to the fact that the same semantic meaning can be expressed by different words, and the knowledge gap refers to the fact that API documentation mainly describes API functionality and structure but lacks other types of information like concepts and purposes, which are usually the key information in the task description. In this paper, we propose an API recommendation approach named BIKER (Bi-Information source based KnowledgE Recommendation) to tackle these two gaps. To bridge the lexical gap, BIKER uses word embedding technique to calculate the similarity score between two text descriptions. Inspired by our survey findings that developers incorporate Stack Overflow posts and API documentation for bridging the knowledge gap, BIKER leverages Stack Overflow posts to extract candidate APIs for a program task, and ranks candidate APIs by considering the query's similarity with both Stack Overflow posts and API documentation. It also summarizes supplementary information (e.g., API description, code examples in Stack Overflow posts) for each API to help developers select the APIs that are most relevant to their tasks. Our evaluation with 413 API-related questions confirms the effectiveness of BIKER for both class- and method-level API recommendation, compared with state-of-the-art baselines. Our user study with 28 Java developers further demonstrates the practicality of BIKER for API search.",
keywords = "API documentation, API recommendation, Stack overflow, Word embedding",
author = "Qiao Huang and Xin Xia and Zhenchang Xing and David Lo and Xinyu Wang",
year = "2018",
doi = "10.1145/3238147.3238191",
language = "English",
pages = "293--304",
editor = "Christian Kastner and Gordon Fraser",
booktitle = "ASE'18 - Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering",
publisher = "Association for Computing Machinery (ACM)",
address = "United States of America",

}

Huang, Q, Xia, X, Xing, Z, Lo, D & Wang, X 2018, API method recommendation without worrying about the TASK-API knowledge gap. in C Kastner & G Fraser (eds), ASE'18 - Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering: September 3–7, 2018 Montpellier, France . Association for Computing Machinery (ACM), New York NY USA, pp. 293-304, Automated Software Engineering Conference 2018, Montpellier, France, 3/09/18. https://doi.org/10.1145/3238147.3238191

API method recommendation without worrying about the TASK-API knowledge gap. / Huang, Qiao; Xia, Xin; Xing, Zhenchang; Lo, David; Wang, Xinyu.

ASE'18 - Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering: September 3–7, 2018 Montpellier, France . ed. / Christian Kastner; Gordon Fraser. New York NY USA : Association for Computing Machinery (ACM), 2018. p. 293-304.

Research output: Chapter in Book/Report/Conference proceedingConference PaperResearchpeer-review

TY - GEN

T1 - API method recommendation without worrying about the TASK-API knowledge gap

AU - Huang, Qiao

AU - Xia, Xin

AU - Xing, Zhenchang

AU - Lo, David

AU - Wang, Xinyu

PY - 2018

Y1 - 2018

N2 - Developers often need to search for appropriate APIs for their programming tasks. Although most libraries have API reference documentation, it is not easy to find appropriate APIs due to the lexical gap and knowledge gap between the natural language description of the programming task and the API description in API documentation. Here, the lexical gap refers to the fact that the same semantic meaning can be expressed by different words, and the knowledge gap refers to the fact that API documentation mainly describes API functionality and structure but lacks other types of information like concepts and purposes, which are usually the key information in the task description. In this paper, we propose an API recommendation approach named BIKER (Bi-Information source based KnowledgE Recommendation) to tackle these two gaps. To bridge the lexical gap, BIKER uses word embedding technique to calculate the similarity score between two text descriptions. Inspired by our survey findings that developers incorporate Stack Overflow posts and API documentation for bridging the knowledge gap, BIKER leverages Stack Overflow posts to extract candidate APIs for a program task, and ranks candidate APIs by considering the query's similarity with both Stack Overflow posts and API documentation. It also summarizes supplementary information (e.g., API description, code examples in Stack Overflow posts) for each API to help developers select the APIs that are most relevant to their tasks. Our evaluation with 413 API-related questions confirms the effectiveness of BIKER for both class- and method-level API recommendation, compared with state-of-the-art baselines. Our user study with 28 Java developers further demonstrates the practicality of BIKER for API search.

AB - Developers often need to search for appropriate APIs for their programming tasks. Although most libraries have API reference documentation, it is not easy to find appropriate APIs due to the lexical gap and knowledge gap between the natural language description of the programming task and the API description in API documentation. Here, the lexical gap refers to the fact that the same semantic meaning can be expressed by different words, and the knowledge gap refers to the fact that API documentation mainly describes API functionality and structure but lacks other types of information like concepts and purposes, which are usually the key information in the task description. In this paper, we propose an API recommendation approach named BIKER (Bi-Information source based KnowledgE Recommendation) to tackle these two gaps. To bridge the lexical gap, BIKER uses word embedding technique to calculate the similarity score between two text descriptions. Inspired by our survey findings that developers incorporate Stack Overflow posts and API documentation for bridging the knowledge gap, BIKER leverages Stack Overflow posts to extract candidate APIs for a program task, and ranks candidate APIs by considering the query's similarity with both Stack Overflow posts and API documentation. It also summarizes supplementary information (e.g., API description, code examples in Stack Overflow posts) for each API to help developers select the APIs that are most relevant to their tasks. Our evaluation with 413 API-related questions confirms the effectiveness of BIKER for both class- and method-level API recommendation, compared with state-of-the-art baselines. Our user study with 28 Java developers further demonstrates the practicality of BIKER for API search.

KW - API documentation

KW - API recommendation

KW - Stack overflow

KW - Word embedding

UR - http://www.scopus.com/inward/record.url?scp=85056537700&partnerID=8YFLogxK

U2 - 10.1145/3238147.3238191

DO - 10.1145/3238147.3238191

M3 - Conference Paper

SP - 293

EP - 304

BT - ASE'18 - Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering

A2 - Kastner, Christian

A2 - Fraser, Gordon

PB - Association for Computing Machinery (ACM)

CY - New York NY USA

ER -

Huang Q, Xia X, Xing Z, Lo D, Wang X. API method recommendation without worrying about the TASK-API knowledge gap. In Kastner C, Fraser G, editors, ASE'18 - Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering: September 3–7, 2018 Montpellier, France . New York NY USA: Association for Computing Machinery (ACM). 2018. p. 293-304 https://doi.org/10.1145/3238147.3238191