Improving API Knowledge Discovery with ML: A Case Study of Comparable API Methods
Daye Nam, Brad A. Myers, Bogdan Vasilescu, Vincent J. Hellendoorn
Abstract
Developers constantly learn new APIs, but often lack necessary information from documentation, resorting instead to popular question-and-answer platforms such as Stack Overflow. In this paper, we investigate how to use recent machine-Iearning-based knowledge extraction techniques to automatically identify pairs of comparable API methods and the sentences describing the comparison from Stack Overflow answers. We first built a prototype that can be stocked with a dataset of comparable API methods and provides tool-tips to users in search results and in API documentation. We conducted a user study with this tool based on a dataset of TensorFlow comparable API methods spanning 198 hand-annotated facts from Stack Overflow posts. This study confirmed that providing comparable API methods can be useful for helping developers understand the design space of APIs: developers using our tool were significantly more aware of the comparable API methods and better understood the differences between them. We then created SOREL, an comparable API methods knowledge extraction tool trained on our hand-annotated corpus, which achieves a 71% precision and 55% recall at discovering our manually extracted facts and discovers 433 pairs of comparable API methods from thousands of unseen Stack Overflow posts. This work highlights the merit of jointly studying programming assistance tools and constructing machine learning techniques to power them.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 832eeabb-6d9f-476a-9f47-11f49be1f4f1Cited by top-tier papers1
Ask how each one uses itBuilds on9
- Stack Overflow Considered Harmful? The Impact of Copy&Paste on Android Application SecurityFelix Fischer, Konstantin Böttinger, Huang Xiao, Christian Stransky et al.S&P 2017 · 293 citations
- Generating Concept based API Element Comparison Using a Knowledge GraphYang Liu, Mingwei Liu, Xin Peng, Christoph Treude et al.ASE 2020 · 28 citations
- Automatic Extraction of Opinion-based Q&A from Online Developer ChatsPreetha Chatterjee, Kostadin Damevski, Lori L. PollockICSE 2021 · 28 citations
- Demystify official API usage directives with crowdsourced API misuse scenarios, erroneous code examples and patchesXiaoxue Ren, Jiamou Sun, Zhenchang Xing, Xin Xia et al.ICSE 2020 · 28 citations
- SOAR: A Synthesis Approach for Data Science API RefactoringAnsong Ni, Daniel Ramos, Aidan Z. H. Yang, Inês Lynce et al.ICSE 2021 · 27 citations
Related papers
- CLEAR: Contrastive Learning for API RecommendationMoshi Wei, Nima Shiri Harzevili, Yuchao Huang, Junjie Wang et al.ICSE 2022 · 43 citations
- API recommendation for machine learning libraries: how far are we?Moshi Wei, Yuchao Huang, Junjie Wang, Jiho Shin et al.FSE 2022 · 6 citations
- Interpreting cloud computer vision pain-points: a mining study of stack overflowAlex Cummaudo, Rajesh Vasa, Scott Barnett, John C. Grundy et al.ICSE 2020 · 26 citations
- Are Human Rules Necessary? Generating Reusable APIs with CoT Reasoning and In-Context LearningYubo Mai, Zhipeng Gao, Xing Hu, Lingfeng Bao et al.FSE 2024 · 4 citations
- Knowledge-Based Version Incompatibility Detection for Deep LearningZhongkai Zhao, Bonan Kou, Mohamed Yilmaz Ibrahim, Muhao Chen et al.FSE 2023 · 7 citations
