a toolset for gui testing of android...

10
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

Upload: others

Post on 28-May-2020

72 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Toolset for GUI Testing of Android Applicationswpage.unina.it/ptramont/Download/pres-icsm2012.pdf · A Toolset for GUI Testing of Android Applications Domenico Amalfitano Anna Rita

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

Page 2: A Toolset for GUI Testing of Android Applicationswpage.unina.it/ptramont/Download/pres-icsm2012.pdf · A Toolset for GUI Testing of Android Applications Domenico Amalfitano Anna Rita

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

Page 3: A Toolset for GUI Testing of Android Applicationswpage.unina.it/ptramont/Download/pres-icsm2012.pdf · A Toolset for GUI Testing of Android Applications Domenico Amalfitano Anna Rita

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

Page 4: A Toolset for GUI Testing of Android Applicationswpage.unina.it/ptramont/Download/pres-icsm2012.pdf · A Toolset for GUI Testing of Android Applications Domenico Amalfitano Anna Rita

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

Page 5: A Toolset for GUI Testing of Android Applicationswpage.unina.it/ptramont/Download/pres-icsm2012.pdf · A Toolset for GUI Testing of Android Applications Domenico Amalfitano Anna Rita

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

Page 6: A Toolset for GUI Testing of Android Applicationswpage.unina.it/ptramont/Download/pres-icsm2012.pdf · A Toolset for GUI Testing of Android Applications Domenico Amalfitano Anna Rita

7

Rotate

Press Menu Click Refresh Click New Post

Click Pages

Click About Click Add Account

≡ ≡

Click Edit

Crash

Click Save

… …

An example of GUI

Ripping

Page 7: A Toolset for GUI Testing of Android Applicationswpage.unina.it/ptramont/Download/pres-icsm2012.pdf · A Toolset for GUI Testing of Android Applications Domenico Amalfitano Anna Rita

Android Ripper Technological Details

The Ripper is implemented as an Android JUnit Test Project.

It exploits the Robotium framework and Android Instrumentation classes to interact with the Application Under Test (AUT)

The AUT source code can be instrumented with EMMA to calculate the code covered by the Ripper.

The Saving SnapShot feature offers a mechanism to define the preconditions of the AUT

Strategy

SchedulerComparator

Engine

Persistence

Manager

Storage

Abstractor

Robot Extractor

Application

Under Test

Android

Instrumentation

JUnit

Planner

Robotium

Page 8: A Toolset for GUI Testing of Android Applicationswpage.unina.it/ptramont/Download/pres-icsm2012.pdf · A Toolset for GUI Testing of Android Applications Domenico Amalfitano Anna Rita

Toolset and Testing procedure

The testing procedure executing the Android Ripper is performed automatically using a set of batch and jar files.

Page 9: A Toolset for GUI Testing of Android Applicationswpage.unina.it/ptramont/Download/pres-icsm2012.pdf · A Toolset for GUI Testing of Android Applications Domenico Amalfitano Anna Rita

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. # Events

Ripping Time (hours)

# Bugs # Crashes % LOC Coverage

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

Page 10: A Toolset for GUI Testing of Android Applicationswpage.unina.it/ptramont/Download/pres-icsm2012.pdf · A Toolset for GUI Testing of Android Applications Domenico Amalfitano Anna Rita

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 !