Learning API Usages from Bytecode: A Statistical Approach

By Tam The Nguyen, Hung Viet Pham, Phong Minh Vu, Tung Thanh Nguyen. 2015

80 citations recorded by the source corpus.

Mobile app developers rely heavily on standard API frameworks and libraries. However, learning API usages is often challenging due to the fast-changing nature of API frameworks for mobile systems and the insufficiency of API documentation and 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 HAPI, a statistical model of API usages and three algorithms to extract method call sequences from apps’ bytecode, to train HAPI based on those sequences, and to recommend method calls in code completion using the trained HAPIs. Our empirical evaluation shows that our prototype tool can effectively learn API usages from 200 thousand apps containing 350 million method sequences. It recommends next method calls with top-3 accuracy of 90% and outperforms baseline approaches on average 10-20%.

Subfields: Information Systems, Code Generation & Program Synthesis, Program Analysis & Verification, Signal Processing

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Information Systems

  1. Bogdan Vasilescu
  2. Casey Casalnuovo
  3. Premkumar T. Devanbu
  4. Miltiadis Allamanis
  5. Michael Pradel
  6. Charles Sutton
  7. Earl T. Barr
  8. Koushik Sen

In Code Generation & Program Synthesis

  1. Bogdan Vasilescu
  2. Casey Casalnuovo
  3. Premkumar T. Devanbu
  4. Charles Sutton
  5. Miltiadis Allamanis
  6. Tien Nhut Nguyen
  7. Anh Tuan Nguyen
  8. Earl T. Barr

In Program Analysis & Verification

  1. Bogdan Vasilescu
  2. Premkumar T. Devanbu
  3. Casey Casalnuovo
  4. Michael Pradel
  5. Koushik Sen
  6. Miltiadis Allamanis
  7. Earl T. Barr
  8. Charles Sutton

In Signal Processing

  1. Premkumar T. Devanbu
  2. Bogdan Vasilescu
  3. Casey Casalnuovo
  4. Jan Jürjens

Citations in the corpus