Computer Science ›› 2021, Vol. 48 ›› Issue (12): 100-106.doi: 10.11896/jsjkx.201000127

• Computer Software • Previous Articles     Next Articles

Context-aware Based API Personalized Recommendation

CHEN Chen1, ZHOU Yu1,2, WANG Yong-chao1, HUANG Zhi-qiu1,2   

  1. 1 School of Computer Science and Engineering,Nanjing University of Aeronautics and Astronautics,Nanjing 211100,China
    2 Key Laboratory of Safety-Critical Software,Ministry of Industry and Information Technology,Nanjing University of Aeronautics and Astronautics,Nanjing 211100,China
  • Received:2020-10-22 Revised:2021-03-12 Online:2021-12-15 Published:2021-11-26
  • About author:CHEN Chen,born in 1995,postgra-duate.His main research interests include software evolution analysis,artificial intelligence,and mining software repositories.
    ZHOU Yu,born in 1981,Ph.D,professor.His main research interests mainly include software evolution analysis,mining software repositories,software architecture,and reliability analysis.
  • Supported by:
    National Key R & D Program of China(2018YFB1003900),National Natural Science Foundation of China(61972197),Natural Science Foundation of Jiangsu Province,China(BK20201292),Qing-Lan Project of Jiangsu Province and Foundation of Gra-duate Innovation Center in NUAA(kfjj20191606).

Abstract: In the process of software development,developers often search for appropriate APIs to complete programming tasks when encountering programming difficulties.Contextual information and developer portraits play a critical role in effective API recommendation,but they are largely overlooked.This paper proposes a novel context-aware based API personalized recommendation approach.This approach leverages program static analysis technology (abstract syntax tree) to parse the code file to extract information to construct the code base and model developer API usage preferences.Then it calculates the semantic simila-rity between the developer's current query and the queries in the historical code base,and retrieves top-k similar historical queries.Finally,it leverages the information of query,method name,context and developer API usage preference to re-rank the candidate APIs and recommend to developers.MRR,MAP,Hit and NDCG are used to verify the effectiveness of the method in dif-ferent stages of simulation programming.The experimental results show that the proposed approach outperforms the baseline me-thod and it is more likely to recommend the APIs that developers want.

Key words: API recommendation, Context awareness, Developer portraits, Program static analysis

CLC Number: 

  • TP391
[1]RAHMAN M M,ROY C K,LO D.Rack:Automatic api recommendation using crowdsourced knowledge[C]//Proceedings of the 2016 IEEE 23rd International Conference on Software Ana-lysis,Evolution,and Reengineering (SANER).IEEE,2016:349-359.
[2]LV F,ZHANG H,LOU J G,et al.Codehow:Effective code search based on api understanding and extended boolean model (e)[C]//Proceedings of the 2015 30th IEEE/ACM Internatio-nal Conference on Automated Software Engineering (ASE).IEEE,2015:260-270.
[3]THUNG F,WANG S,LO D,et al.Automatic recommendation of API methods from feature requests[C]//Proceedings of the 2013 28th IEEE/ACM International Conference on Automated Software Engineering (ASE).IEEE,2013:290-300.
[4]CAI L,WANG H,HUANG Q,et al.BIKER:a tool for Bi-information source based API method recommendation[C]//Procee-dings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering.2019:1075-1079.
[5]AI L,HUANG Z,LI W,et al.Sensory:Leveraging code statement sequence information for code snippets recommendation[C]//Proceedings of the 2019 IEEE 43rd Annual Computer Software and Applications Conference (COMPSAC).IEEE,2019:27-36.
[6]CHAN W K,CHENG H,LO D.Searching connected API sub- graph via text phrases[C]//Proceedings of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering.2012:1-11.
[7]NGUYEN A T,NGUYEN T N.Graph-based statistical lan- guage model for code[C]//Proceedings of the 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.IEEE,2015:858-868.
[8]HAIDUC S,BAVOTA G,MARCUS A,et al.Automatic query reformulations for text retrieval in software engineering[C]//Proceedings of the 2013 35th International Conference on Software Engineering (ICSE).IEEE,2013:842-851.
[9]MCMILLAN C,GRECHANIK M,POSHYVANYK D,et al. Exemplar:A source code search engine for finding highly relevant applications[J].Proceedings of the IEEE Transactions on Software Engineering,2012,38(5):1069-1087.
[10]BAJRACHARYA S K,OSSHER J,LOPES C V.Leveraging usage similarity for effective retrieval of examples in code repo-sitories[C]//Proceedings of the Eighteenth ACM SIGSOFT International Symposium on Foundations of Software Enginee-ring.2010:157-166.
[11]YE X,BUNESCU R,LIU C.Learning to rank relevant files for bug reports using domain knowledge[C]//Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering.2014:689-699.
[12]PONZANELLI L,BAVOTA G,DI PENTA M,et al.Mining Stack Overflow to turn the IDE into a self-confident programming prompter[C]//Proceedings of the 11th Working Confe-rence on Mining Software Repositories.2014:102-111.
[13]PONZANELLI L,SCALABRINO S,BAVOTA G,et al.Sup- porting software developers with a holistic recommender system[C]//Proceedings of the 2017 IEEE/ACM 39th International Conference on Software Engineering (ICSE).IEEE,2017:94-105.
[14]TREUDE C,ROBILLARD M P.Augmenting api documentation with insights from stack overflow[C]//Proceedings of the 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).IEEE,2016:392-403.
[15]ZHANG J,JIANG H,REN Z,et al.Recommending apis for api related questions in stack overflow[C]//Proceedings of the 2018 IEEE Access.2018,6:6205-6219.
[16]ZHOU Y,YANG X,CHEN T,et al. Boosting API Recommendation with Implicit Feedback[C]//Proceedings of the IEEE Transactions on Software Engineering.2021.
[17]BAEZA-YATES R,RIBEIRO-NETO B.Modern information retrieval[C]//Proceedings of the ACM Press/Addison-Wesley.1999:463.
[18]VILLARROEL L,BAVOTA G,RUSSO B,et al.Release planning of mobile apps based on user reviews[C]//Proceedings of the 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).IEEE,2016:14-24.
[19]YANG W,PAN M,ZHOU Y,et al.Developer Portraying:A Quick Approach to Understanding Developers on OSS Platforms[J].Proceedings of the Inf.Softw.Technol.,2020,125:106336.
[20]NGUYEN P T,DI ROCCO J,DI RUSCIO D,et al.Focus:A recommender system for mining api function calls and usage patterns[C]//Proceedings of the 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE).IEEE,2019:1050-1060.
[21]LAM A N,NGUYEN A T,NGUYEN H A,et al.Combining deep learning with information retrieval to localize buggy files for bug reports (n)[C]//Proceedings of the 2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE).IEEE,2015:476-481.
[22]AVAZPOUR I,PITAKRAT T,GRUNSKE L,et al.Dimensions and metrics for evaluating recommendation systems[C]//Proceedings of the Recommendation Systems in Software Enginee-ring.Springer,2014:245-273.
[23]YE X,SHEN H,MA X,et al.From word embeddings to document similarities for improved information retrieval in software engineering[C]//Proceedings of the 38th International Confe-rence on Software Engineering.2016:404-415.
[24]ZHOU J,ZHANG H,LO D.Where should the bugs be fixed? more accurate information retrieval-based bug localization based on bug reports[C]//Proceedings of the 2012 34th International Conference on Software Engineering (ICSE).IEEE,2012:14-24.
[25]GU X,ZHANG H,ZHANG D,et al.Deep API learning[C]//Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering.2016:631-642.
[1] LI Jian-jun, HOU Yue, YANG Yu. User Interest Recommendation Model Based on Context Awareness [J]. Computer Science, 2019, 46(6A): 502-506.
[2] ZHANG Hong-li, BAI Xiang-yu, LI Gai-mei. Personalized Recommendation Algorithm Based on Recent Neighborhood Recommendation and Combined with Context Awareness [J]. Computer Science, 2019, 46(4): 235-240.
[3] NIE Li-ming, JIANG He, GAO Guo-jun, WANG Han and XU Xiu-juan. Bibliographic Analysis for Code/API Recommendation Literatures [J]. Computer Science, 2017, 44(Z6): 475-482.
[4] GUO Bin, CHEN Hui-hui, LI Wen-peng, YU Zhi-wen, JIANG Jia-jun and WANG Wen-hui. Memory Computing:Concept,Characteristics and Research Advances [J]. Computer Science, 2016, 43(9): 32-38.
[5] WANG Zhen-dong,WANG Hui-qiang,FENG Guang-sheng,LV Hong-wu and CHEN Xiao-ming. Research on Autonomic Computing System and its Key Technologies [J]. Computer Science, 2013, 40(7): 15-18.
[6] . Situation-driven Framework for Context-aware Computing [J]. Computer Science, 2012, 39(3): 216-222.
[7] YU Zhao -An, ZHANG Shen -Sheng ,ZHANG-Yong ,TONG Hong-Xia (Dept of Computer Science & Engineering, Shanghai Jiaotong University, Shanghai 200030). [J]. Computer Science, 2006, 33(6): 192-194.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!