APIM IGRATOR : An API-Usage Migration Tool for Android Apps Mattia - - PowerPoint PPT Presentation

apim igrator an api usage migration tool for android apps
SMART_READER_LITE
LIVE PREVIEW

APIM IGRATOR : An API-Usage Migration Tool for Android Apps Mattia - - PowerPoint PPT Presentation

APIM IGRATOR : An API-Usage Migration Tool for Android Apps Mattia Fazzini Qi Xin Alessandro Orso Mobile Applications Platform Platform Tight Coupling Platforms Change Platforms Change Frequently Android Petit Four Cupcake Donut 1.1


slide-1
SLIDE 1

APIMIGRATOR: An API-Usage Migration Tool for Android Apps

Mattia Fazzini Qi Xin Alessandro Orso

slide-2
SLIDE 2

Mobile Applications

slide-3
SLIDE 3

Platform

slide-4
SLIDE 4

Platform

Tight Coupling

slide-5
SLIDE 5

Platforms Change

slide-6
SLIDE 6

Platforms Change Frequently

Android Eclair Ice Cream Marshmallow Donut Petit Four Cupcake Honeycomb Froyo Gingerbread Lollipop Jelly Bean KitKat Pie Nougat Oreo

1.1

Android 10

slide-7
SLIDE 7

App

Developer

Adaptive Maintenance

Platform

App

New Platform

slide-8
SLIDE 8

Platform Fragmentation

Android 10 Ice Cream Jelly Bean KitKat Lollipop Marshmallow Oreo Pie Nougat

slide-9
SLIDE 9

App C

Developer C

App B

Developer B

App A

Intuition

Developer A

slide-10
SLIDE 10

App C

Developer C

App B

Developer B

App A

Intuition

Developer A

slide-11
SLIDE 11

App C

Developer C

App B

Developer B

App A

Intuition

Developer A

slide-12
SLIDE 12

API-Usage Migrations

API-Usage Changes

public NetworkInfo[] getAllNetworkInfo()

public Network[] getAllNetworks()

New API Usage

public NetworkInfo getNetworkInfo(Network network) public NetworkInfo[] getAllNetworkInfo()

Old API Usage

slide-13
SLIDE 13

API Updates

API-Usage Changes

public NetworkInfo[] getAllNetworkInfo()

public Network[] getAllNetworks()

New API Usage

public NetworkInfo getNetworkInfo(Network network) public NetworkInfo[] getAllNetworkInfo()

Old API Usage

slide-14
SLIDE 14

API Updates

API-Usage Changes

public NetworkInfo[] getAllNetworkInfo()

public Network[] getAllNetworks()

New API Usage

public NetworkInfo getNetworkInfo(Network network) public NetworkInfo[] getAllNetworkInfo()

Old API Usage

slide-15
SLIDE 15

Migration Example

Migration Example Before Migration Example After

public boolean isConnected(Context cont) { ConnectivityManager cm = ...; NetworkInfo[] info = cm.getAllNetworkInfo(); for (int i = 0; i < info.length; i++) { if(info[i].isConnected()) { return true; } } Toast.makeText(R.s.noNet).show(); return false; } public boolean isConnected(Context cont) { ConnectivityManager cm = ... ; if (VERSION.SDK_INT >= VERSION_CODES.M) { Network[] networks = cm.getAllNetworks(); for (Network mNetwork : networks) { NetworkInfo networkInfo = cm.getNetworkInfo(mNetwork); if(networkInfo.isConnected()) { Log.d(networkInfo.getTypeName()); return true; } } } else { NetworkInfo[] info = cm.getAllNetworkInfo(); for (NetworkInfo anInfo : info) { if(anInfo.isConnected()) { Log.d(anInfo.getTypeName()); return true; } } } Toast.makeText(cont.getString(...)).show(); return false; }

slide-16
SLIDE 16

public boolean isConnected(Context cont) { ConnectivityManager cm = ...; NetworkInfo[] info = cm.getAllNetworkInfo(); for (int i = 0; i < info.length; i++) { if(info[i].isConnected()) { return true; } } Toast.makeText(R.s.noNet).show(); return false; } public boolean isConnected(Context cont) { ConnectivityManager cm = ... ; if (VERSION.SDK_INT >= VERSION_CODES.M) { Network[] networks = cm.getAllNetworks(); for (Network mNetwork : networks) { NetworkInfo networkInfo = cm.getNetworkInfo(mNetwork); if(networkInfo.isConnected()) { Log.d(networkInfo.getTypeName()); return true; } } } else { NetworkInfo[] info = cm.getAllNetworkInfo(); for (NetworkInfo anInfo : info) { if(anInfo.isConnected()) { Log.d(anInfo.getTypeName()); return true; } } } Toast.makeText(cont.getString(...)).show(); return false; }

Migration Example

Migration Example Before Migration Example After

slide-17
SLIDE 17

public boolean isConnected(Context cont) { ConnectivityManager cm = ... ; if (VERSION.SDK_INT >= VERSION_CODES.M) { Network[] networks = cm.getAllNetworks(); for (Network mNetwork : networks) { NetworkInfo networkInfo = cm.getNetworkInfo(mNetwork); if(networkInfo.isConnected()) { Log.d(networkInfo.getTypeName()); return true; } } } else { NetworkInfo[] info = cm.getAllNetworkInfo(); for (NetworkInfo anInfo : info) { if(anInfo.isConnected()) { Log.d(anInfo.getTypeName()); return true; } } } Toast.makeText(cont.getString(...)).show(); return false; } public boolean isConnected(Context cont) { ConnectivityManager cm = ...; NetworkInfo[] info = cm.getAllNetworkInfo(); for (NetworkInfo anInfo : info) { if(info[i].isConnected()) { return true; } } Toast.makeText(R.s.noNet).show(); return false; }

Migration Example

Migration Example Before Migration Example After

slide-18
SLIDE 18

APIMIGRATOR Overview

Identify API usages requiring migration in target app

Find migration examples for identified API usages Abstract migration examples into generic migration patches and rank them Migrate and validate API usages in target app based on patches

API-Usage Analysis Migration Examples Search Update Examples Analysis API-Usage Migration

Migration Examples Generic Migration Patches API-Usage Migration Report

slide-19
SLIDE 19

APIMIGRATOR Overview

Identify API usages requiring migration in target app

Find migration examples for identified API usages Abstract migration examples into generic migration patches and rank them Migrate and validate API usages in target app based on patches

API-Usage Analysis Migration Examples Search Update Examples Analysis API-Usage Migration

Migration Examples Generic Migration Patches API-Usage Migration Report

slide-20
SLIDE 20

APIMIGRATOR Overview

Identify API usages requiring migration in target app

Find migration examples for identified API usages Abstract migration examples into generic migration patches and rank them Migrate and validate API usages in target app based on patches

API-Usage Analysis Migration Examples Search Update Examples Analysis API-Usage Migration

Migration Examples Generic Migration Patches API-Usage Migration Report

slide-21
SLIDE 21

APIMIGRATOR Overview

Identify API usages requiring migration in target app

Find migration examples for identified API usages Abstract migration examples into generic migration patches and rank them Migrate and validate API usages in target app based on patches

API-Usage Analysis Migration Examples Search Update Examples Analysis API-Usage Migration

Migration Examples Generic Migration Patches API-Usage Migration Report

slide-22
SLIDE 22

APIMIGRATOR Overview

Identify API usages requiring migration in target app

Find migration examples for identified API usages Abstract migration examples into generic migration patches and rank them Migrate and validate API usages in target app based on patches

API-Usage Analysis Migration Examples Search Update Examples Analysis API-Usage Migration

Migration Examples Generic Migration Patches API-Usage Migration Report

slide-23
SLIDE 23
slide-24
SLIDE 24
slide-25
SLIDE 25

Empirical Evaluation

RQ2 (EFFICIENCY): What is the cost of running APIMIGRATOR?

Research Questions

RQ1 (EFFECTIVENESS): Can APIMIGRATOR migrate API usages in real-world apps? RQ2 (EFFICIENCY): What is the cost of running APIMIGRATOR?

slide-26
SLIDE 26

Evaluation

RQ1 (EFFECTIVENESS): Can APIMIGRATOR migrate API usages in real-world apps?

  • 37/41 (90%) successful update rate (for API-usage occurrences)
  • 25/37 (68%) automatic validation rate (for API-usage occurrences)
  • 17/20 (85%) successful update rate (for API usages)

APPEVOLVE is effective in automatically updating API usages.

RQ2 (EFFICIENCY): What is the cost of running APIMIGRATOR?

API-Usage Analysis Update Examples Search Update Examples Analysis API-Usage Update 28s 10h27m 2s204ms 20s The cost of the update examples search phase dominates the cost of the other phases.

Average Execution Time

slide-27
SLIDE 27

Summary

slide-28
SLIDE 28

Summary

https://zenodo.org/record/3668385

APIMIGRATOR VM