API method recommendation without worrying about the task-API knowledge gap
Developers often need to search for appropriate APIs for theirprogramming tasks. Although most libraries have API referencedocumentation, it is not easy to find appropriate APIs due to thelexical gap and knowledge gap between the natural language description of the programming task and the API descr...
Saved in:
Main Authors: | , , , , |
---|---|
Format: | text |
Language: | English |
Published: |
Institutional Knowledge at Singapore Management University
2018
|
Subjects: | |
Online Access: | https://ink.library.smu.edu.sg/sis_research/4297 https://ink.library.smu.edu.sg/context/sis_research/article/5300/viewcontent/ase182.pdf |
Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
Institution: | Singapore Management University |
Language: | English |
Summary: | Developers often need to search for appropriate APIs for theirprogramming tasks. Although most libraries have API referencedocumentation, it is not easy to find appropriate APIs due to thelexical gap and knowledge gap between the natural language description of the programming task and the API description in APIdocumentation. Here, the lexical gap refers to the fact that the samesemantic meaning can be expressed by different words, and theknowledge gap refers to the fact that API documentation mainlydescribes API functionality and structure but lacks other types ofinformation like concepts and purposes, which are usually the keyinformation in the task description. In this paper, we propose an APIrecommendation approach named BIKER (Bi-Information sourcebased KnowledgE Recommendation) to tackle these two gaps. Tobridge the lexical gap, BIKER uses word embedding technique tocalculate the similarity score between two text descriptions. Inspired by our survey findings that developers incorporate StackOverflow posts and API documentation for bridging the knowledgegap, BIKER leverages Stack Overflow posts to extract candidateAPIs for a program task, and ranks candidate APIs by consideringthe 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 eachAPI to help developers select the APIs that are most relevant totheir tasks. Our evaluation with 413 API-related questions confirmsthe effectiveness of BIKER for both class- and method-level API recommendation, compared with state-of-the-art baselines. Our userstudy with 28 Java developers further demonstrates the practicalityof BIKER for API search. |
---|