Siri, Write the Next Method
Fengcai Wen, Emad Aghajani, Csaba Nagy, Michele Lanza, Gabriele Bavota
Abstract
Code completion is one of the killer features of Integrated Development Environments (IDEs), and researchers have proposed different methods to improve its accuracy. While these techniques are valuable to speed up code writing, they are limited to recommendations related to the next few tokens a developer is likely to type given the current context. In the best case, they can recommend a few APIs that a developer is likely to use next. We present FeaRS, a novel retrieval-based approach that, given the current code a developer is writing in the IDE, can recommend the next complete method (i.e., signature and method body) that the developer is likely to implement. To do this, FeaRS exploits "implementation patterns" (i.e., groups of methods usually implemented within the same task) learned by mining thousands of open source projects. We instantiated our approach to the specific context of Android apps. A large-scale empirical evaluation we performed across more than 20k apps shows encouraging preliminary results, but also highlights future challenges to overcome.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext f540f438-6b9e-4793-a6ee-d5ffe534569bCited by top-tier papers6
- On the Robustness of Code Generation Techniques: An Empirical Study on GitHub CopilotAntonio Mastropaolo, Luca Pascarella, Emanuela Guglielmi, Matteo Ciniselli et al.ICSE 2023 · 124 citations
- CodeFill: Multi-token Code Completion by Jointly learning from Structure and Naming SequencesMaliheh Izadi, Roberta Gismondi, Georgios GousiosICSE 2022 · 79 citations
- Two Birds with One Stone: Boosting Code Generation and Code Search via a Generative Adversarial NetworkShangwen Wang, Bo Lin, Zhensu Sun, Ming Wen et al.OOPSLA 2023 · 21 citations
- RLCoder: Reinforcement Learning for Repository-Level Code CompletionYanlin Wang, Yanli Wang, Daya Guo, Jiachi Chen et al.ICSE 2025 · 13 citations
- Source Code Recommender Systems: The Practitioners' PerspectiveMatteo Ciniselli, Luca Pascarella, Emad Aghajani, Simone Scalabrino et al.ICSE 2023 · 6 citations
Related papers
- DroidCoder: Enhanced Android Code Completion with Context-Enriched Retrieval-Augmented GenerationXinran Yu, Chun Li, Minxue Pan, Xuandong LiASE 2024 · 1 citation
- API method recommendation via explicit matching of functionality verb phrasesWenkai Xie, Xin Peng, Mingwei Liu, Christoph Treude et al.FSE 2020 · 33 citations
- Code Search is All You Need? Improving Code Suggestions with Code SearchJunkai Chen, Xing Hu, Zhenhao Li, Cuiyun Gao et al.ICSE 2024 · 31 citations
- Code Completion by Modeling Flattened Abstract Syntax Trees as GraphsYanlin Wang, Hui LiAAAI 2021 · 96 citations
- Overwatch: learning patterns in code edit sequencesYuhao Zhang, Yasharth Bajpai, Priyanshu Gupta, Ameya Ketkar et al.OOPSLA 2022 · 15 citations
