This paper presents a toolset for GUI testing of Android applications. The toolset is centered on a GUI ripper that systematically explores the GUI structure of an application under test with the aim of firing sequences of user events and exposing failures of the application. The toolset supports the execution of a testing procedure that automatically performs crash testing of subject applications and provides test results made of several artifacts. The paper illustrates some examples of using the toolset for testing real Android applications.
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
A Toolset for GUI Testing of Android Applications
1. A Toolset for GUI Testing of
Android Applications
Domenico Amalfitano
Anna Rita Fasolino
Porfirio Tramontana
Salvatore De Carmine
Gennaro Imparato
Dipartimento di Informatica e Sistemistica
University of Naples Federico II, Italy
2. Context and Motivation
Android OS is currently the most diffused platform for
mobile devices [Gartner, 2012 August]
– 98 Millions of Mobile Device sales with Android OS in second quarter
2012
– Android owns 64% of Market Share
Google Play market now includes over than 500,000 apps
– Most of these apps have been developed by small
programmer teams, by evolutionary life cycles
with very frequent releases via Google Play
There is a strong need for fast and effective Testing
automation solutions
2
3. Current Technologies and Tools for
Android Testing
Testing Frameworks for Unit and GUI testing
– Robotium, MonkeyRunner, Calculon, Roboelectric, …
Stress testing Tools such as Monkey
Testing tools from research projects:
– TEMA model-based testing tools [Harty], …
Debugging tools
– DDMS debugging tool from the Android SDK
Monitoring tools
– platforms for monitoring app usages and reporting
app crashes to the developers (like Crittericism) 4
4. Our Proposal: A toolset for automatic
GUI Testing of Android apps
• GUI testing is an effective approach for testing an
app through its GUI, firing sequences of events
and providing it with user inputs
• The proposed GUI testing toolset is based on a
configurable GUI Ripper (Android Ripper) that:
– automatically traverses the GUI firing sequences of
events through the UI or the device (device rotation,
press back button, etc.)
– implements a Black-Box testing approach
– obtains automatically JUnit test cases (usable for
regression testing)
5
5. Android Ripper Features
The Ripper automatically explores the GUI structure
and returns a GUI Tree model
• It can be configured in order to emulate several
kinds of user behaviours, choosing:
• types of event to be fired, input values, time delays
between events, GUI traversing strategy (e.g. depth
first, breadth first, etc.), termination criterion to stop
GUI traversal ...
• It detects runtime crashes (due to unhandled Java
exceptions) and returns the sequences of events
causing them
6. An example
≡ of GUI
Rotate ≡ Ripping
Click Pages
Click
Click Refresh Press Menu
New Post
…
Click Add
Click About
Account
Click Save
… Crash
Click
Edit
7
… …
7. Android Ripper Technological
Details
The Ripper is implemented as an Android
Android JUnit Test Project. Instrumentation Application
Under Test
It exploits the Robotium Robotium
Storage
framework and Android
Instrumentation classes to Robot JUnit Extractor Persistence
Manager
interact with the Application Abstractor
Under Test (AUT) Comparator
Scheduler
The AUT source code can be
instrumented with EMMA to Engine Strategy
calculate the code covered by
the Ripper. Planner
The Saving SnapShot feature
offers a mechanism to define
the preconditions of the AUT
8. Toolset and Testing procedure
The testing procedure executing the Android
Ripper is performed automatically using a set
of batch and jar files.
9. Experiments
We tested some open source apps from Google
Play market using Android Ripper, finding
several unknown bugs (reported to the
developers)
A. U. T. # Ripping # Bugs # Crashes % LOC
Events Time Coverage
(hours)
BookCatalogue 1,677 61 2 9 57
AarDdict 93 2.2 1 5 70
Tomdroid 86 1.25 1 13 39
Wordpress 486 6.16 6 31 43
10. Future Works
• We plan to extend the Ripper :
• By implementing new event firing strategies
• By considering new sources of events (sensors)
and new input selection strategies.
• We will address the technological issues affecting the
Ripper execution on real devices.
• We will be pleased to further explain the
toolset usage in the Tool Bazar !