SlideShare une entreprise Scribd logo
1  sur  105
Télécharger pour lire hors ligne
Taming Android Fragmentation:
Characterizing and Detecting Compatibility
Issues for Android Apps
Lili Wei Yepang Liu
This
image
canno
t
curre
S.C. Cheung
The Hong Kong University of Science and Technology
05 September 2016
Android: Popular and Fast-Evolving System
• Fast-evolving: multiple releases every year
2
Android: Popular and Fast-Evolving System
• Fast-evolving: multiple releases every year
• Many different system versions in use:
2
KitKat
Lollipop
Jelly Bean
Ice Cream Sandwich
Gingerbread
Froyo
Marshmallow
https://developer.android.com/about/dashboards/index.html
3
Huge Number of Device Models
Over 24,000 distinct device models
(Aug. 2014 – Aug.2015)
http://opensignal.com/reports/2015/08/android-fragmentation/ 4
Fragmented Android Ecosystem
5
Fragmented Android Ecosystem
5
Fragmented Android Ecosystem
5
Ensuring App Compatibility Is Difficult
• App developers have
to optimize UI of their
apps to fit diversified
screen sizes
6
Ensuring App Compatibility is Difficult
• App developers have
to optimize UI of their
apps to fit diversified
screen sizes
• An app behaves
differently across
devices
6http://gameovenstudios.com/bounden-on-android-delayed/
Ensuring App Compatibility is Difficult
• App developers have
to optimize UI of their
apps to fit diversified
screen sizes
• An app behaves
differently across
devices
6
Fragmentation-induced compatibility issues
http://gameovenstudios.com/bounden-on-android-delayed/
Testing Compatibility Issues
• To fully test compatibility issues is difficult with
huge search space
• Combination of three dimensions
7
Testing Compatibility Issues
• To fully test compatibility issues is difficult with
huge search space
• Combination of three dimensions
7
Device Model
Testing Compatibility Issues
• To fully test compatibility issues is difficult with
huge search space
• Combination of three dimensions
7
APILevel
Device Model
Testing Compatibility Issues
• To fully test compatibility issues is difficult with
huge search space
• Combination of three dimensions
7
APILevel
Device Model
APILevel
Device Model
Testing Compatibility Issues
• To fully test compatibility issues is difficult with
huge search space
• Combination of three dimensions
7
Existing Work
• Understanding Android fragmentation
• D. Han et al. [WCRE’ 2012]
• T. McDonnell et al. [ICSM’ 2013]
• Prioritize devices to test on:
• H. Khalid et al. [FSE’ 2014]
• X. Lu et al. [ICSE’ 2016]
8
Existing Work
8
None of the existing studies dug into the code level:
• To understand compatibility issues
• To detect compatibility issues
• Understanding Android fragmentation
• D. Han et al. [WCRE’ 2012]
• T. McDonnell et al. [ICSM’ 2013]
• Prioritize devices to test on:
• H. Khalid et al. [FSE’ 2014]
• X. Lu et al. [ICSE’ 2016]
Our Goal
Understand compatibility
issues at code level
9
Our Goal
Understand compatibility
issues at code level
Detect compatibility
issues
9
Research Questions
• RQ1: Issue type and root cause
• What are the common types of compatibility issues
in Android apps? What are their root causes?
9
Research Questions
• RQ1: Issue type and root cause
• What are the common types of compatibility issues
in Android apps? What are their root causes?
• RQ2: Issue fixing
• How do Android developers fix compatibility issues
in practice? Are there any common patterns?
9
Dataset Collection
27 popular, large-scale, well-maintained candidate
apps, which have public issue tracking systems
10
Dataset Collection
27 popular, large-scale, well-maintained candidate
apps, which have public issue tracking systems
10
Apps satisfying these criterion are:
• More likely to be affected by different kinds of
compatibility issues
• With traceable issue fix and discussions to study
Keyword Search
device compatible compatibility samsung
lge sony moto lenovo
asus zte google htc
huawei xiaomi android.os.build
11
VLC r-8e31d57:
Blind fix for mountpoint issues with some Samsung devices
if(line.contains("vfat") || line.contains("exfat") ||
- line.contains("/mnt") || line.contains("/Removable")) {
+ line.contains("sdcardfs") || line.contains("/mnt") ||
+ line.contains("/Removable")) {
Keyword Search
device compatible compatibility samsung
lge sony moto lenovo
asus zte google htc
huawei xiaomi android.os.build
11
VLC r-8e31d57:
Blind fix for mountpoint issues with some Samsung devices
if(line.contains("vfat") || line.contains("exfat") ||
- line.contains("/mnt") || line.contains("/Removable")) {
+ line.contains("sdcardfs") || line.contains("/mnt") ||
+ line.contains("/Removable")) {
Keyword Search
device compatible compatibility samsung
lge sony moto lenovo
asus zte google htc
huawei xiaomi android.os.build
11
CSipSimple r-af0ceea:
Fixes issue 498.
+ //HTC evo 4G
+ if(android.os.Build.PRODUCT.equalsIgnoreCase("htc_supersonic"))
+ return true;
Dataset Collection
12
27 popular, large-scale, well-maintained candidate
apps, which have public issue tracking systems
All 27 apps contain potential revisions related to
compatibility issues
Dataset Collection
Five apps with top number of potential issue-related code
revisions
12
27 popular, large-scale, well-maintained candidate
apps, which have public issue tracking systems
Dataset Collection
Five apps with top number of potential issue-related code
revisions
12
Over 1800 code revisions found in the five apps need to
be manually inspected
27 popular, large-scale, well-maintained candidate
apps, which have public issue tracking systems
Dataset Collection
191 compatibility issues
Five apps with top number of potential issue-related code
revisions (>1800 revisions)
12
27 popular, large-scale, well-maintained candidate
apps, which have public issue tracking systems
Selected Apps
App Name Category Rating Downloads KLOC #Revisions
CSipSimple Communication 4.3/5.0 1M - 5M 59.2 1,778
AnkiDroid Education 4.5/5.0 1M - 5M 58.1 8,282
K-9 Mail Communication 4.3/5.0 5M - 10M 86.7 6,116
VLC Media & Video 4.3/5.0 10M - 50M 28.3 6,868
AnySoftKeyboard Tools 4.3/5.0 1M - 5M 70.7 2,788
13
Data Analysis
API
Identified the
issue-inducing
APIs
14
Data Analysis
API
Identified the
issue-inducing
APIs
Recovered links
between revisions
and reports
14
Data Analysis
API
Identified the
issue-inducing
APIs
Recovered links
between revisions
and reports
Collected related
discussions from
online forums
14
RQ1: Issue Type and Root Cause
15
RQ1: Issue Type and Root Cause
15
59%41%
Device-specific issues
Can only be triggered on
certain device models
Non-device-specific issues
Can be triggered under
certain API level
Device-Specific Issue
16
Device-specific
Issue
59%
Driver
Implementation
29%
OS Customization
19%
Hardware Composition
11%
Device-Specific Issues
• Problematic driver implementation
• Different driver implementation can cause
inconsistent app behavior across devices.
17
Device-Specific Issues
• Problematic driver implementation
• Different driver implementation can cause
inconsistent app behavior across devices.
• OS customization
• Manufacturer-customized systems may not fully
comply with the official specifications and thus
cause compatibility issues
17
Device-Specific Issues
• Problematic driver implementation
• Different driver implementation can cause
inconsistent app behavior across devices.
• OS customization
• Manufacturer-customized systems may not fully
comply with the official specifications and thus
cause compatibility issues
• Hardware composition
• Diversified hardware composition of different device
models can cause compatibility issues
17
Device-Specific Issues
• Problematic driver implementation
• Different driver implementation can cause
inconsistent app behavior across devices.
Proximity sensor: Report the distance
between device and its surrounding object
18
Device-Specific Issues
19
CSipSimple:
An Android client app for internet calls
Proximity sensor in CSipSimple:
Used to detect the distance between user’s face and the
device.
Device-Specific Issues
19
Near
CSipSimple:
An Android client app for internet calls
Proximity sensor in CSipSimple:
Used to detect the distance between user’s face and the
device.
Device-Specific Issues
CSipSimple issue 353:
Samsung SPH-M900’s proximity sensor API reports a value
inversely proportional to the real distance
19
CSipSimple:
An Android client app for internet calls
Proximity sensor in CSipSimple:
Used to detect the distance between user’s face and the
device.
Device-Specific Issues
CSipSimple issue 353:
Samsung SPH-M900’s proximity sensor API reports a value
inversely proportional to the real distance
19
CSipSimple:
An Android client app for internet calls
Proximity sensor in CSipSimple:
Used to detect the distance between user’s face and the
device.
Device-Specific Issues
CSipSimple issue 353:
Samsung SPH-M900’s proximity sensor API reports a value
inversely proportional to the real distance
19
CSipSimple:
An Android client app for internet calls
Proximity sensor in CSipSimple:
Used to detect the distance between user’s face and the
device.
Device-Specific Issues
CSipSimple issue 353:
Samsung SPH-M900’s proximity sensor API reports a value
inversely proportional to the real distance
19
CSipSimple:
An Android client app for internet calls
Proximity sensor in CSipSimple:
Used to detect the distance between user’s face and the
device.
Device-Specific Issues
• Peculiar hardware composition
SD card variations
20
Device-Specific Issues
• Peculiar hardware composition
SD card variations
20
Device-Specific Issues
• Peculiar hardware composition
SD card variations
20
Device-Specific Issues
• Peculiar hardware composition
SD card variations
20
Device-Specific Issues
• Peculiar hardware composition
SD card variations
Mount points vary across devices 20
Device-Specific Issues
VLC:
A popular Android video player
21
SD card in VLC:
VLC can play videos stored in the SD card
Device-Specific Issues
VLC:
A popular Android video player
21
SD card in VLC:
VLC can play videos stored in the SD card
VLC specifically handle the SD card variations to
ensure support of different device models
Non-Device-Specific Issue
22
Non-Device-
Specific
Issue
41%
API Evolution
35%
Original
System Bug
6%
Non-Device-Specific Issues
• Android platform API evolution
• Evolving Android system with API introduction,
deprecation and behavior modification causes
compatibility issues
23
Non-Device-Specific Issues
• Android platform API evolution
• Evolving Android system with API introduction,
deprecation and behavior modification causes
compatibility issues
• Original Android system bugs
• Bugs in the system got fixed in newer version while
still existing in older versions can cause
compatibility issues.
23
Non-Device-Specific Issues
AnkiDroid pull request 130
24
API (Added in API Level 16):
SQLiteDatabase.disableWriteAheadLogging()
Non-Device-Specific Issues
AnkiDroid pull request 130
24
API (Added in API Level 16):
SQLiteDatabase.disableWriteAheadLogging()
API Level
< 16
Non-Device-Specific Issues
AnkiDroid pull request 130
24
API (Added in API Level 16):
SQLiteDatabase.disableWriteAheadLogging()
API Level
< 16
RQ2: Issue Fixing
• Patch Complexity
• Common Patching Patterns
25
RQ2: Issue Fixing
• Patch Complexity
• Simple
• Small
26
if (android.os.Build.VERSION.SDK_INT >= 16) {
sqLiteDatabase.disableWriteAheadLogging();
}
1. +
2.
3. +
RQ2: Issue Fixing
• Patch Complexity
• To debug and find a valid fix is not easy
CSipSimple issue 2436:
“HTC has closed source this contact/call log app
which makes things almost impossible to debug for
me."
27
RQ2: Issue Fixing
• Common patching patterns
• Check device information (71.7%)
28
RQ2: Issue Fixing
• Common patching patterns
• Check device information (71.7%)
• Check availability of software and hardware
components (7.3%)
28
RQ2: Issue Fixing
• Common patching patterns
• Check device information (71.7%)
• Check availability of software and hardware
components (7.3%)
• App-specific workarounds
28
RQ2: Issue Fixing
• Common patching patterns
• Check device information (71.7%)
• Check availability of software and hardware
components (7.3%)
• App-specific workarounds
Locating the root cause of compatibility issues is
difficult. Whereas, issue fixes are usually simple
and demonstrate common patterns.
28
Applications of the Empirical Findings
• Prioritize testing efforts
APILevel
Device Model
29
APILevel
Device Model
Applications of the Empirical Findings
• Prioritize testing effortsDriver-relatedAPI
29
APILevel
Device Model
Applications of the Empirical Findings
• Prioritize testing effortsDriver-relatedAPI
29
APILevel
Device Model
Applications of the Empirical Findings
• Detect compatibility issues
30
API-Context Pair Model
• Common compatibility issue pattern
31
Compatibility issues are triggered by the improper
use of an Android API (issue-inducing API) in a
problematic software or hardware environment
(issue-triggering context)
API-Context Pair Model
• Common compatibility issue pattern
32
API-Context Pair Model:
Each pattern of compatibility issue is modeled as a pair
of issue-inducing API and issue-triggering context
API-Context Pair Model
• Common compatibility issue pattern
32
Context: conjunction of device model, device brand or
API level, etc.
API-Context Pair Model:
Each pattern of compatibility issue is modeled as a pair
of issue-inducing API and issue-triggering context
API-Context Pair Model
• Common compatibility issue pattern
API-Context Pair Model:
Each pattern of compatibility issue is modeled as a pair
of issue-inducing API and issue-triggering context
32
API: SQLiteDatabase.disableWriteAheadLogging()
Context: API_level < 16 ∧ Dev_model != "Nook HD"
FicFinder: Detecting Compatibility Issues
33
FicFinder:
Fragmentation-Induced Compatibility Issue Finder
FicFinder: Detecting Compatibility Issues
Android app
(.apk or .class)
List of
API-context pairs
33
Analysis
Report
FicFinder: Detecting Compatibility Issues
Android app
(.apk or .class)
List of
API-context pairs
Backward slicing analysis
Implemented on top of Soot
25 selected API-context pairs
33
Analysis
Report
Example
34
void disableWAL() {
SQLiteDatabase db = getDatabase();
if (db.inTransaction()) {
db.endTransaction();
}
db.disableWriteAheadLogging();
}
API: SQLiteDatabase.disableWriteAheadLogging()
Context: API_level < 16 ∧ Dev_model != "Nook HD"
Example
void disableWAL() {
SQLiteDatabase db = getDatabase();
if (db.inTransaction()) {
db.endTransaction();
}
db.disableWriteAheadLogging();
}
API: SQLiteDatabase.disableWriteAheadLogging()
Context: API_level < 16 ∧ Dev_model != "Nook HD"
34
Example
void disableWAL() {
SQLiteDatabase db = getDatabase();
if (db.inTransaction()) {
db.endTransaction();
}
db.disableWriteAheadLogging();
}
AndroidManifest.xml
<uses-sdk
android:minSdkVersion="15"
/>
API: SQLiteDatabase.disableWriteAheadLogging()
Context: API_level < 16 ∧ Dev_model != "Nook HD"
34
Example
void disableWAL() {
SQLiteDatabase db = getDatabase();
if (db.inTransaction()) {
db.endTransaction();
}
db.disableWriteAheadLogging();
}
AndroidManifest.xml
<uses-sdk
android:minSdkVersion="15"
/>
API: SQLiteDatabase.disableWriteAheadLogging()
Context: API_level < 16 ∧ Dev_model != "Nook HD"
Slice:
db.disableWriteAheadLogging()
34
Example
void disableWAL() {
SQLiteDatabase db = getDatabase();
if (db.inTransaction()) {
db.endTransaction();
}
db.disableWriteAheadLogging();
}
AndroidManifest.xml
<uses-sdk
android:minSdkVersion="15"
/>
API: SQLiteDatabase.disableWriteAheadLogging()
Context: API_level < 16 ∧ Dev_model != "Nook HD"
Slice:
db.disableWriteAheadLogging()
34
Example
void disableWAL() {
SQLiteDatabase db = getDatabase();
if (db.inTransaction()) {
db.endTransaction();
}
db.disableWriteAheadLogging();
}
AndroidManifest.xml
<uses-sdk
android:minSdkVersion="15"
/>
API: SQLiteDatabase.disableWriteAheadLogging()
Context: API_level < 16 ∧ Dev_model != "Nook HD"
Slice:
db.disableWriteAheadLogging()
34
Example
void disableWAL() {
SQLiteDatabase db = getDatabase();
if (db.inTransaction()) {
db.endTransaction();
}
db.disableWriteAheadLogging();
}
AndroidManifest.xml
<uses-sdk
android:minSdkVersion="15"
/>
API: SQLiteDatabase.disableWriteAheadLogging()
Context: API_level < 16 ∧ Dev_model != "Nook HD"
Slice:
db.disableWriteAheadLogging()
34
Example
void disableWAL() {
SQLiteDatabase db = getDatabase();
if (db.inTransaction()) {
db.endTransaction();
}
db.disableWriteAheadLogging();
}
AndroidManifest.xml
<uses-sdk
android:minSdkVersion="15"
/>
API: SQLiteDatabase.disableWriteAheadLogging()
Context: API_level < 16 ∧ Dev_model != "Nook HD"
Slice:
db.disableWriteAheadLogging()
SQLiteDatabase db = getDatabase()
34
Example
void disableWAL() {
SQLiteDatabase db = getDatabase();
if (db.inTransaction()) {
db.endTransaction();
}
db.disableWriteAheadLogging();
}
AndroidManifest.xml
<uses-sdk
android:minSdkVersion="15"
/>
API: SQLiteDatabase.disableWriteAheadLogging()
Context: API_level < 16 ∧ Dev_model != "Nook HD"
Slice:
db.disableWriteAheadLogging()
SQLiteDatabase db = getDatabase()
34
Example
void disableWAL() {
SQLiteDatabase db = getDatabase();
if (db.inTransaction()) {
db.endTransaction();
}
if (isJellyBeanOrLater() || isNookHD) {
db.disableWriteAheadLogging();
}
}
AndroidManifest.xml
<uses-sdk
android:minSdkVersion="15"
/>
boolean isJellyBeanOrLater() {
return android.os.Build.SDK_VERSION >= 16;
}
boolean isNookHD {
return android.os.Build.BRAND.equals("NOOK")
&& android.os.Build.PRODUCT.equals("HDplus")
&& android.os.Build.DEVICE.equals("ovation");
}
API: SQLiteDatabase.disableWriteAheadLogging()
Context: API_level < 16 ∧ Dev_model != "Nook HD"
Slice:
db.disableWriteAheadLogging()
SQLiteDatabase db = getDatabase()
34
void disableWAL() {
SQLiteDatabase db = getDatabase();
if (db.inTransaction()) {
db.endTransaction();
}
if (isJellyBeanOrLater() || isNookHD) {
db.disableWriteAheadLogging();
}
}
Example
AndroidManifest.xml
<uses-sdk
android:minSdkVersion="15"
/>
boolean isJellyBeanOrLater() {
return android.os.Build.SDK_VERSION >= 16;
}
boolean isNookHD {
return android.os.Build.BRAND.equals("NOOK")
&& android.os.Build.PRODUCT.equals("HDplus")
&& android.os.Build.DEVICE.equals("ovation");
}
API: SQLiteDatabase.disableWriteAheadLogging()
Context: API_level < 16 ∧ Dev_model != "Nook HD"
Slice:
db.disableWriteAheadLogging()
SQLiteDatabase db = getDatabase()
if(isJellyBeanOrLater()||isNookHD)
34
void disableWAL() {
SQLiteDatabase db = getDatabase();
if (db.inTransaction()) {
db.endTransaction();
}
if (isJellyBeanOrLater() || isNookHD) {
db.disableWriteAheadLogging();
}
}
Example
API: SQLiteDatabase.disableWriteAheadLogging()
Context: API_level < 16 ∧ Dev_model != "Nook HD"
AndroidManifest.xml
<uses-sdk
android:minSdkVersion="15"
/>
Slice:
db.disableWriteAheadLogging()
SQLiteDatabase db = getDatabase()
if(isJellyBeanOrLater()||isNookHD)
return
android.os.Build.SDK_VERSION >=
16
return
android.os.Build.BRAND.equals("NO
OK")&&android.os.Build.PRODUCT.eq
uals("HDplus")&&android.os.Build.
DEVICE.equals("ovation")
boolean isJellyBeanOrLater() {
return android.os.Build.SDK_VERSION >= 16;
}
boolean isNookHD {
return android.os.Build.BRAND.equals("NOOK")
&& android.os.Build.PRODUCT.equals("HDplus")
&& android.os.Build.DEVICE.equals("ovation");
}
34
void disableWAL() {
SQLiteDatabase db = getDatabase();
if (db.inTransaction()) {
db.endTransaction();
}
if (isJellyBeanOrLater() || isNookHD) {
db.disableWriteAheadLogging();
}
}
Example
API: SQLiteDatabase.disableWriteAheadLogging()
Context: API_level < 16 ∧ Dev_model != "Nook HD"
AndroidManifest.xml
<uses-sdk
android:minSdkVersion="15"
/>
Slice:
db.disableWriteAheadLogging()
SQLiteDatabase db = getDatabase()
if(isJellyBeanOrLater()||isNookHD)
return
android.os.Build.SDK_VERSION >=
16
return
android.os.Build.BRAND.equals("NO
OK")&&android.os.Build.PRODUCT.eq
uals("HDplus")&&android.os.Build.
DEVICE.equals("ovation")
boolean isJellyBeanOrLater() {
return android.os.Build.SDK_VERSION >= 16;
}
boolean isNookHD {
return android.os.Build.BRAND.equals("NOOK")
&& android.os.Build.PRODUCT.equals("HDplus")
&& android.os.Build.DEVICE.equals("ovation");
}
34
void disableWAL() {
SQLiteDatabase db = getDatabase();
if (db.inTransaction()) {
db.endTransaction();
}
if (isJellyBeanOrLater() || isNookHD) {
db.disableWriteAheadLogging();
}
}
Example
API: SQLiteDatabase.disableWriteAheadLogging()
Context: API_level < 16 ∧ Dev_model != "Nook HD"
AndroidManifest.xml
<uses-sdk
android:minSdkVersion="15"
/>
Slice:
db.disableWriteAheadLogging()
SQLiteDatabase db = getDatabase()
if(isJellyBeanOrLater()||isNookHD)
return
android.os.Build.SDK_VERSION >=
16
return
android.os.Build.BRAND.equals("NO
OK")&&android.os.Build.PRODUCT.eq
uals("HDplus")&&android.os.Build.
DEVICE.equals("ovation")
boolean isJellyBeanOrLater() {
return android.os.Build.SDK_VERSION >= 16;
}
boolean isNookHD {
return android.os.Build.BRAND.equals("NOOK")
&& android.os.Build.PRODUCT.equals("HDplus")
&& android.os.Build.DEVICE.equals("ovation");
}
34
Evaluation
• Subject apps: latest version of 27 popular,
actively-maintained Android apps
• Covering 10 different categories
• At least 5K downloads
App name Category KLOC Rating Downloads
ConnectBot Communication 23.0 4.6 1M – 5M
AntennaPod Media & Video 65.0 4.5 100K – 500K
c:geo Entertainment 78.8 4.4 1M – 5M
AnySoftKeyboard Tools 70.7 4.4 1M – 5M
… … … … …
35
Effectiveness of FicFinder
• Configure FicFinder to report both warnings
and good practices
36
Effectiveness of FicFinder
• Configure FicFinder to report both warnings
and good practices
• FicFinder reported 51 warnings and 79 good
practices
36
Effectiveness of FicFinder
• Configure FicFinder to report both warnings
and good practices
• FicFinder reported 51 warnings and 79 good
practices
46 of the 51 warnings are true positives
(Precision: 90.2%)
36
Effectiveness of FicFinder
• Submitted 14 bug reports
• Bug reports included issue-related discussions,
API guides and possible fixes in the bug reports
to help developers diagnose the issues
37
Effectiveness of FicFinder
• Submitted 14 bug reports
• Bug reports included issue-related discussions,
API guides and possible fixes in the bug reports
to help developers diagnose the issues
8 of the 14 bug reports were
acknowledged by app developers.
5 issues were quickly fixed.
37
Usefulness of FicFinder
• Knowledge of API-context pairs extracted from
our empirical study can be transferred across
different apps
38
AnySoftKeyboard Issue 639:
Rule originally extracted from K9 Mail
K9 Mail Issue 1237:
Rule originally extracted from CSipSimple
Usefulness of FicFinder
• 4 of the 5 fixed issues were fixed by adopting
our suggested fixes.
Thanks, we will do it as you proposed in out next
release. :)
Please let us know if you found more of these issues.
iSsO (1Sheeld developer)
39
Usefulness of FicFinder
• 4 of the 5 fixed issues were fixed by adopting
our suggested fixes.
• The other issue was fixed with an alternative
patch, which was semantically equivalent to
our suggested one.
Thanks, we will do it as you proposed in out next
release. :)
Please let us know if you found more of these issues.
iSsO (1Sheeld developer)
39
Conclusion
• First large-scale empirical study of Android
compatibility issues at code level
• API-context pair to model compatibility issues
• A static analysis tool, FicFinder, to detect
fragmentation-induced compatibility issues
40
Future Work
• Automate API-context pair extraction
• Continue to improve the effectiveness of
FicFinder
41
Thank you!
More information can be found in our paper
Or visit FicFinder’s homepage:
http://sccpu2.cse.ust.hk/ficfinder/
41

Contenu connexe

Tendances

12.8 independent and dependent events 1
12.8 independent and dependent events   112.8 independent and dependent events   1
12.8 independent and dependent events 1
bweldon
 
Binomial distribution and applications
Binomial distribution and applicationsBinomial distribution and applications
Binomial distribution and applications
jalal karimi
 
01_Probability of Simple Events.ppt
01_Probability of Simple Events.ppt01_Probability of Simple Events.ppt
01_Probability of Simple Events.ppt
ReinabelleMarquez1
 
2.4 introduction to logarithm
2.4 introduction to logarithm2.4 introduction to logarithm
2.4 introduction to logarithm
math123c
 

Tendances (20)

Kolmogorov Smirnov good-of-fit test
Kolmogorov Smirnov good-of-fit testKolmogorov Smirnov good-of-fit test
Kolmogorov Smirnov good-of-fit test
 
12.8 independent and dependent events 1
12.8 independent and dependent events   112.8 independent and dependent events   1
12.8 independent and dependent events 1
 
Fundamentals Probability 08072009
Fundamentals Probability 08072009Fundamentals Probability 08072009
Fundamentals Probability 08072009
 
Binomial distribution and applications
Binomial distribution and applicationsBinomial distribution and applications
Binomial distribution and applications
 
Probability of an Event.pptx
Probability of an Event.pptxProbability of an Event.pptx
Probability of an Event.pptx
 
Law of large numbers
Law of large numbersLaw of large numbers
Law of large numbers
 
Two Sample Tests
Two Sample TestsTwo Sample Tests
Two Sample Tests
 
Combinatorics
CombinatoricsCombinatorics
Combinatorics
 
Probability
ProbabilityProbability
Probability
 
Probability and probability distributions ppt @ bec doms
Probability and probability distributions ppt @ bec domsProbability and probability distributions ppt @ bec doms
Probability and probability distributions ppt @ bec doms
 
01_Probability of Simple Events.ppt
01_Probability of Simple Events.ppt01_Probability of Simple Events.ppt
01_Probability of Simple Events.ppt
 
What is a Factorial ANOVA?
What is a Factorial ANOVA?What is a Factorial ANOVA?
What is a Factorial ANOVA?
 
2.4 introduction to logarithm
2.4 introduction to logarithm2.4 introduction to logarithm
2.4 introduction to logarithm
 
Unit 4
Unit 4Unit 4
Unit 4
 
Kolmogorov Smirnov | Statistics
Kolmogorov Smirnov | StatisticsKolmogorov Smirnov | Statistics
Kolmogorov Smirnov | Statistics
 
Combinations
CombinationsCombinations
Combinations
 
2.8.3 Special Parallelograms
2.8.3 Special Parallelograms2.8.3 Special Parallelograms
2.8.3 Special Parallelograms
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
11.4 Geometric Probability
11.4 Geometric Probability11.4 Geometric Probability
11.4 Geometric Probability
 
General Introduction to ROC Curves
General Introduction to ROC CurvesGeneral Introduction to ROC Curves
General Introduction to ROC Curves
 

En vedette

Portfoliofeijoagraphix2 130908161240-
Portfoliofeijoagraphix2 130908161240-Portfoliofeijoagraphix2 130908161240-
Portfoliofeijoagraphix2 130908161240-
0oio0
 
Master Ingeniería de telecomunicación UOC presentación_virtual
Master Ingeniería de telecomunicación UOC presentación_virtualMaster Ingeniería de telecomunicación UOC presentación_virtual
Master Ingeniería de telecomunicación UOC presentación_virtual
jmoranm
 
Pervaporacion
Pervaporacion Pervaporacion
Pervaporacion
Elias Rodas Palomino
 
Pentium II, Pentium III, Ranuras de expansión
Pentium II, Pentium III, Ranuras de expansiónPentium II, Pentium III, Ranuras de expansión
Pentium II, Pentium III, Ranuras de expansión
mijacaza
 

En vedette (20)

Portfoliofeijoagraphix2 130908161240-
Portfoliofeijoagraphix2 130908161240-Portfoliofeijoagraphix2 130908161240-
Portfoliofeijoagraphix2 130908161240-
 
Master Ingeniería de telecomunicación UOC presentación_virtual
Master Ingeniería de telecomunicación UOC presentación_virtualMaster Ingeniería de telecomunicación UOC presentación_virtual
Master Ingeniería de telecomunicación UOC presentación_virtual
 
Gerardo Ruiz Dosal - Publicidad
Gerardo Ruiz Dosal - PublicidadGerardo Ruiz Dosal - Publicidad
Gerardo Ruiz Dosal - Publicidad
 
Plan accesibilidad universal aprobado ce
Plan accesibilidad universal   aprobado cePlan accesibilidad universal   aprobado ce
Plan accesibilidad universal aprobado ce
 
Cantantes y grupos de salsa NORALBA CARO PEDRAZA
Cantantes y grupos de salsa NORALBA CARO PEDRAZACantantes y grupos de salsa NORALBA CARO PEDRAZA
Cantantes y grupos de salsa NORALBA CARO PEDRAZA
 
Asv neufeld
Asv neufeldAsv neufeld
Asv neufeld
 
Cortartec - Arminox Aço Inox Nervurado
Cortartec - Arminox Aço Inox NervuradoCortartec - Arminox Aço Inox Nervurado
Cortartec - Arminox Aço Inox Nervurado
 
Pervaporacion
Pervaporacion Pervaporacion
Pervaporacion
 
Huber bruno psicologia astrologica
Huber bruno   psicologia astrologicaHuber bruno   psicologia astrologica
Huber bruno psicologia astrologica
 
Exorcismos
ExorcismosExorcismos
Exorcismos
 
Glas Project mMobility story folding bike
Glas Project mMobility story folding bikeGlas Project mMobility story folding bike
Glas Project mMobility story folding bike
 
Registro JóVenes Investigadores
Registro JóVenes InvestigadoresRegistro JóVenes Investigadores
Registro JóVenes Investigadores
 
GILVER CV ADM
GILVER CV ADMGILVER CV ADM
GILVER CV ADM
 
Grafomotricidad
GrafomotricidadGrafomotricidad
Grafomotricidad
 
Evaluación de herramientas web 2.0:Estilos de aprendizaje y su aplicación en ...
Evaluación de herramientas web 2.0:Estilos de aprendizaje y su aplicación en ...Evaluación de herramientas web 2.0:Estilos de aprendizaje y su aplicación en ...
Evaluación de herramientas web 2.0:Estilos de aprendizaje y su aplicación en ...
 
Capacitacion Completa Producto y Red, Socios de Amarillas Internet
Capacitacion Completa Producto y Red, Socios de Amarillas InternetCapacitacion Completa Producto y Red, Socios de Amarillas Internet
Capacitacion Completa Producto y Red, Socios de Amarillas Internet
 
Pentium II, Pentium III, Ranuras de expansión
Pentium II, Pentium III, Ranuras de expansiónPentium II, Pentium III, Ranuras de expansión
Pentium II, Pentium III, Ranuras de expansión
 
App Store PR
App Store PRApp Store PR
App Store PR
 
One search basics
One search basicsOne search basics
One search basics
 
Think Led Applications Overview Feb 20 2009
Think Led Applications Overview Feb 20 2009Think Led Applications Overview Feb 20 2009
Think Led Applications Overview Feb 20 2009
 

Similaire à ASE 2016 Taming Android Fragmentation: Characterizing and Detecting Compatibility Issues for Android Apps

Icsm2011 syer
Icsm2011 syerIcsm2011 syer
Icsm2011 syer
SAIL_QU
 
Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)
Ahsanul Karim
 
Android Workshop Presentation
Android Workshop PresentationAndroid Workshop Presentation
Android Workshop Presentation
NAILBITER
 

Similaire à ASE 2016 Taming Android Fragmentation: Characterizing and Detecting Compatibility Issues for Android Apps (20)

OpenMobile ACL bringing Android apps to TIZEN
OpenMobile ACL bringing Android apps to TIZENOpenMobile ACL bringing Android apps to TIZEN
OpenMobile ACL bringing Android apps to TIZEN
 
001-Mobile Application.pptx
001-Mobile Application.pptx001-Mobile Application.pptx
001-Mobile Application.pptx
 
On the Link Between Mobile App Quality and User Reviews
On the Link Between Mobile App Quality and User ReviewsOn the Link Between Mobile App Quality and User Reviews
On the Link Between Mobile App Quality and User Reviews
 
Learn Android app development in easy steps
Learn Android app development in easy stepsLearn Android app development in easy steps
Learn Android app development in easy steps
 
Introduction to android mobile app development.pptx
Introduction to android mobile app development.pptxIntroduction to android mobile app development.pptx
Introduction to android mobile app development.pptx
 
What are the Characteristics of High-rated Apps
What are the Characteristics of High-rated AppsWhat are the Characteristics of High-rated Apps
What are the Characteristics of High-rated Apps
 
Android
AndroidAndroid
Android
 
Androidappdevelopmentpresentation
AndroidappdevelopmentpresentationAndroidappdevelopmentpresentation
Androidappdevelopmentpresentation
 
Android Interview Questions And Answers | Android Tutorial | Android Online T...
Android Interview Questions And Answers | Android Tutorial | Android Online T...Android Interview Questions And Answers | Android Tutorial | Android Online T...
Android Interview Questions And Answers | Android Tutorial | Android Online T...
 
Icsm2011 syer
Icsm2011 syerIcsm2011 syer
Icsm2011 syer
 
Android workshop sn tech solutions
Android workshop sn tech solutionsAndroid workshop sn tech solutions
Android workshop sn tech solutions
 
ICSE 2019 - PIVOT: Learning API-Device Correlations to Facilitate Android Com...
ICSE 2019 - PIVOT: Learning API-Device Correlations to Facilitate Android Com...ICSE 2019 - PIVOT: Learning API-Device Correlations to Facilitate Android Com...
ICSE 2019 - PIVOT: Learning API-Device Correlations to Facilitate Android Com...
 
Large-Scale Empirical Studies of Mobile Apps
Large-Scale Empirical Studies of Mobile AppsLarge-Scale Empirical Studies of Mobile Apps
Large-Scale Empirical Studies of Mobile Apps
 
apidays LIVE Paris - Growing an API Culture by Saul Caganoff & Liz Douglass
apidays LIVE Paris - Growing an API Culture by Saul Caganoff & Liz Douglassapidays LIVE Paris - Growing an API Culture by Saul Caganoff & Liz Douglass
apidays LIVE Paris - Growing an API Culture by Saul Caganoff & Liz Douglass
 
apidays LIVE Australia 2020 - Growing an API Culture by Liz Douglass & Saul C...
apidays LIVE Australia 2020 - Growing an API Culture by Liz Douglass & Saul C...apidays LIVE Australia 2020 - Growing an API Culture by Liz Douglass & Saul C...
apidays LIVE Australia 2020 - Growing an API Culture by Liz Douglass & Saul C...
 
Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)
 
The state-of-the-art in Mobile apps
The state-of-the-art in Mobile appsThe state-of-the-art in Mobile apps
The state-of-the-art in Mobile apps
 
Growing an API Culture - APIdays LIVE AU 2020
Growing an API Culture - APIdays LIVE AU 2020Growing an API Culture - APIdays LIVE AU 2020
Growing an API Culture - APIdays LIVE AU 2020
 
Android Workshop Presentation
Android Workshop PresentationAndroid Workshop Presentation
Android Workshop Presentation
 
Top 12 Reasons You Should Invest in Android App Development.pptx
Top 12 Reasons You Should Invest in Android App Development.pptxTop 12 Reasons You Should Invest in Android App Development.pptx
Top 12 Reasons You Should Invest in Android App Development.pptx
 

ASE 2016 Taming Android Fragmentation: Characterizing and Detecting Compatibility Issues for Android Apps

  • 1. Taming Android Fragmentation: Characterizing and Detecting Compatibility Issues for Android Apps Lili Wei Yepang Liu This image canno t curre S.C. Cheung The Hong Kong University of Science and Technology 05 September 2016
  • 2. Android: Popular and Fast-Evolving System • Fast-evolving: multiple releases every year 2
  • 3. Android: Popular and Fast-Evolving System • Fast-evolving: multiple releases every year • Many different system versions in use: 2 KitKat Lollipop Jelly Bean Ice Cream Sandwich Gingerbread Froyo Marshmallow https://developer.android.com/about/dashboards/index.html
  • 4. 3
  • 5. Huge Number of Device Models Over 24,000 distinct device models (Aug. 2014 – Aug.2015) http://opensignal.com/reports/2015/08/android-fragmentation/ 4
  • 9. Ensuring App Compatibility Is Difficult • App developers have to optimize UI of their apps to fit diversified screen sizes 6
  • 10. Ensuring App Compatibility is Difficult • App developers have to optimize UI of their apps to fit diversified screen sizes • An app behaves differently across devices 6http://gameovenstudios.com/bounden-on-android-delayed/
  • 11. Ensuring App Compatibility is Difficult • App developers have to optimize UI of their apps to fit diversified screen sizes • An app behaves differently across devices 6 Fragmentation-induced compatibility issues http://gameovenstudios.com/bounden-on-android-delayed/
  • 12. Testing Compatibility Issues • To fully test compatibility issues is difficult with huge search space • Combination of three dimensions 7
  • 13. Testing Compatibility Issues • To fully test compatibility issues is difficult with huge search space • Combination of three dimensions 7 Device Model
  • 14. Testing Compatibility Issues • To fully test compatibility issues is difficult with huge search space • Combination of three dimensions 7 APILevel Device Model
  • 15. Testing Compatibility Issues • To fully test compatibility issues is difficult with huge search space • Combination of three dimensions 7 APILevel Device Model
  • 16. APILevel Device Model Testing Compatibility Issues • To fully test compatibility issues is difficult with huge search space • Combination of three dimensions 7
  • 17. Existing Work • Understanding Android fragmentation • D. Han et al. [WCRE’ 2012] • T. McDonnell et al. [ICSM’ 2013] • Prioritize devices to test on: • H. Khalid et al. [FSE’ 2014] • X. Lu et al. [ICSE’ 2016] 8
  • 18. Existing Work 8 None of the existing studies dug into the code level: • To understand compatibility issues • To detect compatibility issues • Understanding Android fragmentation • D. Han et al. [WCRE’ 2012] • T. McDonnell et al. [ICSM’ 2013] • Prioritize devices to test on: • H. Khalid et al. [FSE’ 2014] • X. Lu et al. [ICSE’ 2016]
  • 20. Our Goal Understand compatibility issues at code level Detect compatibility issues 9
  • 21. Research Questions • RQ1: Issue type and root cause • What are the common types of compatibility issues in Android apps? What are their root causes? 9
  • 22. Research Questions • RQ1: Issue type and root cause • What are the common types of compatibility issues in Android apps? What are their root causes? • RQ2: Issue fixing • How do Android developers fix compatibility issues in practice? Are there any common patterns? 9
  • 23. Dataset Collection 27 popular, large-scale, well-maintained candidate apps, which have public issue tracking systems 10
  • 24. Dataset Collection 27 popular, large-scale, well-maintained candidate apps, which have public issue tracking systems 10 Apps satisfying these criterion are: • More likely to be affected by different kinds of compatibility issues • With traceable issue fix and discussions to study
  • 25. Keyword Search device compatible compatibility samsung lge sony moto lenovo asus zte google htc huawei xiaomi android.os.build 11
  • 26. VLC r-8e31d57: Blind fix for mountpoint issues with some Samsung devices if(line.contains("vfat") || line.contains("exfat") || - line.contains("/mnt") || line.contains("/Removable")) { + line.contains("sdcardfs") || line.contains("/mnt") || + line.contains("/Removable")) { Keyword Search device compatible compatibility samsung lge sony moto lenovo asus zte google htc huawei xiaomi android.os.build 11
  • 27. VLC r-8e31d57: Blind fix for mountpoint issues with some Samsung devices if(line.contains("vfat") || line.contains("exfat") || - line.contains("/mnt") || line.contains("/Removable")) { + line.contains("sdcardfs") || line.contains("/mnt") || + line.contains("/Removable")) { Keyword Search device compatible compatibility samsung lge sony moto lenovo asus zte google htc huawei xiaomi android.os.build 11 CSipSimple r-af0ceea: Fixes issue 498. + //HTC evo 4G + if(android.os.Build.PRODUCT.equalsIgnoreCase("htc_supersonic")) + return true;
  • 28. Dataset Collection 12 27 popular, large-scale, well-maintained candidate apps, which have public issue tracking systems All 27 apps contain potential revisions related to compatibility issues
  • 29. Dataset Collection Five apps with top number of potential issue-related code revisions 12 27 popular, large-scale, well-maintained candidate apps, which have public issue tracking systems
  • 30. Dataset Collection Five apps with top number of potential issue-related code revisions 12 Over 1800 code revisions found in the five apps need to be manually inspected 27 popular, large-scale, well-maintained candidate apps, which have public issue tracking systems
  • 31. Dataset Collection 191 compatibility issues Five apps with top number of potential issue-related code revisions (>1800 revisions) 12 27 popular, large-scale, well-maintained candidate apps, which have public issue tracking systems
  • 32. Selected Apps App Name Category Rating Downloads KLOC #Revisions CSipSimple Communication 4.3/5.0 1M - 5M 59.2 1,778 AnkiDroid Education 4.5/5.0 1M - 5M 58.1 8,282 K-9 Mail Communication 4.3/5.0 5M - 10M 86.7 6,116 VLC Media & Video 4.3/5.0 10M - 50M 28.3 6,868 AnySoftKeyboard Tools 4.3/5.0 1M - 5M 70.7 2,788 13
  • 34. Data Analysis API Identified the issue-inducing APIs Recovered links between revisions and reports 14
  • 35. Data Analysis API Identified the issue-inducing APIs Recovered links between revisions and reports Collected related discussions from online forums 14
  • 36. RQ1: Issue Type and Root Cause 15
  • 37. RQ1: Issue Type and Root Cause 15 59%41% Device-specific issues Can only be triggered on certain device models Non-device-specific issues Can be triggered under certain API level
  • 39. Device-Specific Issues • Problematic driver implementation • Different driver implementation can cause inconsistent app behavior across devices. 17
  • 40. Device-Specific Issues • Problematic driver implementation • Different driver implementation can cause inconsistent app behavior across devices. • OS customization • Manufacturer-customized systems may not fully comply with the official specifications and thus cause compatibility issues 17
  • 41. Device-Specific Issues • Problematic driver implementation • Different driver implementation can cause inconsistent app behavior across devices. • OS customization • Manufacturer-customized systems may not fully comply with the official specifications and thus cause compatibility issues • Hardware composition • Diversified hardware composition of different device models can cause compatibility issues 17
  • 42. Device-Specific Issues • Problematic driver implementation • Different driver implementation can cause inconsistent app behavior across devices. Proximity sensor: Report the distance between device and its surrounding object 18
  • 43. Device-Specific Issues 19 CSipSimple: An Android client app for internet calls Proximity sensor in CSipSimple: Used to detect the distance between user’s face and the device.
  • 44. Device-Specific Issues 19 Near CSipSimple: An Android client app for internet calls Proximity sensor in CSipSimple: Used to detect the distance between user’s face and the device.
  • 45. Device-Specific Issues CSipSimple issue 353: Samsung SPH-M900’s proximity sensor API reports a value inversely proportional to the real distance 19 CSipSimple: An Android client app for internet calls Proximity sensor in CSipSimple: Used to detect the distance between user’s face and the device.
  • 46. Device-Specific Issues CSipSimple issue 353: Samsung SPH-M900’s proximity sensor API reports a value inversely proportional to the real distance 19 CSipSimple: An Android client app for internet calls Proximity sensor in CSipSimple: Used to detect the distance between user’s face and the device.
  • 47. Device-Specific Issues CSipSimple issue 353: Samsung SPH-M900’s proximity sensor API reports a value inversely proportional to the real distance 19 CSipSimple: An Android client app for internet calls Proximity sensor in CSipSimple: Used to detect the distance between user’s face and the device.
  • 48. Device-Specific Issues CSipSimple issue 353: Samsung SPH-M900’s proximity sensor API reports a value inversely proportional to the real distance 19 CSipSimple: An Android client app for internet calls Proximity sensor in CSipSimple: Used to detect the distance between user’s face and the device.
  • 49. Device-Specific Issues • Peculiar hardware composition SD card variations 20
  • 50. Device-Specific Issues • Peculiar hardware composition SD card variations 20
  • 51. Device-Specific Issues • Peculiar hardware composition SD card variations 20
  • 52. Device-Specific Issues • Peculiar hardware composition SD card variations 20
  • 53. Device-Specific Issues • Peculiar hardware composition SD card variations Mount points vary across devices 20
  • 54. Device-Specific Issues VLC: A popular Android video player 21 SD card in VLC: VLC can play videos stored in the SD card
  • 55. Device-Specific Issues VLC: A popular Android video player 21 SD card in VLC: VLC can play videos stored in the SD card VLC specifically handle the SD card variations to ensure support of different device models
  • 57. Non-Device-Specific Issues • Android platform API evolution • Evolving Android system with API introduction, deprecation and behavior modification causes compatibility issues 23
  • 58. Non-Device-Specific Issues • Android platform API evolution • Evolving Android system with API introduction, deprecation and behavior modification causes compatibility issues • Original Android system bugs • Bugs in the system got fixed in newer version while still existing in older versions can cause compatibility issues. 23
  • 59. Non-Device-Specific Issues AnkiDroid pull request 130 24 API (Added in API Level 16): SQLiteDatabase.disableWriteAheadLogging()
  • 60. Non-Device-Specific Issues AnkiDroid pull request 130 24 API (Added in API Level 16): SQLiteDatabase.disableWriteAheadLogging() API Level < 16
  • 61. Non-Device-Specific Issues AnkiDroid pull request 130 24 API (Added in API Level 16): SQLiteDatabase.disableWriteAheadLogging() API Level < 16
  • 62. RQ2: Issue Fixing • Patch Complexity • Common Patching Patterns 25
  • 63. RQ2: Issue Fixing • Patch Complexity • Simple • Small 26 if (android.os.Build.VERSION.SDK_INT >= 16) { sqLiteDatabase.disableWriteAheadLogging(); } 1. + 2. 3. +
  • 64. RQ2: Issue Fixing • Patch Complexity • To debug and find a valid fix is not easy CSipSimple issue 2436: “HTC has closed source this contact/call log app which makes things almost impossible to debug for me." 27
  • 65. RQ2: Issue Fixing • Common patching patterns • Check device information (71.7%) 28
  • 66. RQ2: Issue Fixing • Common patching patterns • Check device information (71.7%) • Check availability of software and hardware components (7.3%) 28
  • 67. RQ2: Issue Fixing • Common patching patterns • Check device information (71.7%) • Check availability of software and hardware components (7.3%) • App-specific workarounds 28
  • 68. RQ2: Issue Fixing • Common patching patterns • Check device information (71.7%) • Check availability of software and hardware components (7.3%) • App-specific workarounds Locating the root cause of compatibility issues is difficult. Whereas, issue fixes are usually simple and demonstrate common patterns. 28
  • 69. Applications of the Empirical Findings • Prioritize testing efforts APILevel Device Model 29
  • 70. APILevel Device Model Applications of the Empirical Findings • Prioritize testing effortsDriver-relatedAPI 29
  • 71. APILevel Device Model Applications of the Empirical Findings • Prioritize testing effortsDriver-relatedAPI 29
  • 72. APILevel Device Model Applications of the Empirical Findings • Detect compatibility issues 30
  • 73. API-Context Pair Model • Common compatibility issue pattern 31 Compatibility issues are triggered by the improper use of an Android API (issue-inducing API) in a problematic software or hardware environment (issue-triggering context)
  • 74. API-Context Pair Model • Common compatibility issue pattern 32 API-Context Pair Model: Each pattern of compatibility issue is modeled as a pair of issue-inducing API and issue-triggering context
  • 75. API-Context Pair Model • Common compatibility issue pattern 32 Context: conjunction of device model, device brand or API level, etc. API-Context Pair Model: Each pattern of compatibility issue is modeled as a pair of issue-inducing API and issue-triggering context
  • 76. API-Context Pair Model • Common compatibility issue pattern API-Context Pair Model: Each pattern of compatibility issue is modeled as a pair of issue-inducing API and issue-triggering context 32 API: SQLiteDatabase.disableWriteAheadLogging() Context: API_level < 16 ∧ Dev_model != "Nook HD"
  • 77. FicFinder: Detecting Compatibility Issues 33 FicFinder: Fragmentation-Induced Compatibility Issue Finder
  • 78. FicFinder: Detecting Compatibility Issues Android app (.apk or .class) List of API-context pairs 33 Analysis Report
  • 79. FicFinder: Detecting Compatibility Issues Android app (.apk or .class) List of API-context pairs Backward slicing analysis Implemented on top of Soot 25 selected API-context pairs 33 Analysis Report
  • 80. Example 34 void disableWAL() { SQLiteDatabase db = getDatabase(); if (db.inTransaction()) { db.endTransaction(); } db.disableWriteAheadLogging(); } API: SQLiteDatabase.disableWriteAheadLogging() Context: API_level < 16 ∧ Dev_model != "Nook HD"
  • 81. Example void disableWAL() { SQLiteDatabase db = getDatabase(); if (db.inTransaction()) { db.endTransaction(); } db.disableWriteAheadLogging(); } API: SQLiteDatabase.disableWriteAheadLogging() Context: API_level < 16 ∧ Dev_model != "Nook HD" 34
  • 82. Example void disableWAL() { SQLiteDatabase db = getDatabase(); if (db.inTransaction()) { db.endTransaction(); } db.disableWriteAheadLogging(); } AndroidManifest.xml <uses-sdk android:minSdkVersion="15" /> API: SQLiteDatabase.disableWriteAheadLogging() Context: API_level < 16 ∧ Dev_model != "Nook HD" 34
  • 83. Example void disableWAL() { SQLiteDatabase db = getDatabase(); if (db.inTransaction()) { db.endTransaction(); } db.disableWriteAheadLogging(); } AndroidManifest.xml <uses-sdk android:minSdkVersion="15" /> API: SQLiteDatabase.disableWriteAheadLogging() Context: API_level < 16 ∧ Dev_model != "Nook HD" Slice: db.disableWriteAheadLogging() 34
  • 84. Example void disableWAL() { SQLiteDatabase db = getDatabase(); if (db.inTransaction()) { db.endTransaction(); } db.disableWriteAheadLogging(); } AndroidManifest.xml <uses-sdk android:minSdkVersion="15" /> API: SQLiteDatabase.disableWriteAheadLogging() Context: API_level < 16 ∧ Dev_model != "Nook HD" Slice: db.disableWriteAheadLogging() 34
  • 85. Example void disableWAL() { SQLiteDatabase db = getDatabase(); if (db.inTransaction()) { db.endTransaction(); } db.disableWriteAheadLogging(); } AndroidManifest.xml <uses-sdk android:minSdkVersion="15" /> API: SQLiteDatabase.disableWriteAheadLogging() Context: API_level < 16 ∧ Dev_model != "Nook HD" Slice: db.disableWriteAheadLogging() 34
  • 86. Example void disableWAL() { SQLiteDatabase db = getDatabase(); if (db.inTransaction()) { db.endTransaction(); } db.disableWriteAheadLogging(); } AndroidManifest.xml <uses-sdk android:minSdkVersion="15" /> API: SQLiteDatabase.disableWriteAheadLogging() Context: API_level < 16 ∧ Dev_model != "Nook HD" Slice: db.disableWriteAheadLogging() 34
  • 87. Example void disableWAL() { SQLiteDatabase db = getDatabase(); if (db.inTransaction()) { db.endTransaction(); } db.disableWriteAheadLogging(); } AndroidManifest.xml <uses-sdk android:minSdkVersion="15" /> API: SQLiteDatabase.disableWriteAheadLogging() Context: API_level < 16 ∧ Dev_model != "Nook HD" Slice: db.disableWriteAheadLogging() SQLiteDatabase db = getDatabase() 34
  • 88. Example void disableWAL() { SQLiteDatabase db = getDatabase(); if (db.inTransaction()) { db.endTransaction(); } db.disableWriteAheadLogging(); } AndroidManifest.xml <uses-sdk android:minSdkVersion="15" /> API: SQLiteDatabase.disableWriteAheadLogging() Context: API_level < 16 ∧ Dev_model != "Nook HD" Slice: db.disableWriteAheadLogging() SQLiteDatabase db = getDatabase() 34
  • 89. Example void disableWAL() { SQLiteDatabase db = getDatabase(); if (db.inTransaction()) { db.endTransaction(); } if (isJellyBeanOrLater() || isNookHD) { db.disableWriteAheadLogging(); } } AndroidManifest.xml <uses-sdk android:minSdkVersion="15" /> boolean isJellyBeanOrLater() { return android.os.Build.SDK_VERSION >= 16; } boolean isNookHD { return android.os.Build.BRAND.equals("NOOK") && android.os.Build.PRODUCT.equals("HDplus") && android.os.Build.DEVICE.equals("ovation"); } API: SQLiteDatabase.disableWriteAheadLogging() Context: API_level < 16 ∧ Dev_model != "Nook HD" Slice: db.disableWriteAheadLogging() SQLiteDatabase db = getDatabase() 34
  • 90. void disableWAL() { SQLiteDatabase db = getDatabase(); if (db.inTransaction()) { db.endTransaction(); } if (isJellyBeanOrLater() || isNookHD) { db.disableWriteAheadLogging(); } } Example AndroidManifest.xml <uses-sdk android:minSdkVersion="15" /> boolean isJellyBeanOrLater() { return android.os.Build.SDK_VERSION >= 16; } boolean isNookHD { return android.os.Build.BRAND.equals("NOOK") && android.os.Build.PRODUCT.equals("HDplus") && android.os.Build.DEVICE.equals("ovation"); } API: SQLiteDatabase.disableWriteAheadLogging() Context: API_level < 16 ∧ Dev_model != "Nook HD" Slice: db.disableWriteAheadLogging() SQLiteDatabase db = getDatabase() if(isJellyBeanOrLater()||isNookHD) 34
  • 91. void disableWAL() { SQLiteDatabase db = getDatabase(); if (db.inTransaction()) { db.endTransaction(); } if (isJellyBeanOrLater() || isNookHD) { db.disableWriteAheadLogging(); } } Example API: SQLiteDatabase.disableWriteAheadLogging() Context: API_level < 16 ∧ Dev_model != "Nook HD" AndroidManifest.xml <uses-sdk android:minSdkVersion="15" /> Slice: db.disableWriteAheadLogging() SQLiteDatabase db = getDatabase() if(isJellyBeanOrLater()||isNookHD) return android.os.Build.SDK_VERSION >= 16 return android.os.Build.BRAND.equals("NO OK")&&android.os.Build.PRODUCT.eq uals("HDplus")&&android.os.Build. DEVICE.equals("ovation") boolean isJellyBeanOrLater() { return android.os.Build.SDK_VERSION >= 16; } boolean isNookHD { return android.os.Build.BRAND.equals("NOOK") && android.os.Build.PRODUCT.equals("HDplus") && android.os.Build.DEVICE.equals("ovation"); } 34
  • 92. void disableWAL() { SQLiteDatabase db = getDatabase(); if (db.inTransaction()) { db.endTransaction(); } if (isJellyBeanOrLater() || isNookHD) { db.disableWriteAheadLogging(); } } Example API: SQLiteDatabase.disableWriteAheadLogging() Context: API_level < 16 ∧ Dev_model != "Nook HD" AndroidManifest.xml <uses-sdk android:minSdkVersion="15" /> Slice: db.disableWriteAheadLogging() SQLiteDatabase db = getDatabase() if(isJellyBeanOrLater()||isNookHD) return android.os.Build.SDK_VERSION >= 16 return android.os.Build.BRAND.equals("NO OK")&&android.os.Build.PRODUCT.eq uals("HDplus")&&android.os.Build. DEVICE.equals("ovation") boolean isJellyBeanOrLater() { return android.os.Build.SDK_VERSION >= 16; } boolean isNookHD { return android.os.Build.BRAND.equals("NOOK") && android.os.Build.PRODUCT.equals("HDplus") && android.os.Build.DEVICE.equals("ovation"); } 34
  • 93. void disableWAL() { SQLiteDatabase db = getDatabase(); if (db.inTransaction()) { db.endTransaction(); } if (isJellyBeanOrLater() || isNookHD) { db.disableWriteAheadLogging(); } } Example API: SQLiteDatabase.disableWriteAheadLogging() Context: API_level < 16 ∧ Dev_model != "Nook HD" AndroidManifest.xml <uses-sdk android:minSdkVersion="15" /> Slice: db.disableWriteAheadLogging() SQLiteDatabase db = getDatabase() if(isJellyBeanOrLater()||isNookHD) return android.os.Build.SDK_VERSION >= 16 return android.os.Build.BRAND.equals("NO OK")&&android.os.Build.PRODUCT.eq uals("HDplus")&&android.os.Build. DEVICE.equals("ovation") boolean isJellyBeanOrLater() { return android.os.Build.SDK_VERSION >= 16; } boolean isNookHD { return android.os.Build.BRAND.equals("NOOK") && android.os.Build.PRODUCT.equals("HDplus") && android.os.Build.DEVICE.equals("ovation"); } 34
  • 94. Evaluation • Subject apps: latest version of 27 popular, actively-maintained Android apps • Covering 10 different categories • At least 5K downloads App name Category KLOC Rating Downloads ConnectBot Communication 23.0 4.6 1M – 5M AntennaPod Media & Video 65.0 4.5 100K – 500K c:geo Entertainment 78.8 4.4 1M – 5M AnySoftKeyboard Tools 70.7 4.4 1M – 5M … … … … … 35
  • 95. Effectiveness of FicFinder • Configure FicFinder to report both warnings and good practices 36
  • 96. Effectiveness of FicFinder • Configure FicFinder to report both warnings and good practices • FicFinder reported 51 warnings and 79 good practices 36
  • 97. Effectiveness of FicFinder • Configure FicFinder to report both warnings and good practices • FicFinder reported 51 warnings and 79 good practices 46 of the 51 warnings are true positives (Precision: 90.2%) 36
  • 98. Effectiveness of FicFinder • Submitted 14 bug reports • Bug reports included issue-related discussions, API guides and possible fixes in the bug reports to help developers diagnose the issues 37
  • 99. Effectiveness of FicFinder • Submitted 14 bug reports • Bug reports included issue-related discussions, API guides and possible fixes in the bug reports to help developers diagnose the issues 8 of the 14 bug reports were acknowledged by app developers. 5 issues were quickly fixed. 37
  • 100. Usefulness of FicFinder • Knowledge of API-context pairs extracted from our empirical study can be transferred across different apps 38 AnySoftKeyboard Issue 639: Rule originally extracted from K9 Mail K9 Mail Issue 1237: Rule originally extracted from CSipSimple
  • 101. Usefulness of FicFinder • 4 of the 5 fixed issues were fixed by adopting our suggested fixes. Thanks, we will do it as you proposed in out next release. :) Please let us know if you found more of these issues. iSsO (1Sheeld developer) 39
  • 102. Usefulness of FicFinder • 4 of the 5 fixed issues were fixed by adopting our suggested fixes. • The other issue was fixed with an alternative patch, which was semantically equivalent to our suggested one. Thanks, we will do it as you proposed in out next release. :) Please let us know if you found more of these issues. iSsO (1Sheeld developer) 39
  • 103. Conclusion • First large-scale empirical study of Android compatibility issues at code level • API-context pair to model compatibility issues • A static analysis tool, FicFinder, to detect fragmentation-induced compatibility issues 40
  • 104. Future Work • Automate API-context pair extraction • Continue to improve the effectiveness of FicFinder 41
  • 105. Thank you! More information can be found in our paper Or visit FicFinder’s homepage: http://sccpu2.cse.ust.hk/ficfinder/ 41