The document summarizes challenges in automated GUI testing of Android apps and potential solutions. It discusses essential challenges such as designing test oracles that work across devices and coordinating event timing. It also discusses accidental challenges like ensuring clean application data and dealing with bugs in frameworks and tools. Solutions proposed include using screen hierarchy hashes as oracles, real usage data for external dependencies, clearing app data between tests, and modifying framework components in AOSP.
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Automated GUI-Testing of Android Apps: From Research to Practice
1. ICSME16
Raleigh, NC
Wednesday, October 5th, 2016
Kevin Moran,
Mario Linares-Vásquez,
& Denys Poshyvanyk
College of William & Mary - SEMERU - Department of Computer Science
Automated GUITesting of Android
Apps: From Research to Practice
&
15. Mobile App Dev Challenges
• Rapid platform (and third-party lib) evolution
• API-instability and fault-proneness
• Influx of unstructured (“low quality”) user reviews
• Platform-fragmentation at device and OS level
• Quality attributes (performance, energy) and
inputs (sensors, camera, WiFi etc.)
17. Study: mining of code changes
history (5,848 apps); survey with 45
developers
Method: descriptive statistics,
statistical hypothesis testing, and
open coding
Main findings:
- Successful apps use more stable and bug
free APIs
- APIs issues are perceived by users as app
programming issues
- Lack of tools for identifying API issues and
their impact on a new API release
Android (andThird Party library) Instability
19. Mobile AppTesting Challenges
• Highly event-driven, gesture based nature of apps
• Lack of effective automated input generation
• Lack of robust (semi) automated testing and
monitoring tools
• Lack of support for debugging apps and bug
reporting
Joorabchi, M.E.; Mesbah, A.; Kruchten, P., "Real Challenges in Mobile App Development," in Empirical Software
Engineering and Measurement, 2013 ACM / IEEE International Symposium on , vol., no., pp.15-24, 10-11 Oct. 2013
40. Pros and Cons
R&R ✓Easy reproduction - Expensive collection
and maintenance
- Coupled to locations
MBT ✓ Event sequences
✓ Automatic exploration
- Invalid sequences (a-
priori model)
- Few corner cases
- Use cases are not
considered
- Manual execution
- Incomplete models
41. Pros and Cons
R&R ✓Easy reproduction - Expensive collection
and maintenance
- Coupled to locations
MBT ✓ Event sequences
✓ Automatic exploration
- Invalid sequences (a-
priori model)
- Few corner cases
- Use cases are not
considered
- Manual execution
- Incomplete models
Rippers
- Lack of context
- No history awareness
45. Pros and Cons
R&R ✓ Easy reproduction - Expensive collection
and maintenance
- Coupled to locations
MBT ✓ Event sequences
✓ Automatic exploration
- Invalid sequences (a-
priori model)
- Few corner cases
- Use cases are not
considered
- Manual execution
- Incomplete models
Rippers
- Lack of context
- No history awareness
R/FT ✓ Fast execution
✓ Good at finding crashes
- Invalid events
- Lack of expressiveness
48. Pros and Cons
R&R ✓ Easy reproduction
- Expensive collection
and maintenance
- Coupled to locations
MBT ✓ Event sequences
✓ Automatic exploration
- Invalid sequences (a-priori
model)
- Few corner cases
- Use cases are not considered
- Manual execution
- Incomplete models
Rippers
- Lack of context
- No history awareness
R/FT ✓ Fast execution
✓ Good at finding crashes
- Invalid events
- Lack of expressiveness
AF/A ✓ Easy reproduction
✓ High level syntax
✓ Black box testing
- Learning curve
- User-defined oracles
- Expensive maintenance
49. RESEARCH PROTOTYPES
Tool Name Instrumentation GUI Exploration Types of Events
Replayable Test
Cases
Emulators, Devices
Dynodroid Yes Guided/Random System, GUI, Text No No
EvoDroid No System/Evo GUI No N/A
AndroidRipper Yes Systematic GUI, Text No N/A
MobiGUItar Yes Model-Based GUI, Text Yes N/A
A3E Depth-First Yes Systematic GUI No Yes
A3E Targeted Yes Model-Based GUI No Yes
Swifthand Yes Model-Based GUI, Text No Yes
PUMA Yes Programmable System, GUI, Text No Yes
ACTEve Yes Systematic GUI No Yes
VANARSena Yes Random System, GUI, Text Yes N/A
Thor Yes Test Cases Test Case Events N/A No
QUANTUM Yes Model-Based System, GUI Yes N/A
AppDoctor Yes Multiple System, GUI2, Text Yes N/A
ORBIT No Model-Based GUI No N/A
SPAG-C No Record/Replay GUI N/A No
JPF-Android No Scripting GUI Yes N/A
MonkeyLab No Model-based GUI, Text Yes Yes
CrashDroid No Manual Rec/Replay GUI, Text Yes Yes
SIG-Droid No Symbolic GUI, Text Yes N/A
CrashScope No Systematic GUI, Text, System Yes Yes
Sapienz Yes Evolutionary GUI, Text,System Yes Yes
55. Tools: Summary
Testing Automation Frameworks/APIs
Crowdsourced Testing/Cloud-based Testing
Record and Replay
Monkey (Fuzz testing) ✓ Unexpected scenarios
- Reproducibility/Expressiveness
56. Tools: Summary
Testing Automation Frameworks/APIs
Crowdsourced Testing/Cloud-based Testing
Record and Replay
✓ Easy reproduction
✓ Automation on different devices
- Test scripts maintenance
- Learning curve
Monkey (Fuzz testing) ✓ Unexpected scenarios
- Reproducibility/Expressiveness
57. Tools: Summary
Testing Automation Frameworks/APIs
Crowdsourced Testing/Cloud-based Testing
Record and Replay
✓ Automation on different devices
✓ Similar to manual testing
- Test scripts maintenance
✓ Easy reproduction
✓ Automation on different devices
- Test scripts maintenance
- Learning curve
Monkey (Fuzz testing) ✓ Unexpected scenarios
- Reproducibility/Expressiveness
58. Tools: Summary
Testing Automation Frameworks/APIs
Crowdsourced Testing/Cloud-based Testing
Record and Replay
- Open Source vs Paid
✓ Large set of devices
✓ Remote data collection
✓ Support automation frameworks
✓ Automation on different devices
✓ Similar to manual testing
- Test scripts maintenance
✓ Easy reproduction
✓ Automation on different devices
- Test scripts maintenance
- Learning curve
Monkey (Fuzz testing) ✓ Unexpected scenarios
- Reproducibility/Expressiveness
60. Supporting evolution and
maintenance of
Android apps
Mining Android
Software
Repositories
Android API instability
[FSE’13][TSE’15]
Performance
bottlenecks [ICSME’15]
[MSR’16]
User reviews [ICSME’15]
Energy [MSR’14]
61. Supporting evolution and
maintenance of
Android apps
Mining Android
Software
Repositories
Android API instability
[FSE’13][TSE’15]
Performance
bottlenecks [ICSME’15]
[MSR’16]
User reviews [ICSME’15]
Energy [MSR’14]
Crowdsource-based
requirements
[ICSME’15]
GUI - based testing
[MSR’15]
Bug reporting [FSE’15]
Optimizing energy
consumption [FSE’15]
62. SEMERUTools: Monkey Lab
• Testing approach based on natural usages of
an application.
• Models usage using n-gram language models to
produce unseen yet natural event sequences.
• Capable of generating orthogonal test cases
to those already modeled.
63. SEMERUTools: Monkey Lab
• Testing approach based on natural usages of
an application.
• Models usage using n-gram language models to
produce unseen yet natural event sequences.
• Capable of generating orthogonal test cases
to those already modeled.
64. SEMERUTools: FUSION
www.fusion-android.com
• Novel Bug Reporting System for GUI-based
and mobile apps
• Uses a combination of static and dynamic
analysis to help inform the reporting process
• Uses auto-completion to ease the burden on
reporters and ensure high-quality reports.
65. SEMERUTools: FUSION
www.fusion-android.com
• Novel Bug Reporting System for GUI-based
and mobile apps
• Uses a combination of static and dynamic
analysis to help inform the reporting process
• Uses auto-completion to ease the burden on
reporters and ensure high-quality reports.
66. SEMERUTools: CRASHSCOPE
• Completely automated testing approach for Android apps
• Generates detailed, expressive bug reports and repayable
scripts
• A practical tool, requiring no instrumentation framework, or
modification to the OS or applications
• Capable of running on both physical devices and emulators
• Differing execution strategies able to test contextual features
67. SEMERUTools: CRASHSCOPE
• Completely automated testing approach for Android apps
• Generates detailed, expressive bug reports and repayable
scripts
• A practical tool, requiring no instrumentation framework, or
modification to the OS or applications
• Capable of running on both physical devices and emulators
• Differing execution strategies able to test contextual features
68. SEMERUTools: CRASHSCOPE
• Completely automated testing approach for Android apps
• Generates detailed, expressive bug reports and repayable
scripts
• A practical tool, requiring no instrumentation framework, or
modification to the OS or applications
• Capable of running on both physical devices and emulators
• Differing execution strategies able to test contextual features
71. Essential Challenges in Mobile GUITesting
Essential Challenges
Test Oracles: How does one design an extensible GUI- based
oracle that can be used to verify expected application behavior
across different device configurations?
Event Coordination: In automated GUI-based testing, deciding the
proper timing of firing events on a device is challenging.
External Features: How can external features such as notifications
be properly incorporated into large-scale testing of mobile apps?
External Dependencies: Many mobile apps use external servers or
databases in order to send, store, and receive information. How can
these dependencies be appropriately incorporated into large-scale
testing?
72. Essential Challenges in Mobile GUITesting
Essential Challenges
Test Oracles: How does one design an extensible GUI- based
oracle that can be used to verify expected application behavior
across different device configurations?
Event Coordination: In automated GUI-based testing, deciding the
proper timing of firing events on a device is challenging.
External Features: How can external features such as notifications
be properly incorporated into large-scale testing of mobile apps?
External Dependencies: Many mobile apps use external servers or
databases in order to send, store, and receive information. How can
these dependencies be appropriately incorporated into large-scale
testing?
73. Accidental Challenges in Mobile GUITesting
Accidental Challenges
Application Data and Cold Starts: How can one ensure a sterile or
desired testing environment within the context of large scale
testing?
Bugs in Framework Utilities: There exist certain limitations with
core Android Frameworks popular with GUI-testing.
Bugs and Limitations in the SDK Tools: There are limitations
inherent to Android developer tools, such as adb, that make
large-scale parallel execution and testing difficult.
Challenges Scaling Concurrent Virtual Devices: Android emulators
were not designed to scale well on modest hardware.
74. Accidental Challenges in Mobile GUITesting
Accidental Challenges
Application Data and Cold Starts: How can one ensure a sterile or
desired testing environment within the context of large scale
testing?
Bugs in Framework Utilities: There exist certain limitations with
core Android Frameworks popular with GUI-testing.
Bugs and Limitations in the SDK Tools: There are limitations
inherent to Android developer tools, such as adb, that make
large-scale parallel execution and testing difficult.
Challenges Scaling Concurrent Virtual Devices: Android emulators
were not designed to scale well on modest hardware.
75. Essential Challenges:Test Oracles
Potential Solution: Use a hash of the current screen hierarchy
Drawbacks: May miss some fined grained information about the
GUI (e.g. colors, images)
76. Essential Challenges:Test Oracles
Potential Solution: Use a hash of the current screen hierarchy
adb shell shell /system/bin/uiautomator
dump /sdcard/ui_dump.xml
Drawbacks: May miss some fined grained information about the
GUI (e.g. colors, images)
94. Enabling Large Scale Analysis: Execution Engine
✓Support for multiple
maintenance tasks
✓Open/Closed principle
✓Horizontal/Vertical scalability
✓Asynchronous communication
between clients and execution
engine
✓Support for fragmentation
Message bus
Execution Engine
Virtual devices (Pool)
95. Enabling Large Scale Analysis: Execution Engine
Dispatcher
Worker
Task
Device/VM/
Thread
token
Task, Device/VM/
Thread token
Task status,
response
Task status
- Task-specific
frameworks
- Third party libraries
<<invokes>>
Client i
Message Bus
Local DB
Client-specific
technologies
Request
(i.e., new Task)
Web folder or
Content Delivery
Network
Images,
files, etc.Images,
files, etc.
Response (i.e.,
Task results
and status)
Execution Engine (EE)
EE Settings
Devices/VMs
pool
Background
Threads pool
Clients
Client n
96. Enabling Large Scale Analysis: Execution Engine
Dispatcher
Worker
Task
Device/VM/
Thread
token
Task, Device/VM/
Thread token
Task status,
response
Task status
- Task-specific
frameworks
- Third party libraries
<<invokes>>
Client i
Message Bus
Local DB
Client-specific
technologies
Request
(i.e., new Task)
Web folder or
Content Delivery
Network
Images,
files, etc.Images,
files, etc.
Response (i.e.,
Task results
and status)
Execution Engine (EE)
EE Settings
Devices/VMs
pool
Background
Threads pool
Clients
Client n