Skip to main navigation Skip to search Skip to main content

API Recommendation for Novice Programmers: Build a Bridge of Query-Task Knowledge Gap

  • Yong Wang
  • , Yingtao Fang*
  • , Cuiyun Gao
  • , Linjun Chen
  • *Corresponding author for this work
  • Anhui Polytechnic University
  • Harbin Institute of Technology Shenzhen

Research output: Contribution to journalArticlepeer-review

Abstract

During software development, programmers often rely on a wide range of application programming interfaces (APIs) to facilitate their tasks. However, APIs have been growing rapidly in recent years, making it difficult for developers to choose among the many APIs that suit their programming needs. To facilitate the development process, automatic API recommendation is becoming increasingly important. Although there have been many effective research methods, these methods have a high dependence on the accuracy of the user's description of his own task, and there is a knowledge difference between the user's query and the user's actual task, increasing the difficulty of accurate API recommendation. In this article, we propose REAPI, a method to bridge the knowledge gap between the user's query and the user's actual task to improve the recommendation accuracy. The REAPI approach involves reconstructing query by tapping into Stack Overflow data to glean user intentions. Refactoring the user's query to display implicit information can better capture the user's true intentions. Specifically, we generate three candidate reconstruction statements based on natural language queries and Stack Overflow data and incorporate user feedback to refine and select the final statement. To evaluate the effectiveness of REAPI, we conducted experiments at both the class-level and method-level. Our results show that REAPI outperforms state-of-the-art baselines across key evaluation metrics such as S@1, S@3, S@10, MRR, and MAP.

Original languageEnglish
Pages (from-to)1473-1486
Number of pages14
JournalIEEE Transactions on Reliability
Volume73
Issue number3
DOIs
StatePublished - 2024
Externally publishedYes

Keywords

  • Application programming interface (API) recommendation
  • potential information display
  • statement reconstruction

Fingerprint

Dive into the research topics of 'API Recommendation for Novice Programmers: Build a Bridge of Query-Task Knowledge Gap'. Together they form a unique fingerprint.

Cite this