TY - JOUR
T1 - API recommendation for event-driven Android application development
AU - Yuan, Weizhao
AU - Nguyen, Hoang H.
AU - Jiang, Lingxiao
AU - Chen, Yuting
AU - Zhao, Jianjun
AU - Yu, Haibo
N1 - Funding Information:
This work was supported by the 973 Program in China (grant no. 2015CB352203), the Singapore Ministry of Education (MOE) Academic Research Fund (AcRF) Tier 1 Grant (fund no. C220/MSS16C003 ), and the National Natural Science Foundation of China (grant no. 61572312 ). We greatly appreciate the supports from our funding agencies and useful feedback from anonymous reviewers.
Publisher Copyright:
© 2018 Elsevier B.V.
PY - 2019/3
Y1 - 2019/3
N2 - Context: Software development is increasingly dependent on existing libraries. Developers need help to find suitable library APIs. Although many studies have been proposed to recommend relevant functional APIs that can be invoked for implementing a functionality, few studies have paid attention to an orthogonal need associated with event-driven programming frameworks, such as the Android framework. In addition to invoking functional APIs, Android developers need to know where to place functional code according to various events that may be triggered within the framework. Objective: This paper aims to develop an API recommendation engine for Android application development that can recommend both (1) functional APIs for implementing a functionality and (2) the event callback APIs that are to be overridden to contain the functional code. Method: We carry out an empirical study on actual Android programming questions from StackOverflow to confirm the need of recommending callbacks. Then we build Android-specific API databases to contain the correlations among various functionalities and APIs, based on customized parsing of code snippets and natural language processing of texts in Android tutorials and SDK documents, and then textual and code similarity metrics are adapted for recommending relevant APIs. Results: We have evaluated our prototype recommendation engine, named LibraryGuru, with about 1500 questions on Android programming from StackOverflow, and demonstrated that our top-5 results on recommending callbacks and functional APIs can on estimate achieve up to 43.5% and 50.9% respectively in precision, 24.6% and 32.5% respectively in mean average precision (MAP) scores, and 51.1% and 44.0% respectively in recall. Conclusion: We conclude that it is important and possible to recommend both functional APIs and callbacks for Android application development, and future work is needed to take more data sources into consideration to make more relevant recommendations for developers’ needs.
AB - Context: Software development is increasingly dependent on existing libraries. Developers need help to find suitable library APIs. Although many studies have been proposed to recommend relevant functional APIs that can be invoked for implementing a functionality, few studies have paid attention to an orthogonal need associated with event-driven programming frameworks, such as the Android framework. In addition to invoking functional APIs, Android developers need to know where to place functional code according to various events that may be triggered within the framework. Objective: This paper aims to develop an API recommendation engine for Android application development that can recommend both (1) functional APIs for implementing a functionality and (2) the event callback APIs that are to be overridden to contain the functional code. Method: We carry out an empirical study on actual Android programming questions from StackOverflow to confirm the need of recommending callbacks. Then we build Android-specific API databases to contain the correlations among various functionalities and APIs, based on customized parsing of code snippets and natural language processing of texts in Android tutorials and SDK documents, and then textual and code similarity metrics are adapted for recommending relevant APIs. Results: We have evaluated our prototype recommendation engine, named LibraryGuru, with about 1500 questions on Android programming from StackOverflow, and demonstrated that our top-5 results on recommending callbacks and functional APIs can on estimate achieve up to 43.5% and 50.9% respectively in precision, 24.6% and 32.5% respectively in mean average precision (MAP) scores, and 51.1% and 44.0% respectively in recall. Conclusion: We conclude that it is important and possible to recommend both functional APIs and callbacks for Android application development, and future work is needed to take more data sources into consideration to make more relevant recommendations for developers’ needs.
UR - http://www.scopus.com/inward/record.url?scp=85055413129&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85055413129&partnerID=8YFLogxK
U2 - 10.1016/j.infsof.2018.10.010
DO - 10.1016/j.infsof.2018.10.010
M3 - Article
AN - SCOPUS:85055413129
SN - 0950-5849
VL - 107
SP - 30
EP - 47
JO - Information and Software Technology
JF - Information and Software Technology
ER -