A4: Automatically Assisting Android API Migrations Using Code Examples

12/12/2018
by   Maxime Lamothe, et al.
0

The fast-paced evolution of Android APIs has posed a challenging task for Android app developers. To leverage the newly and frequently released APIs from Android, developers often must spend considerable effort on API migrations. Prior research work and Android official documentation typically provide enough information to guide developers in identifying both the changed API calls that need to be migrated and the corresponding API calls in the new version of Android (what to migrate). However, the API migration task is still challenging since developers lack the knowledge of how to migrate the API calls. In addition to the official documentation, there exist code examples, such as Google Samples, that illustrate the usage of APIs. We posit that by analyzing the changes of API usage in code examples, we may be able to learn API migration patterns to assist developers with API migrations. In this paper, we propose an approach that automatically learns API migration patterns from code examples and applies these patterns to the source code of Android apps for API migration. To evaluate our approach, we migrate API calls in open source Android apps by learning API migration patterns from both public and manually generated code examples. We find that our approach can successfully learn API migration patterns and provide API migration assistance in 71 out of 80 cases. In particular, our approach can either automatically migrate API calls with little to no extra modifications needed or provide guidance to assist with the migrations. Our approach can be adopted by Android developers to reduce the effort they spend on regularly migrating Android APIs.

READ FULL TEXT
research
02/15/2021

Recommending API Function Calls and Code Snippets to Support Software Development

Software development activity has reached a high degree of complexity, g...
research
11/02/2017

TCPSnitch: Dissecting the Usage of the Socket API

Networked applications interact with the TCP/IP stack through the socket...
research
11/27/2021

Leveraging Unsupervised Learning to Summarize APIs Discussed in Stack Overflow

Automated source code summarization is a task that generates summarized ...
research
08/27/2020

M3: Semantic API Migrations

Library migration is a challenging problem, where most existing approach...
research
07/12/2019

Framework Code Samples: How Are They Maintained and Used by Developers?

Background: Modern software systems are commonly built on the top of fra...
research
05/27/2020

Automatic Android Deprecated-API Usage Update by Learning from Single Updated Example

Due to the deprecation of APIs in the Android operating system,developer...
research
05/24/2023

Gorilla: Large Language Model Connected with Massive APIs

Large Language Models (LLMs) have seen an impressive wave of advances re...

Please sign up or login with your details

Forgot password? Click here to reset