Skip to main content

RASOP: An API Recommendation Method Based on Word Embedding Technology

  • Conference paper
  • First Online:
Artificial Intelligence Algorithms and Applications (ISICA 2019)

Part of the book series: Communications in Computer and Information Science ((CCIS,volume 1205))

Included in the following conference series:

  • 2383 Accesses

Abstract

Users’ demand for the function of the software is increasingly affluent, and the scale of software is getting larger and larger. The structure of software presents the characteristics of complexity. In the process of software development, developers are likely to face a lot of difficulties, so they need to query the appropriate APIs. However, finding the right APIs can be time-consuming and laborious. It’s especially difficult for developers who don’t have much programming experience. In this paper, to solve the problems developers may face in the actual development process and improve the development efficiency, we propose RASOP (Recommendation APIs by Stack Overflow posts and Java Packages), an API recommendation approach leveraging word embedding technique and the information crawling from Stack Overflow posts and Java core packages, to recommend appropriate APIs for developers. Furthermore, RASOP also provides developers with label words, similar questions and relevant code. To evaluate the effectiveness of RASOP, we decided to analyze our system by simulating an instance. By testing a problem encountered during development, the API and tags and other recommendations from the RASOP output can indeed solve our problem. RASOP shows great results not only in the effect of API recommendation but also in the content of practicability.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Brandt, J., Guo, P.J., Lewenstein, J., Dontcheva, M., Klemmer, S.R.: Two studies of opportunistic programming: interleaving web foraging, learning, and writing code. In: Proceedings SIGCHI, pp. 1589–1598 (2009)

    Google Scholar 

  2. McMillan, C., Grechanik, M., Poshyvanyk, D., Xie, Q., Fu, C.: Portfolio: finding relevant functions and their usage. In: Proceedings ICSE, pp. 111–120 (2011)

    Google Scholar 

  3. Kevic, K., Fritz, T.: Automatic search term identification for change tasks. In: Proceedings ICSE, pp. 468–471 (2014)

    Google Scholar 

  4. Chan, W.-K., Cheng, H., Lo, D.: Searching connected API subgraph via text phrases. In: Proceedings of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering, pp. 10:1–10:11. ACM (2012)

    Google Scholar 

  5. Rahman, M.M., Roy, C.K., Lo, D.: RACK: automatic API recommendation using crowdsourced knowledge. In: 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER), vol. 1, pp. 349–359. IEEE (2016)

    Google Scholar 

  6. Huang, Q., Xia, X., Xing, Z., Lo, D., Wang, X.: API method recommendation without worrying about the task-API knowledge gap. In: Proceedings of the 2018 33rd ACM/IEEE International Conference on Automated Software Engineering, ASE 2018, pp. 292–303 (2018)

    Google Scholar 

  7. Chan, W., Cheng, H., Lo, D.: Searching connected API subgraph via text phrases. In: Proceedings FSE, pp. 10:1–10:11 (2012)

    Google Scholar 

  8. Bajracharya, S.K., Lopes, C.V.: Analyzing and mining a code search engine usage log. Empirical Softw. 17(4–5), 424–466 (2012)

    Article  Google Scholar 

  9. Haiduc, S., Marcus, A.: On the effect of the query in IR-based concept location. In: Proceedings ICPC, pp. 234–237 (2012)

    Google Scholar 

  10. Mikolov, T., Sutskever, I., Chen, K., Corrado, G.S., Dean, J.: Distributed representations of words and phrases and their compositionality. In: Advances in Neural Information Processing Systems, pp. 3111–3119 (2013)

    Google Scholar 

  11. Ye, X., Shen, H., Ma, X., Bunescu, R., Liu, C.: From word embeddings to document similarities for improved information retrieval in software engineering. In: Proceedings of the 38th International Conference on Software Engineering, pp. 404–415. ACM (2016)

    Google Scholar 

  12. Treude, C., Robillard, M.P.: Augmenting API documentation with insights from stack overflow. In: 2016 IEEE/ACM 38th International Conference Software Engineering (ICSE), pp. 392–403. IEEE (2016)

    Google Scholar 

  13. https://github.com/laserwave/topic_models/tree/master/LSA-demo

  14. https://github.com/laserwave/lda_gibbs_sampling

  15. Bird, S., Loper, E.: NLTK: the natural language toolkit. In: Proceedings of the ACL 2004 on Interactive Poster and Demonstration Sessions, p. 31. Association for Computational Linguistics (2004)

    Google Scholar 

  16. Stopword List. https://code.google.com/p/stop-words

  17. Řehůřek, R., Sojka, P.: Software framework for topic modelling with large corpora. In: Proceedings of the LREC 2010 Workshop on New Challenges for NLP Frameworks, pp. 45–50 (2010)

    Google Scholar 

  18. Manning, C.D., Raghavan, P., Schütze, H.: Introduction to Information Retrieval. Cambridge University Press, Cambridge (2008)

    Book  Google Scholar 

  19. Thung, F., Wang, S., Lo, D., Lawall, J.: Automatic recommendation of API methods from feature requests. In: Proceedings ASE, pp. 290–300 (2013)

    Google Scholar 

  20. Yan, M., Zhang, X., Yang, D., Xu, L., Kymer, J.D.: A component recommender for bug reports using discriminative probability latent semantic analysis. Inf. Softw. Technol. 73, 37–51 (2016)

    Article  Google Scholar 

  21. Joulin, A., Grave, E., Bojanowski, P., et al.: FastText.zip: compressing text classification models. Under Review as a Conference Paper at ICLR, pp. 1–13 (2016)

    Google Scholar 

  22. Athiwaratkun, B., Wilson, A.G., Anandkumar, A.: Probabilistic FastText for multi-sense word embeddings (2018)

    Google Scholar 

  23. Regehr, J., Reid, A., Webb, K.: Eliminating stack overflow by abstract interpretation. ACM Trans. Embed. Comput. Syst. 4(4), 751–778 (2005)

    Article  Google Scholar 

  24. Vasilescu, B., Filkov, V., Serebrenik, A.: StackOverflow and GitHub: associations between software development and crowdsourced knowledge. In: 2013 International Conference on Social Computing, vol. 35, pp. 188–195. IEEE Computer Society (2013)

    Google Scholar 

Download references

Acknowledgements

This work is supported partially by Natural Science Foundation of China under Grants no. 61602267, partially by the Open Project of Key Laboratoriesm of Ministry of Industry and Information Technology for Software Development and Verification Technology of High Safety Systems at Nanjing University of Aeronautics and Astronautics under Grants no. NJ2018014, partially by Natural Science Foundation of Nantong University under Grants no. 15Z14.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Wanzhi Wen .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Zhang, B., Sheng, L., Jin, L., Wen, W. (2020). RASOP: An API Recommendation Method Based on Word Embedding Technology. In: Li, K., Li, W., Wang, H., Liu, Y. (eds) Artificial Intelligence Algorithms and Applications. ISICA 2019. Communications in Computer and Information Science, vol 1205. Springer, Singapore. https://doi.org/10.1007/978-981-15-5577-0_21

Download citation

  • DOI: https://doi.org/10.1007/978-981-15-5577-0_21

  • Published:

  • Publisher Name: Springer, Singapore

  • Print ISBN: 978-981-15-5576-3

  • Online ISBN: 978-981-15-5577-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics