API Recommendation for Novice Programmers: From Clear Expressions to Effective Results
Abstract
API recommendation systems for novice programmers should prioritize usability and inspiration rather than merely pursuing the “best result”. Existing retrieval-based approaches, whether relying on direct similarity matching or using query expansion to generate clarification options, still cannot recover missing task semantics and often introduce additional ambiguity and interaction overhead. Learning-based methods, including neural architectures and recent LLM-driven techniques, require substantial data or strong prompt dependence and provide limited transparency, making it difficult to align model outputs with novice programmers' actual intent. To address these limitations, we propose IOCAPI (Intention-Oriented andContext-AwareAPIRecommendation), a reasoning-driven framework that integrates LLMs, LCMs, and in-context learning. It mainly contains three components: (1) Intent Detector, which refines the query and derives task semantics through model-generated I/O exemplars; (2) Code Generator, which produces representative code snippets under the confirmed I/O constraints; and (3) Task Bridger, which consolidates the results into actionable API recommendations with interpretable code examples. Evaluations on three public datasets show that IOCAPI attains a 35.7% BLEU improvement over APIGen and an 11.1% MRR gain over CLEAR, and achieves higher MAP scores than GPT-4 zero-shot, few-shot, and chain-of-thought baselines by 102%, 11.2%, and 21.8%, respectively. A controlled user study involving seven real programming tasks further provides empirical observations of IOCAPI's behavior in practice. Compared with KAHAID, IOCAPI obtained higher average scores in Correctness (1.67 vs. 1.00), Usability (1.76 vs. 0.40), and Inspiration (1.40 vs. 0.26).
Fields of Study & Subjects
Software Engineering Research
Recommender Systems and Techniques
Information Retrieval and Search Behavior
Publication details
- Journal / source
- IEEE Transactions on Reliability
- Volume
- 75
- Pages
- 991–1005
- Publication date
- 1 January 2026
- Language
- EN