A GUI Crawling-based technique for Android Mobile Application Testing



Similar documents
A GUI Crawling-based technique for Android Mobile Application Testing

Techniques and Tools for Rich Internet Applications Testing

Industrial Adoption of Automatically Extracted GUI Models for Testing

Reverse Engineering Techniques: from Web Applications to Rich Internet Applications

AndroLIFT: A Tool for Android Application Life Cycles

Industrial Adoption of Automatically Extracted GUI Models for Testing

GUI Testing On Android Application

Developer's Cookbook. Building Applications with. The Android. the Android SDK. A Addison-Wesley. James Steele Nelson To

Synthesis for Developing Apps on Mobile Platforms

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

Android Mobile App Building Tutorial

Android Development. Lecture AD 0 Android SDK & Development Environment. Università degli Studi di Parma. Mobile Application Development

Evaluating the Efficiency of GUI Ripping for Automated Testing of Android Applications

Module Title: Software Development A: Mobile Application Development

Fast remote data access for control of TCP/IP network using android Mobile device

International Journal of Advanced Engineering Research and Science (IJAERS) Vol-2, Issue-11, Nov- 2015] ISSN:

Computing Concepts with Java Essentials

Review of Mobile Applications Testing with Automated Techniques

City of Dublin Education & Training Board. Programme Module for. Mobile Technologies. leading to. Level 6 FETAC. Mobile Technologies 6N0734

CS 528 Mobile and Ubiquitous Computing Lecture 2: Android Introduction and Setup. Emmanuel Agu

Specialized Android APP Development Program with Java (SAADPJ) Duration 2 months

Approach for the automated testing of design requirements on different versions of mobile devices

OpenCV on Android Platforms

INTERMEDIATE ANDROID DEVELOPMENT Course Syllabus

Android Mobile Automation Framework

Università Degli Studi di Parma. Distributed Systems Group. Android Development. Lecture 1 Android SDK & Development Environment. Marco Picone

Introduction to Android: Hello, Android! 26 Mar 2010 CMPT166 Dr. Sean Ho Trinity Western University

Overview of CS 282 & Android

Syllabus Version

Introduction to Android

Android Developer Fundamental 1

DDS-Enabled Cloud Management Support for Fast Task Offloading

Execution and Property Specifications for JPF-Android

SmartCart Design Description

Workshop on Android and Applications Development

Web Application Testing. Web Performance Testing

Android Development: Part One

Java 6 'th. Concepts INTERNATIONAL STUDENT VERSION. edition

Service Discovery with the Google Android Mobile Platform

Getting Started with Android Programming (5 days) with Android 4.3 Jelly Bean

Programming with Android: System Architecture. Dipartimento di Scienze dell Informazione Università di Bologna

Introduction to Android

Wiley Publishing, Inc.

Lecture 1 Introduction to Android

Comparative Study of Automated testing techniques for Mobile Apps

«compl*tc IDIOT'S GUIDE. Android App. Development. by Christopher Froehlich ALPHA. A member of Penguin Group (USA) Inc.

A Short Introduction to Android

Getting Started with Tizen SDK : How to develop a Web app. Hong Gyungpyo 洪 競 杓 Samsung Electronics Co., Ltd

Course Project Documentation

1. Introduction to Android

Development. SriSeshaa Technologies. Table of Contents

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)

Oracle Exam 1z0-599 Oracle WebLogic Server 12c Essentials Version: 6.4 [ Total Questions: 91 ]

Android Development. Marc Mc Loughlin

Presenting Android Development in the CS Curriculum

A Modular Approach to Teaching Mobile APPS Development

ECE 455/555 Embedded System Design. Android Programming. Wei Gao. Fall

Cross Platform Mobile. -Vinod Doshi

Remote Desktop Access through Android Mobiles and Android Mobiles Access through Web Browser

Android Basics. Xin Yang

Mobile App Testing Guide. Basics of Mobile App Testing

Automation Framework for Testing Android Mobiles

ANDROID. Programming basics

Testing Android Apps Through Symbolic Execution

Mastering Mobile Web with 8 Key Rules. Mastering Mobile Web with 8 Key Rules

Graduate presentation for CSCI By Janakiram Vantipalli ( Janakiram.vantipalli@colorado.edu )

MOVEIRO BT-200 Technical Information for Application Developer

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

Contents. Introduction and System Engineering 1. Introduction 2. Software Process and Methodology 16. System Engineering 53

Mobile Device and Technology Characteristics Impact on Mobile Application Testing

Android Application Development - Exam Sample

SoMA. Automated testing system of camera algorithms. Sofica Ltd

ANDROID OPERATING SYSTEM

Desktop, Web and Mobile Testing Tutorials

CELLS A Virtual Mobile Smartphone Architecture

HYBRID APPLICATION DEVELOPMENT IN PHONEGAP USING UI TOOLKITS

Union-Find Algorithms. network connectivity quick find quick union improvements applications

HP AppPulse Mobile. Adding HP AppPulse Mobile to Your Android App

End-User Software Development: Tool Support for Mobile Data Collections

Manjrasoft Market Oriented Cloud Computing Platform

Review of Computer Engineering Research CURRENT TRENDS IN SOFTWARE ENGINEERING RESEARCH

An Introduction to Android

Mobile Phones Operating Systems

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

Table of Contents. Adding Build Targets to the SDK 8 The Android Developer Tools (ADT) Plug-in for Eclipse 9

People centric sensing Leveraging mobile technologies to infer human activities. Applications. History of Sensing Platforms

Android Application Development

Here to take you beyond Mobile Application development using Android Course details

EE289 Lab Fall LAB 4. Ambient Noise Reduction. 1 Introduction. 2 Simulation in Matlab Simulink

Oracle EXAM - 1Z Oracle Weblogic Server 11g: System Administration I. Buy Full Product.

Desi g n Document. Life Monitor. Group Members: Kenny Yee Xiangxiong Shi Emmanuel Panaligan

ANDROID A Workshop on Android Application Development Organized by Computer Science & Engg Dept Lingaya s University

Transcription:

3th International Workshop on TESTing Techniques & Experimentation Benchmarks for Event-Driven Software Berlin, Germany March 21, 2011 A GUI Crawling-based technique for Android Mobile Application Testing University of Naples Federico II, Italy Dipartimento di Informatica e Sistemistica Domenico Amalfitano Anna Rita Fasolino Porfirio Tramontana

Context and Motivations Context: Testing of Android Applications. Motivations: Dealing with open issues in Android testing. Introducing a new GUI based testing approach.

What experts says about Android There should be nothing that users can access on their desktop that they can t access on their cell phone ; Andy Rubin, Guru for Google's Android. Android is predicted to become the second largest mobile Operating System by 2012 and challenge Symbian for the first position by 2014 ; Gartner Newsroom.

What is Android Android is a software stack for mobile devices that includes a Linux-based operating system, middleware and core applications. Is possible to access the stack resources and develop applications on the Android platform using the Java programming language through the tools and the APIs provided by the Android SDK.

Android Devices Android operating system is often installed on smartphone devices that usually have limited hardware resources (like CPU or memory) and a small-sized screen. Equipped with a large number of sensors and communication devices such as a microphone, wi-fi and Bluetooth chips, GPS receiver, single or multi touch screen, inclination sensors, camera, etc.

Android Applications An Android application is composed of several types of Java components instantiated at run-time: Activities, Services, Intents, Broadcast Receivers and Content Providers. Activity component: is responsible for presenting a visual user interface; provides a screen with which the users can interact in order to do something, such as dial the phone, take a photo, send an email, or view a map. An Android application usually includes one or more Activity classes that extend the base Activity class provided by the Android development framework.

Android Applications are EDS The processing in Android applications is eventdriven. Two types of events can be triggered: user events (such as Click, MouseOver, etc.) that can be fired on the user interface items (like Buttons, Menu, etc.); events that are triggered by other input sources, such as GPS receiver, phone, network, etc. Events are handled by Event Handlers. An Event Handler is a piece of code registered to an Event Listener.

Open Issues in Android Testing Are the approaches already available for EDS testing still applicable to Android applications? How the techniques used for EDS testing can be adopted to carry out cost-effective testing processes in the Android platform?

EDS Testing: current approaches EDS testing techniques described in the literature: are based on suitable models of the system or subsystem to be tested (EFG, EIG, or FSM); test cases are derived: exploiting the analysis of user session traces; translating possible sequences of automatically generated events, i.e. generated by a GUI ripper or a Web Crawler.

EDS testing strategies in the context of Android testing In order to take into account the peculiar types of event and input source that are typical of Android devices, an adaptation of the models and strategies for the aims of Android testing is required. As consequence: new reverse engineering and GUI ripping techniques for obtaining the necessary proposed models have to be designed; platforms and tools aiding user session analysis and implementing the proposed GUI ripping techniques have to be developed.

The proposed technique for testing Android applications An automatic testing technique for Android applications, based on a Crawler that simulates real user events on the user interface, is proposed. The Crawler infers automatically a GUI model of the application. The obtained GUI model is used for deriving test cases that can be automatically executed for different aims, in particular: crash testing; regression testing.

The proposed model The model produced by the crawler is actually a GUI Tree, where: the nodes represent the user interfaces of the Android application, the edges describe event-based transitions between nodes.

The GUI Crawler The crawler builds the GUI tree implementing a depth first search using an iterative algorithm. The crawler fires events on the application user interface capturing data about interfaces and events that will be also used to decide the further events to be fired. During the GUI exploration the crawler is able to perform a first crash testing.

Conceptual Model of an Android Application GUI The data analysed by the crawler at run time belong to the conceptual model of an Android GUI:

Critical aspects of a GUI Crawler What s the criterion used for check if two interfaces are equivalent? Two interfaces are equivalent if they have the same Activity Instance attribute and they have the same set of Widgets, with the same Properties and the same Event Handlers. What s the approach used for defining the values of widgets properties and event parameters that must be set before firing a given event? The crawler assigns them random values.

Test case definition The GUI tree is the starting point for obtaining test cases (TC). TC are given by the sequences of events associated with GUI tree paths that link the root node to the leaves of the tree. TC are used to detect crashes and GUI mismatches in regression testing scenarios.

The Testing Tool A tool, named A 2 T 2 (Android Automatic Testing Tool), is developed in Java technology to support the testing technique proposed. A 2 T 2 is composed of two main components: GUI Crawler; Test Case Generator. Both the components: exploit the Robotium framework originally designed for supporting testing of Android applications; are executed in the context of the Android Emulator provided by the Android SDK. Produced test cases are actually Junit test cases.

A screenshot of the tool in execution

Example An example of using the proposed technique and tool for testing a simple Android application that implements a mathematic calculator for the Android 2.2 platform is shown. A GUI tree of the application is obtained by the crawler. During crawling: 19 Events are triggered, 19 Interfaces are obtained, 3 Class of Interfaces are obtained, An exception causing an application crash occurs.

The obtained GUI-Tree Class IC1 IC2 IC3 that comprehends the Interfaces: I1, I6, I13, I2, I7, I14, I3, I8, I4, I10, 15, I5, I17, I11, I9, I18 I12, I16 I19

Crash detection While exploring the GUI interfaces via the crawler some crashes of the application can be discovered. A crash occurs after firing the E18 Event: click on the atan Button on the Interface I13. The crash is caused by the lack of a try/catch code block for handling the exception due to the input of a nonnumeric value in the Input TextEdit widget. This missing cause a java.lang.numberformatexception when the application tries to convert the string in the input field into a Double value before computing the arctangent function. After the correction of this defect, we run the crawler again obtaining a new GUI tree and another instance of Interface (belonging to IC3 group).

Regression Test Cases Test Case Generator produces 17 test cases that correspond to the 17 different paths from the root to the leaves of the obtained GUI tree for the regression testing. In order to assess the effectiveness of the test cases for the aims of regression testing, two faults in the Android application are injected and the 17 regression test cases to find these faults are run.

First injected fault The second injected fault consists in the change of the code of the Scientific Calculator Activity causing an interface without a Button drawn on the screen window. The execution of the test case corresponding to the event sequence E5- E12-E13 revealed an assertion violation and allowed the injected fault to be discovered. The assertion violation is due to a layout difference between the obtained Interface I13 and the corresponding one collected during the previous crawling process, since the new Interface doesn t contain the Button that s included in the original one.

Example of Test Case The Junit Java code of the test case corresponding to the execution of the event sequence E5-E12-E13 that detected the fault is shown. solo is one of the classes that Robotium provides for automatically firing events onto the application. InterfaceComparator is a class that we developed, having a method compare that is used to check the coincidence between interfaces.

Second injected fault The second injected fault consists of associating an incorrect event handler to the click event on the cosine Button instead of the correct one. The execution of the test case corresponding to the event sequence E5-E10 reveals an assertion violation and allows the injected fault to be discovered. The obtained Interface and the one collected during the crawling process are different since they contain different methods associated to the onclicklistener attribute of cosbutton widget.

Discussion We are able to find a fault whose effects are visible or not visible on the GUI. However, the fault detection effectiveness of the technique depends considerably on the strategy used by the crawler for defining the input values needed for firing the events; I.e. a possible fault in the reciprocal function due to an unmanaged exception of a division by zero might be revealed only by a test case with a zero value in the input field; other input generation techniques should be considered in order to solve this problem.

Conclusions A technique for automatic testing of Android mobile applications has been proposed. The technique is inspired to other EDS testing techniques proposed in the literature and relies on a GUI crawler that is used to obtain test cases that reveal application faults like run-time crashes, or that can be used in regression testing. Test cases consist of event sequences that can be fired on the application user interface.

Future Works We plan to carry out an empirical validation of the technique by experiments involving several real world applications with larger size and complexity, with the aim of assessing its cost-effectiveness and scalability in a real testing context. In order to increase the effectiveness of the obtained test suites we intend to investigate further and more accurate techniques for the crawler to generate several kinds of input values, including both random and specific input values depending on the considered type of widget. Solutions for managing test case preconditions and postconditions related to persistent data sources (such as files, databases, Shared Preferences objects, remote data sources) will be looked for.

Thank you for your attention!!!