Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/3238147.3238191acmconferencesArticle/Chapter ViewAbstractPublication PagesaseConference Proceedingsconference-collections
research-article

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

Published: 03 September 2018 Publication History

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.

References

[1]
2017. Java SE 8 API documentation downloading site. http://www.oracle.com/t echnetwork/java/javase/documentation/jdk8-doc-downloads-2133158.html. 2017. Stack Overflow Data Dump. https://archive.org/download/stackexchange. 2018. DeepAPI’s online demo. http://www.cse.ust.hk/~xguaa/deepapi/tooldemo. html. 2018. RACK’s dataset and tool demo. http://homepage.usask.ca/~masud.rahman/ rack/. 2018. Stack Overflow question: Class.isInstance vs Class.isAssignableFrom. https://stackoverflow.com/questions/3949260/java-class-isinstance-vs-class-i sassignablefrom.
[2]
Hervé Abdi. 2007. Bonferroni and Šidák corrections for multiple comparisons. Encyclopedia of measurement and statistics 3 (2007), 103–107.
[3]
Miltos Allamanis, Daniel Tarlow, Andrew Gordon, and Yi Wei. 2015. Bimodal modelling of source code and natural language. In International Conference on Machine Learning. 2123–2132.
[4]
Lingfeng Bao, Zhenchang Xing, Xin Xia, David Lo, and Ahmed E Hassan. 2018. Inference of development activities from interaction with uninstrumented applications. Empirical Software Engineering 23, 3 (2018), 1313–1351.
[5]
Anton Barua, Stephen W Thomas, and Ahmed E Hassan. 2014. What are developers talking about? an analysis of topics and trends in stack overflow. Empirical Software Engineering 19, 3 (2014), 619–654.
[6]
Steven Bird and Edward Loper. 2004. NLTK: the natural language toolkit. In Proceedings of the ACL 2004 on Interactive poster and demonstration sessions. Association for Computational Linguistics, 31.
[7]
Joel Brandt, Philip J Guo, Joel Lewenstein, Mira Dontcheva, and Scott R Klemmer. 2009. Two studies of opportunistic programming: interleaving web foraging, learning, and writing code. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems. ACM, 1589–1598.
[8]
Brock Angus Campbell and Christoph Treude. 2017. NLP2Code: Code snippet content assist via natural language tasks. In Software Maintenance and Evolution (ICSME), 2017 IEEE International Conference on. IEEE, 628–632.
[9]
Wing-Kwan Chan, Hong Cheng, and David Lo. 2012. Searching connected API subgraph via text phrases. In Proceedings of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering. ACM, 10.
[10]
Shaunak Chatterjee, Sudeep Juvekar, and Koushik Sen. 2009. Sniff: A search engine for java using free-form queries. In International Conference on Fundamental Approaches to Software Engineering. Springer, 385–400.
[11]
Norman Cliff. 2014. Ordinal methods for behavioral data analysis. Psychology Press.
[12]
Ekwa Duala-Ekoko and Martin P Robillard. 2012. Asking and answering questions about unfamiliar APIs: An exploratory study. In Software Engineering (ICSE), 2012 34th International Conference on. IEEE, 266–276.
[13]
Kayvon Fatahalian, Jeremy Sugerman, and Pat Hanrahan. 2004. Understanding the efficiency of GPU algorithms for matrix-matrix multiplication. In Proceedings of the ACM SIGGRAPH/EUROGRAPHICS conference on Graphics hardware. ACM, 133–137.
[14]
Joseph L Fleiss. 1971. Measuring nominal scale agreement among many raters. Psychological bulletin 76, 5 (1971), 378.
[15]
Qing Gao, Hansheng Zhang, Jie Wang, Yingfei Xiong, Lu Zhang, and Hong Mei. 2015. Fixing recurring crash bugs via analyzing q&a sites (T). In Automated Software Engineering (ASE), 2015 30th IEEE/ACM International Conference on. IEEE, 307–318.
[16]
Ian Goodfellow, Yoshua Bengio, Aaron Courville, and Yoshua Bengio. 2016. Deep learning. Vol. 1. MIT press Cambridge.
[17]
Xiaodong Gu, Hongyu Zhang, Dongmei Zhang, and Sunghun Kim. 2016. Deep API learning. In Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering. ACM, 631–642.
[18]
Tihomir Gvero and Viktor Kuncak. 2015. Interactive synthesis using free-form queries. In Software Engineering (ICSE), 2015 IEEE/ACM 37th IEEE International Conference on, Vol. 2. IEEE, 689–692.
[19]
He Jiang, Jingxuan Zhang, Zhilei Ren, and Tao Zhang. 2017. An unsupervised approach for discovering relevant tutorial fragments for APIs. In Proceedings of the 39th International Conference on Software Engineering. IEEE Press, 38–48.
[20]
An Ngoc Lam, Anh Tuan Nguyen, Hoan Anh Nguyen, and Tien N Nguyen. 2015. Combining deep learning with information retrieval to localize buggy files for bug reports (n). In Automated Software Engineering (ASE), 2015 30th IEEE/ACM International Conference on. IEEE, 476–481.
[21]
Christopher D Manning, Prabhakar Raghavan, and Hinrich Schütze. 2008. Introduction to Information Retrieval. Cambridge University Press.
[22]
Collin McMillan, Mark Grechanik, Denys Poshyvanyk, Qing Xie, and Chen Fu. 2011. Portfolio: finding relevant functions and their usage. In Proceedings of the 33rd International Conference on Software Engineering. ACM, 111–120.
[23]
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. 2013. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems. 3111–3119.
[24]
Laura Moreno, Gabriele Bavota, Massimiliano Di Penta, Rocco Oliveto, and Andrian Marcus. 2015. How can I use this method?. In Software Engineering (ICSE), 2015 IEEE/ACM 37th IEEE International Conference on, Vol. 1. IEEE, 880– 890.
[25]
Anh Tuan Nguyen, Peter C Rigby, Thanh Van Nguyen, Mark Karanfil, and Tien N Nguyen. 2017. Statistical translation of English texts to API code templates. In Software Engineering Companion (ICSE-C), 2017 IEEE/ACM 39th International Conference on. IEEE, 331–333.
[26]
Trong Duc Nguyen, Anh Tuan Nguyen, Hung Dang Phan, and Tien N Nguyen. 2017. Exploring API embedding for API usages and applications. In Software Engineering (ICSE), 2017 IEEE/ACM 39th International Conference on. IEEE, 438– 449.
[27]
Gayane Petrosyan, Martin P Robillard, and Renato De Mori. 2015. Discovering information explaining API types using text classification. In Software Engineering (ICSE), 2015 IEEE/ACM 37th IEEE International Conference on, Vol. 1. IEEE, 869– 879.
[28]
Luca Ponzanelli, Gabriele Bavota, Massimiliano Di Penta, Rocco Oliveto, and Michele Lanza. 2014. Mining StackOverflow to turn the IDE into a self-confident programming prompter. In Proceedings of the 11th Working Conference on Mining Software Repositories. ACM, 102–111.
[29]
Mukund Raghothaman, Yi Wei, and Youssef Hamadi. 2016. SWIM: Synthesizing What I Mean-Code Search and Idiomatic Snippet Synthesis. In Software Engineering (ICSE), 2016 IEEE/ACM 38th International Conference on. IEEE, 357–367.
[30]
Mohammad Masudur Rahman, Chanchal K Roy, and David Lo. 2016. Rack: Automatic api recommendation using crowdsourced knowledge. In Software Analysis, Evolution, and Reengineering (SANER), 2016 IEEE 23rd International Conference on, Vol. 1. IEEE, 349–359.
[31]
Radim Řehůřek and Petr Sojka. 2010. Software Framework for Topic Modelling with Large Corpora. In Proceedings of the LREC 2010 Workshop on New Challenges for NLP Frameworks. ELRA, Valletta, Malta, 45–50. http://is.muni.cz/publication /884893/en.
[32]
Caitlin Sadowski, Kathryn T Stolee, and Sebastian Elbaum. 2015. How developers search for code: a case study. In Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering. ACM, 191–201.
[33]
Ripon K Saha, Matthew Lease, Sarfraz Khurshid, and Dewayne E Perry. 2013. Improving bug localization using structured information retrieval. In Automated Software Engineering (ASE), 2013 IEEE/ACM 28th International Conference on. IEEE, 345–355.
[34]
Christoph Treude, Ohad Barzilay, and Margaret-Anne Storey. 2011. How do programmers ask and answer questions on the web?: Nier track. In Software Engineering (ICSE), 2011 33rd International Conference on. IEEE, 804–807.
[35]
Christoph Treude and Martin P Robillard. 2016. Augmenting api documentation with insights from stack overflow. In Software Engineering (ICSE), 2016 IEEE/ACM 38th International Conference on. IEEE, 392–403.
[36]
Ming Wen, Rongxin Wu, and Shing-Chi Cheung. 2016. Locus: Locating bugs from software changes. In Automated Software Engineering (ASE), 2016 31st IEEE/ACM International Conference on. IEEE, 262–273.
[37]
Frank Wilcoxon. 1945. Individual comparisons by ranking methods. Biometrics bulletin 1, 6 (1945), 80–83.
[38]
Edmund Wong, Jinqiu Yang, and Lin Tan. 2013. Autocomment: Mining question and answer sites for automatic comment generation. In Automated Software Engineering (ASE), 2013 IEEE/ACM 28th International Conference on. IEEE, 562– 567.
[39]
Xin Xia, Lingfeng Bao, David Lo, Pavneet Singh Kochhar, Ahmed E Hassan, and Zhenchang Xing. 2017. What do developers search for on the web? Empirical Software Engineering 22, 6 (2017), 3149–3185.
[40]
Xin Xia, Lingfeng Bao, David Lo, Zhenchang Xing, Ahmed E Hassan, and Shanping Li. 2017. Measuring program comprehension: A large-scale field study with professionals. IEEE Transactions on Software Engineering (2017).
[41]
Xin Xia and David Lo. 2017. An effective change recommendation approach for supplementary bug fixes. Automated Software Engineering 24, 2 (2017), 455–498.
[42]
Bowen Xu, Zhenchang Xing, Xin Xia, and David Lo. 2017. AnswerBot: automated generation of answer summary to developersź technical questions. In Proceedings of the 32nd IEEE/ACM International Conference on Automated Software Engineering. IEEE Press, 706–716.
[43]
Bowen Xu, Zhenchang Xing, Xin Xia, David Lo, Qingye Wang, and Shanping Li. 2016. Domain-specific cross-language relevant question retrieval. In Proceedings of the 13th International Conference on Mining Software Repositories. ACM, 413– 424.
[44]
Xinli Yang, David Lo, Xin Xia, Lingfeng Bao, and Jianling Sun. 2016. Combining word embedding with information retrieval to recommend similar bug reports. In 2016 IEEE 27th International Symposium on Software Reliability Engineering (ISSRE). IEEE, 127–137.
[45]
Xin Ye, Hui Shen, Xiao Ma, Razvan Bunescu, and Chang Liu. 2016. From word embeddings to document similarities for improved information retrieval in software engineering. In Proceedings of the 38th international conference on software engineering. ACM, 404–415.
[46]
Motahareh Bahrami Zanjani, Huzefa Kagdi, and Christian Bird. 2016. Automatically recommending peer reviewers in modern code review. IEEE Transactions on Software Engineering 42, 6 (2016), 530–543. ASE ’18, September 3–7, 2018, Montpellier, France Qiao Huang, Xin Xia, Zhenchang Xing, David Lo, and Xinyu Wang

Cited By

View all
  • (2024)An API Recommendation Method for Querying Mobile Computing ProblemsInternational Journal of Cognitive Informatics and Natural Intelligence10.4018/IJCINI.34442218:1(1-16)Online publication date: 30-May-2024
  • (2024)Software Engineering for Developing a Cloud Computing Museum-Guide SystemInternational Journal of Cloud Applications and Computing10.4018/IJCAC.33920014:1(1-19)Online publication date: 20-Feb-2024
  • (2024)Harnessing Test-Oriented Knowledge Graphs for Enhanced Test Function RecommendationElectronics10.3390/electronics1308154713:8(1547)Online publication date: 18-Apr-2024
  • Show More Cited By

Index Terms

  1. API method recommendation without worrying about the task-API knowledge gap

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    ASE '18: Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering
    September 2018
    955 pages
    ISBN:9781450359375
    DOI:10.1145/3238147
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 03 September 2018

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. API Documentation
    2. API Recommendation
    3. Stack Overflow
    4. Word Embedding

    Qualifiers

    • Research-article

    Conference

    ASE '18
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 82 of 337 submissions, 24%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)131
    • Downloads (Last 6 weeks)8
    Reflects downloads up to 14 Nov 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)An API Recommendation Method for Querying Mobile Computing ProblemsInternational Journal of Cognitive Informatics and Natural Intelligence10.4018/IJCINI.34442218:1(1-16)Online publication date: 30-May-2024
    • (2024)Software Engineering for Developing a Cloud Computing Museum-Guide SystemInternational Journal of Cloud Applications and Computing10.4018/IJCAC.33920014:1(1-19)Online publication date: 20-Feb-2024
    • (2024)Harnessing Test-Oriented Knowledge Graphs for Enhanced Test Function RecommendationElectronics10.3390/electronics1308154713:8(1547)Online publication date: 18-Apr-2024
    • (2024)Large Language Models for Software Engineering: A Systematic Literature ReviewACM Transactions on Software Engineering and Methodology10.1145/3695988Online publication date: 20-Sep-2024
    • (2024)Mutual Learning-Based Framework for Enhancing Robustness of Code Models via Adversarial TrainingProceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering10.1145/3691620.3695519(1484-1496)Online publication date: 27-Oct-2024
    • (2024)Are Human Rules Necessary? Generating Reusable APIs with CoT Reasoning and In-Context LearningProceedings of the ACM on Software Engineering10.1145/36608111:FSE(2355-2377)Online publication date: 12-Jul-2024
    • (2024)MicroRec: Leveraging Large Language Models for Microservice RecommendationProceedings of the 21st International Conference on Mining Software Repositories10.1145/3643991.3644916(419-430)Online publication date: 15-Apr-2024
    • (2024)Compositional API Recommendation for Library-Oriented Code GenerationProceedings of the 32nd IEEE/ACM International Conference on Program Comprehension10.1145/3643916.3644403(87-98)Online publication date: 15-Apr-2024
    • (2024)Mapping APIs in Dynamic-typed Programs by Leveraging Transfer LearningACM Transactions on Software Engineering and Methodology10.1145/364184833:4(1-29)Online publication date: 18-Apr-2024
    • (2024)eFish'nSea: Unity Game Set for Learning Software Performance Issues Root Causes and ResolutionsProceedings of the 46th International Conference on Software Engineering: Software Engineering Education and Training10.1145/3639474.3640066(342-347)Online publication date: 14-Apr-2024
    • Show More Cited By

    View Options

    Get Access

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media