PUMA: Programmable UI Automation for Large-Scale Dynamic Analysis of Mobile Apps
Shuai Hao, Bin Liu, Suman Nath, William G.J. Halfond, Ramesh Govindan
PUMA: Programmable UI Automation for Large-Scale Dynamic Analysis of - - PowerPoint PPT Presentation
PUMA: Programmable UI Automation for Large-Scale Dynamic Analysis of Mobile Apps Shuai Hao, Bin Liu, Suman Nath, William G.J. Halfond, Ramesh Govindan 2 Mobile App Explosion 1.2 million 1,200,000 1,000,000 Number of Apps 800,000 600,000
Shuai Hao, Bin Liu, Suman Nath, William G.J. Halfond, Ramesh Govindan
2 200,000 400,000 600,000 800,000 1,000,000 1,200,000
Number of Apps
Source: http://en.wikipedia.org/wiki/Google_Play
3
Source: forbes.com Source: droidforums.net Source: zdnet.com
4
Source: http://mttnow.com/ios-automated-ui-testing
5
6
7
8
Page Text Image List Button Button
Button Click Multipage Scroll Scroll List Action Dictionary
Click “Continue” Button
UI Action
The set of previously visited pages
Decide UI Action
Monkey
UI Extraction Channel UI Action Channel
9
AMC
MobiSys’13
DECAF
NSDI’14
SmartAds
MobiSys’13
VanarSena
MobiSys’14
CODASPY’13
ContextualFuzzing
MSR-TR’13
Check accessibility of UI elements Check ad violation on each page Deliver ad based on page content Test whether app crashes Detect privacy leak and malware Test app crash and performance issue
10
11
12
13
14
SmartAds Page Content Monkey DECAF Ad Fraud Monkey AMC UI Property Monkey
15
UI Property Monkey AMC Ad Fraud Monkey DECAF Page Content Monkey SmartAds Programmable Monkey API UI Property Ad Fraud Page Content
events events events
16
System AMC DECAF SmartAds A
3
E Apps Playground VanarSena Contextual Fuzzing Exploration Target
Distinct Distinct All Distinct Distinct Distinct All
Page
UI UI UI UI UI, text UI, text UI
Transition Property Checked
Accessibility Ad layout Page content None Info flow Crash Crash, perf .
Action Taken
fault Change context
Required Instrumentation
No No Yes Yes Yes Yes No
17
18
Go to initial page Pick a clickable UI element Perform click, user input Effect environment changes, if needed Wait for page done Check page equivalence Need continue Next Click Modify environment In-line Analysis State Equivalence Terminating App Text Input App-specific Events
19
System AMC DECAF SmartAds A
3
E Apps Playground VanarSena Contextual Fuzzing Exploration Target
Distinct Distinct All Distinct Distinct Distinct All
Page
UI UI UI UI UI, text UI, text UI
Transition Property Checked
Accessibility Ad layout Page content None Info flow Crash Crash, perf .
Action Taken
fault Change context
Required Instrumentation
No No Yes Yes Yes Yes No
State Equivalence Next Click Text Input In-line Analysis Modify environment App-specific Events
20
<described later>
21
<described later>
22
23
Next Click
<described later>
24
25
App-specific Events
…
26
for Mobile Applications.” In ACM MobiSys, 2013.
27
PUMAScript Original App Instrumented App
28
29
30
31
Accessibility Violation Detection Check accessibility of UI elements Content-based App Search Crawl in-app data for search engine UI Structure Classifier Classify apps based on UI structure Ad Fraud Detection Detect ads placement violation Network Usage Profiler Profile in-app HTTP traffic use Permission Usage Profiler Profile in-app permission usage Stress Testing Inject null HTTP response for test
32
Accessibility Violation Detection Content-based App Search UI Structure Classifier Ad Fraud Detection Network Usage Profiler Permission Usage Profiler Stress Testing
33
Study Task PUMAScript (LOC) User Code (LOC) Accessibility violation detection 11 60 Content-based app search 14 UI structure classifier 11 Ad fraud detection 11 52 Network usage profiler 19 8 Permission usage profiler 20 5 Stress testing 16 5
34 UI Property Monkey API Ad Fraud Monkey API Page Content Monkey API
Computing Resources
crawl page content
35 UI Property Monkey API Ad Fraud Monkey API Page Content Monkey API
36
Accessibility Violation Detection Content-based App Search UI Structure Classifier Ad Fraud Detection Network Usage Profiler Permission Usage Profiler Stress Testing Accessibility Violation Detection Content-based App Search Check accessibility of UI elements Crawl in-app data for search engine Classify apps based on UI structure Detect ads placement violation Profile in-app HTTP traffic use Profile in-app permission usage Inject null HTTP response for test Check accessibility of UI elements Crawl in-app data for search engine
37
for Vehicular Applications.” In ACM MobiSys’13. Start Stop Start Stop
Start
Scrolling Button Distance Button Size Word Count
38
500 1000 1500 2000 2500 user action per task word count button size button distance scrolling
39
40 App 1 How to Draw Singers 2 Love Frames for Free 3 How to Draw Celebrities 4 U-Meme 5 Collage Free 6 Your Voice App 1 MixerBox 2 Shane Dawson Episodes 3 Hits Music Ringback Tone 4 Mobo Movie News & Stars 5 Mobo Fashion Trends & Deals 6 How to Draw Singers … … 19 Rangers
Name Name + Desc. Name + Desc. + In-app Data
App By PUMA
41
Search Index Mean Median Name 8.31 3 Name + Desc. 199.43 66 Name + Desc. + In-app Data 300.37 131
Separates exploration and analysis logic Incorporates a generic monkey Exposes event driven programming abstractions
42
https://github.com/USC-NSL/sif https://github.com/USC-NSL/puma