Publication Type
Conference Proceeding Article
Version
publishedVersion
Publication Date
11-2022
Abstract
Developers spend a lot of time online, searching for code to help them implement their desired features. While code recommenders help improve developers’ productivity, there is currently no support for context-aware code recommendation for opportunistic code reuse on-the-go. Typical code recommendation systems provide recommendations against a search query, whereas a code recommender that supports opportunistic reuse can recommend related code snippets that represent features that the developer may want to implement next. In this paper, we present a novel Context-aware Feature-driven API usage-based Code Recommender (CA-FACER) tool, which is an Intellij IDEA plugin that leverages a developer’s development context to recommend related code snippets. We consider the methods having API usages in a developer’s active project as part of the development context. Our approach uses contextual data from a developer’s active project to find similar projects and recommends code from popular features of those projects. The popular features are identified as frequently occurring API usage based Method Clone Classes. From our experimental evaluation on 120 Android Java projects from GitHub, we observe a 46% improvement of precision using our proposed context-aware approach over a baseline system. Our technique recommends related code examples with an average precision (P@5) of 94% and 83% and a success rate of 90% and 95% for initial and evolved development stages respectively. A video demonstration of our tool is available at https://youtu.be/UjuM8WRc318.
Keywords
API Usage, Code Recommendation, Code Reuse, Context-aware, Method Clone Structures, Software Features
Discipline
Artificial Intelligence and Robotics | Software Engineering
Publication
ESEC/FSE 2022: Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering, Singapore, November 14-18
First Page
1647
Last Page
1651
ISBN
9781450394130
Identifier
10.1145/3540250.3558937
Publisher
ACM
City or Country
New York
Citation
ABID, Shamsa; BASIT, Hamid Abdul; and SHAMAIL, Shafay.
Context-aware code recommendation in Intellij IDEA. (2022). ESEC/FSE 2022: Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering, Singapore, November 14-18. 1647-1651.
Available at: https://ink.library.smu.edu.sg/sis_research/11156
Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-No Derivative Works 4.0 International License.
Additional URL
https://doi.org/10.1145/3540250.3558937
Comments
Cited by: 4