Learning API Usages from Bytecode: A Statistical Approach
Tam The Nguyen, Hung Viet Pham, Phong Minh Vu, Tung Thanh Nguyen

TL;DR
This paper introduces a novel statistical approach to learn API usage patterns from Android bytecode, enabling more accurate code completion and understanding of API behaviors despite documentation and source code limitations.
Contribution
It presents ARUS, a graph-based API usage representation, and HAPI, a generative model trained on bytecode-derived method call sequences, with algorithms for extraction and recommendation.
Findings
HAPI outperforms baseline n-gram models in API usage recommendation accuracy.
The approach effectively models complex API usage scenarios from bytecode.
Empirical results demonstrate improved API usage understanding for mobile app development.
Abstract
When developing mobile apps, programmers rely heavily on standard API frameworks and libraries. However, learning and using those APIs is often challenging due to the fast-changing nature of API frameworks for mobile systems, the complexity of API usages, the insufficiency of documentation, and the unavailability of source code examples. In this paper, we propose a novel approach to learn API usages from bytecode of Android mobile apps. Our core contributions include: i) ARUS, a graph-based representation of API usage scenarios; ii) HAPI, a statistical, generative model of API usages; and iii) three algorithms to extract ARUS from apps' bytecode, to train HAPI based on method call sequences extracted from ARUS, and to recommend method calls in code completion engines using the trained HAPI. Our empirical evaluation suggests that our approach can learn useful API usage models which can…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Web Data Mining and Analysis · Advanced Malware Detection Techniques
