SlideShare a Scribd company logo
1 of 14
Using GUI Ripping for Automated
    Testing of Android Apps

                   Domenico Amalfitano
                   Salvatore De Carmine
                     Anna Rita Fasolino
                    Porfirio Tramontana
               Dipartimento di Informatica e Sistemistica
                 University of Naples Federico II, Italy


                           Atif Memon
                   Department of Computer Science
                        University of Maryland
Motivation
   Android is a very popular operative system and framework for
    mobile devices
        Its diffusion is increasing: recently it overtook ioS and Symbian in terms of
         diffusion
        Over than 500,000 apps are now on the Google Play market
        The most part of the apps are realized by single programmers or little teams and
         lacks in quality

   Android apps are often developed according to an evolutionary life
    cycle, with very frequent releases via Google Play
        Bugs causing failures and, in particular, crashes are very common


   There is a strong need for testing automation processes
    and tools
        In this talk, our techniques and tool supporting a process of Android
         GUI Testing Automation will be presented

Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012                             2
Android apps
   An Android application is composed of several types of Java
    components instantiated at run-time:
        Activities, Services, Intents, Broadcast Receivers and Content Providers.
   An Activity component:
        is responsible for presenting a visual user interface;
        provides a screen with which the users can interact in order to do
         something.
   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 Event-Driven Systems
        Three types of events can be triggered:
            user events (such as Click, MouseOver, etc.);

            events related to the lifecycle of the Activity classes

                  onStart, on Pause, onResume, onStop, onDestroy, …

            events that are triggered by other input sources

                  such as GPS receiver, phone, network, etc.



Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012                           3
Existing approaches to Android Testing Automation

     JUnit Testing
           Android Testing Framework
                 Supports the coding of executable test classes
                        Classes supporting the instrumentation and monitoring of Android apps are provided in the
                         Android framework itself
                        Libraries such as Robotium and Monkeyrunner extends the framework



     Random Testing
           Monkey (included in the Android framework) supports the randomly
            automatic exploration of Android apps


     Model Based Testing
           TEMA Tools (Takala, Katara, Harty, 2011) represent a first tentative of
            approach for the generation of test code from a design model of
            Android app

    Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012                                                       4
Android GUI Ripping

   We propose a technique and a tool for:
        Automatic exploration of the GUI of an
         Android application via a systematic Ripping
         approach
              Similar to approaches adopted for Web crawling
        Crash testing
        GUI model reverse engineering
        JUnit test case generation

Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012      5
Android GUI Ripping Algorithm

   Customizable
        Selection of types of events to be fired
        Adoption of a GUI traversing strategy (e.g. depth first, breadth first, etc.)
        Termination criteria used to stop the GUI traversal
        Setting of specific preconditions

   Efficient
        Provides heuristic solutions to the well known problem of GUI interface
         states and events explosion
            GUI exploration criteria based on a Interface Equivalence Criterion




Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012                         6
Ripping
                          ≡                                                    Algorithm
                      Rotate                ≡                                 Click Pages
                             Click
                                       Click Refresh          Press Menu                    1.    Task List Initialization;
1.                           New Post
      Task List Initialization;                                                             2.
                                                                                                  while (Task List Is Not
                                                                                                  Empty) {
2.
      while (Task List Is Not Empty) {                                                                 Extract a Task From The
                                                                                            3.

                                                                                                  Task List;
3.
          Extract a Task From The Task List;                                                           Execute the Task;
                                                                                            4.

                                                                                            5.         Abstract the Current GUI
                                                                                                  Abstract State;
4.
          Execute the Task;
                                                                      …                                Update the GUI Tree
                                                                                            6.

                                                                                                  Model;
5.
          Abstract the Current GUI Abstract                                                 7.
                                                                                                      if (GUI Exploration
                                                                                                  Criterion) then {
      State;                                                                                8.
                                                                                                           Define New Tasks ;
                                                                                            9.
                                                                                                           Add New Tasks To
6.
          Update the GUI Tree Model;                                                              The Task List;
                                                                                            10.
                                                                                                       }
7.
          if (GUI Exploration Criterion) then                     Click Add                 11.
                                                                                                  }

      {                                                                             Click About
                                                                  Account
8.                       Click Save
                  Define New Tasks ;
9.
                  Add New Tasks To The Task
      List;

                               …
10.
              }
                                                                                                           Crash
11.
      }
                                                                                            Click
                                                                                            Edit
                                                                                                                     7
                  …                                           …
 Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012
Crash Testing Process

   Preconconditions are set
    by generating a Snapshot
    Image of the device for
    the emulator
   In the task execution step,
    the GUI Ripping algorithm
    is executed

Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012   8
A Demonstrational example

   Android for Wordpress                                       Measured metrics
        A Wordpress client for                                     Effectiveness
         Android                                                       Number of crashes
                                                                         found
              334 classes, ~10,000 LOCs
                                                                       Number of different
              More than 250,000 downloads
                                                                         bugs causing crashes
        A set of three preconditions                                  LOCs coverage
              No Login
              Single Blog                                          Efficiency
              Multiple Blogs                                          Number of test cases

        Comparison between                                            Number of events

         Ripping and Random                                            Ripping time

         Testing with Monkey
Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012                                  9
Results
                                                 Preconditions
                             No Login             Single Blog    Multiple Blog   Random
                                                                                 (Single Blog)
        #Crashes                     0                       6         8               3

        #Bugs                        0                       3         4               1

        LOC Cov %                  2.65                 39.32        37.83          25.27
        Time (h)                    0.2                  4.88        4.58            4.46

        #TC                          18                  166         166               -

        #Events                      36                  517         502            14400




Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012                                  10
Bugs and Crashes

   The 14 crashes                                           Id      Crash Description       Java
                                                                                           Exception
                                                                                                           Ticket and
                                                                                                           Changeset

    found by the Ripping                                     B1 The app crashes trying StringIndex https://android.tra

    process belongs to
                                                                to opening the default OutOfBoun c.wordpress.org/tic
                                                                post “Hello World”         dException       ket/206
                                                                                                      https://android.tra
    four different bugs                                                                               c.wordpress.org/ch
                                                                                                      angeset/398

        Bugs have been                                      B2 The app crashes when BadTokenE https://android.tra
                                                                the Stats activity is xception        c.wordpress.org/tic

         submitted to the bug                                   rapidly     opened
                                                                closed (via the Back
                                                                                       and                  ket/208
                                                                                                      https://android.tra
         tracking system and                                    key).                                 c.wordpress.org/ch
                                                                                                      angeset/420
         accepted/fixed by the                               B3 The app crashes when NullPointerE https://android.tra
                                                                the Stats activity is open xception   c.wordpress.org/tic
         programmer                                             and the Refresh button
                                                                is clicked while the
                                                                                                      ket/212
                                                                                                      https://android.tra

   Monkey was able to                                          progress bar widget is
                                                                still loading.
                                                                                                      c.wordpress.org/ch
                                                                                                      angeset/423

    find only one of                                         B4 The app crashes when NullPointerE https://android.tra
                                                                the user opens a post xception    c.wordpress.org/tic

    these bugs
                                                                and tries to share it                   ket/218
                                                                within his blog. The              https://android.tra
                                                                crash occurs when there           c.wordpress.org/ch
                                                                is a single blog in the           angeset/446
                                                                app.


Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012                                                        11
Conclusions and Future Works

   Our technique supports the execution of
    completely automatic generation and execution
    of test cases for Android applications.
    In our preliminary demonstration example:
        Real bugs and crashes have been detected;
        Good level of code coverage has been reached;
        Testing time is compatible with smoke testing
         processes;
        Reusable test cases has been automatically generated;
        Our technique demonstrates its effectiveness with
         respect to standard Random testing tools such as
         Monkey

Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012   12
Future Works
   This presentation covers the first part of a larger
    project on testing automation of Android
    applications
   Some future works
        Publication of the tool
              As a standalone tool
              As a service
                     A preliminary demo is available at
                      http://wpage.unina.it/ptramont/GUIRipperWiki.htm
        Further experiments with more applications and
         ripping parameters
              Delay Time, ripping strategy (depth first/breadth first, activity
               equivalence criteria, maximum depth), input generation
               strategies, …
        Sensor event testing
Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012                   13
Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012   14

More Related Content

What's hot

How to Learn The History of Software Testing
How to Learn The History of Software Testing How to Learn The History of Software Testing
How to Learn The History of Software Testing
Keizo Tatsumi
 

What's hot (7)

Dagger for android
Dagger for androidDagger for android
Dagger for android
 
How to Learn The History of Software Testing
How to Learn The History of Software Testing How to Learn The History of Software Testing
How to Learn The History of Software Testing
 
The History of Software Testing
The History of Software TestingThe History of Software Testing
The History of Software Testing
 
A distinct approach for xmotif application gui test automation
A distinct approach for xmotif application gui test automationA distinct approach for xmotif application gui test automation
A distinct approach for xmotif application gui test automation
 
A GUI Crawling-based Technique for Android Mobile Application Testing
A GUI Crawling-based Technique for Android Mobile Application TestingA GUI Crawling-based Technique for Android Mobile Application Testing
A GUI Crawling-based Technique for Android Mobile Application Testing
 
Stamp Project presentation at OW2con'17
Stamp Project presentation at OW2con'17Stamp Project presentation at OW2con'17
Stamp Project presentation at OW2con'17
 
Hp Quick Test Professional
Hp Quick Test ProfessionalHp Quick Test Professional
Hp Quick Test Professional
 

Viewers also liked

Appium Mobile Test Automation like WebDriver
Appium Mobile Test Automation like WebDriverAppium Mobile Test Automation like WebDriver
Appium Mobile Test Automation like WebDriver
Andrii Dzynia
 

Viewers also liked (11)

A guide to Android automated testing
A guide to Android automated testingA guide to Android automated testing
A guide to Android automated testing
 
Implementing Test Automation in Agile Projects
Implementing Test Automation in Agile ProjectsImplementing Test Automation in Agile Projects
Implementing Test Automation in Agile Projects
 
Mobile automation – should I use robotium or calabash or appium?
Mobile automation – should I use robotium or calabash or appium?Mobile automation – should I use robotium or calabash or appium?
Mobile automation – should I use robotium or calabash or appium?
 
Applied Testing Heuristics in the Context of eBay
Applied Testing Heuristics in the Context of eBayApplied Testing Heuristics in the Context of eBay
Applied Testing Heuristics in the Context of eBay
 
Android Test Automation – one year later
Android Test Automation – one year laterAndroid Test Automation – one year later
Android Test Automation – one year later
 
Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?
 
Choosing the Best Open Source Test Automation Tool for You
Choosing the Best Open Source Test Automation Tool for YouChoosing the Best Open Source Test Automation Tool for You
Choosing the Best Open Source Test Automation Tool for You
 
Boston meetup blaze_meter_feb2017
Boston meetup blaze_meter_feb2017Boston meetup blaze_meter_feb2017
Boston meetup blaze_meter_feb2017
 
Appium Mobile Test Automation like WebDriver
Appium Mobile Test Automation like WebDriverAppium Mobile Test Automation like WebDriver
Appium Mobile Test Automation like WebDriver
 
Automated testing for Android application
Automated testing for Android applicationAutomated testing for Android application
Automated testing for Android application
 
淺談 Model based testing 與 graphwalker 導入心得 20160127
淺談 Model based testing 與 graphwalker 導入心得 20160127淺談 Model based testing 與 graphwalker 導入心得 20160127
淺談 Model based testing 與 graphwalker 導入心得 20160127
 

Similar to Using GUI Ripping for Automated Testing of Android Apps

"APE: Learning User's Habits to Automate Repetitive Tasks"
"APE: Learning User's Habits to Automate Repetitive Tasks""APE: Learning User's Habits to Automate Repetitive Tasks"
"APE: Learning User's Habits to Automate Repetitive Tasks"
butest
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through Activities
Ahsanul Karim
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through Activities
Ahsanul Karim
 
Functional Requirements Of System Requirements
Functional Requirements Of System RequirementsFunctional Requirements Of System Requirements
Functional Requirements Of System Requirements
Laura Arrigo
 
Slot04 creating gui
Slot04 creating guiSlot04 creating gui
Slot04 creating gui
Viên Mai
 
Gui path oriented test generation algorithms paper
Gui path oriented test generation algorithms paperGui path oriented test generation algorithms paper
Gui path oriented test generation algorithms paper
Izzat Alsmadi
 
Eclispe daytoulouse combining the power of eclipse with android_fr_1024_768_s...
Eclispe daytoulouse combining the power of eclipse with android_fr_1024_768_s...Eclispe daytoulouse combining the power of eclipse with android_fr_1024_768_s...
Eclispe daytoulouse combining the power of eclipse with android_fr_1024_768_s...
Mathias Seguy
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recievers
Jagdish Gediya
 
Android training in cochin android training in kochi android training in kera...
Android training in cochin android training in kochi android training in kera...Android training in cochin android training in kochi android training in kera...
Android training in cochin android training in kochi android training in kera...
zybotechsolutions
 

Similar to Using GUI Ripping for Automated Testing of Android Apps (20)

"APE: Learning User's Habits to Automate Repetitive Tasks"
"APE: Learning User's Habits to Automate Repetitive Tasks""APE: Learning User's Habits to Automate Repetitive Tasks"
"APE: Learning User's Habits to Automate Repetitive Tasks"
 
20051019 automating regression testing for evolving gui software
20051019 automating regression testing for evolving gui software20051019 automating regression testing for evolving gui software
20051019 automating regression testing for evolving gui software
 
Android application development
Android application developmentAndroid application development
Android application development
 
Android
AndroidAndroid
Android
 
Testing
Testing Testing
Testing
 
[PBO] Pertemuan 12 - Pemrograman Android
[PBO] Pertemuan 12 - Pemrograman Android[PBO] Pertemuan 12 - Pemrograman Android
[PBO] Pertemuan 12 - Pemrograman Android
 
Dori waldman android _course_2
Dori waldman android _course_2Dori waldman android _course_2
Dori waldman android _course_2
 
Architecting Single Activity Applications (With or Without Fragments)
Architecting Single Activity Applications (With or Without Fragments)Architecting Single Activity Applications (With or Without Fragments)
Architecting Single Activity Applications (With or Without Fragments)
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through Activities
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through Activities
 
Functional Requirements Of System Requirements
Functional Requirements Of System RequirementsFunctional Requirements Of System Requirements
Functional Requirements Of System Requirements
 
Slot04 creating gui
Slot04 creating guiSlot04 creating gui
Slot04 creating gui
 
Continuous testing - GUERLAIS ARGOT - Air France KLM Sogeti- Soirée du Test L...
Continuous testing - GUERLAIS ARGOT - Air France KLM Sogeti- Soirée du Test L...Continuous testing - GUERLAIS ARGOT - Air France KLM Sogeti- Soirée du Test L...
Continuous testing - GUERLAIS ARGOT - Air France KLM Sogeti- Soirée du Test L...
 
Gui path oriented test generation algorithms paper
Gui path oriented test generation algorithms paperGui path oriented test generation algorithms paper
Gui path oriented test generation algorithms paper
 
Eclispe daytoulouse combining the power of eclipse with android_fr_1024_768_s...
Eclispe daytoulouse combining the power of eclipse with android_fr_1024_768_s...Eclispe daytoulouse combining the power of eclipse with android_fr_1024_768_s...
Eclispe daytoulouse combining the power of eclipse with android_fr_1024_768_s...
 
Dori waldman android _course
Dori waldman android _courseDori waldman android _course
Dori waldman android _course
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recievers
 
Android training in cochin android training in kochi android training in kera...
Android training in cochin android training in kochi android training in kera...Android training in cochin android training in kochi android training in kera...
Android training in cochin android training in kochi android training in kera...
 
Ex11 mini project
Ex11 mini projectEx11 mini project
Ex11 mini project
 
Dive into Angular, part 5: Experience
Dive into Angular, part 5: ExperienceDive into Angular, part 5: Experience
Dive into Angular, part 5: Experience
 

More from Porfirio Tramontana

Towards the Generation of Robust E2E Test Cases in Template-based Web Applica...
Towards the Generation of Robust E2E Test Cases in Template-based Web Applica...Towards the Generation of Robust E2E Test Cases in Template-based Web Applica...
Towards the Generation of Robust E2E Test Cases in Template-based Web Applica...
Porfirio Tramontana
 
Using Dynamic Analysis for Generating End User Documentation for Web 2.0 Appl...
Using Dynamic Analysis for Generating End User Documentation for Web 2.0 Appl...Using Dynamic Analysis for Generating End User Documentation for Web 2.0 Appl...
Using Dynamic Analysis for Generating End User Documentation for Web 2.0 Appl...
Porfirio Tramontana
 
Reverse Engineering Finite State Machines from Rich Internet Applications
Reverse Engineering Finite State Machines from Rich Internet ApplicationsReverse Engineering Finite State Machines from Rich Internet Applications
Reverse Engineering Finite State Machines from Rich Internet Applications
Porfirio Tramontana
 

More from Porfirio Tramontana (20)

An Approach for Model Based Testing of Augmented Reality Applications.pdf
An Approach for Model Based Testing of Augmented Reality Applications.pdfAn Approach for Model Based Testing of Augmented Reality Applications.pdf
An Approach for Model Based Testing of Augmented Reality Applications.pdf
 
Towards the Generation of Robust E2E Test Cases in Template-based Web Applica...
Towards the Generation of Robust E2E Test Cases in Template-based Web Applica...Towards the Generation of Robust E2E Test Cases in Template-based Web Applica...
Towards the Generation of Robust E2E Test Cases in Template-based Web Applica...
 
Techniques and Tools for Mobile Testing Automation
Techniques and Tools for Mobile Testing AutomationTechniques and Tools for Mobile Testing Automation
Techniques and Tools for Mobile Testing Automation
 
Reverse Engineering of Data Models from Legacy Spreadsheets-Based Systems: An...
Reverse Engineering of Data Models from Legacy Spreadsheets-Based Systems: An...Reverse Engineering of Data Models from Legacy Spreadsheets-Based Systems: An...
Reverse Engineering of Data Models from Legacy Spreadsheets-Based Systems: An...
 
Reverse Engineering Techniques: from Web Applications to Rich Internet Applic...
Reverse Engineering Techniques: from Web Applications to Rich Internet Applic...Reverse Engineering Techniques: from Web Applications to Rich Internet Applic...
Reverse Engineering Techniques: from Web Applications to Rich Internet Applic...
 
Web Application Testing in Fifteen Years of WSE
Web Application Testing in Fifteen Years of WSEWeb Application Testing in Fifteen Years of WSE
Web Application Testing in Fifteen Years of WSE
 
Towards a Better Comprehensibility of Web Applications: Lessons Learned from ...
Towards a Better Comprehensibility of Web Applications: Lessons Learned from ...Towards a Better Comprehensibility of Web Applications: Lessons Learned from ...
Towards a Better Comprehensibility of Web Applications: Lessons Learned from ...
 
Comprehending Web Applications by a Clustering Based Approach
Comprehending Web Applications by a Clustering Based Approach Comprehending Web Applications by a Clustering Based Approach
Comprehending Web Applications by a Clustering Based Approach
 
Reverse Engineering Web Applications
Reverse Engineering Web ApplicationsReverse Engineering Web Applications
Reverse Engineering Web Applications
 
Recovering Interaction Design Patterns in Web Applications
Recovering Interaction Design Patterns in Web Applications Recovering Interaction Design Patterns in Web Applications
Recovering Interaction Design Patterns in Web Applications
 
Improving Usability of Web Pages for Blind
Improving Usability of Web Pages for BlindImproving Usability of Web Pages for Blind
Improving Usability of Web Pages for Blind
 
Techniques and Tools for Rich Internet Applications Testing
Techniques and Tools for Rich Internet Applications TestingTechniques and Tools for Rich Internet Applications Testing
Techniques and Tools for Rich Internet Applications Testing
 
Comprehending Ajax Web Applications by the DynaRIA Tool
Comprehending Ajax Web Applications by the DynaRIA ToolComprehending Ajax Web Applications by the DynaRIA Tool
Comprehending Ajax Web Applications by the DynaRIA Tool
 
Using Dynamic Analysis for Generating End User Documentation for Web 2.0 Appl...
Using Dynamic Analysis for Generating End User Documentation for Web 2.0 Appl...Using Dynamic Analysis for Generating End User Documentation for Web 2.0 Appl...
Using Dynamic Analysis for Generating End User Documentation for Web 2.0 Appl...
 
DynaRIA: a Tool for Ajax Web Application Comprehension
DynaRIA: a Tool for Ajax Web Application ComprehensionDynaRIA: a Tool for Ajax Web Application Comprehension
DynaRIA: a Tool for Ajax Web Application Comprehension
 
Rich Internet Application Testing Using Execution Trace Data
Rich Internet Application Testing  Using Execution Trace Data Rich Internet Application Testing  Using Execution Trace Data
Rich Internet Application Testing Using Execution Trace Data
 
An AHP-based Framework for Quality and Security Evaluation
An AHP-based Framework for Quality and Security EvaluationAn AHP-based Framework for Quality and Security Evaluation
An AHP-based Framework for Quality and Security Evaluation
 
Experimenting a Reverse Engineering Technique for Modelling the Behaviour of ...
Experimenting a Reverse Engineering Technique for Modelling the Behaviour of ...Experimenting a Reverse Engineering Technique for Modelling the Behaviour of ...
Experimenting a Reverse Engineering Technique for Modelling the Behaviour of ...
 
Reverse Engineering Finite State Machines from Rich Internet Applications
Reverse Engineering Finite State Machines from Rich Internet ApplicationsReverse Engineering Finite State Machines from Rich Internet Applications
Reverse Engineering Finite State Machines from Rich Internet Applications
 
Web Pages Classification using Concept Analysis
Web Pages Classification using Concept Analysis Web Pages Classification using Concept Analysis
Web Pages Classification using Concept Analysis
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 

Using GUI Ripping for Automated Testing of Android Apps

  • 1. Using GUI Ripping for Automated Testing of Android Apps Domenico Amalfitano Salvatore De Carmine Anna Rita Fasolino Porfirio Tramontana Dipartimento di Informatica e Sistemistica University of Naples Federico II, Italy Atif Memon Department of Computer Science University of Maryland
  • 2. Motivation  Android is a very popular operative system and framework for mobile devices  Its diffusion is increasing: recently it overtook ioS and Symbian in terms of diffusion  Over than 500,000 apps are now on the Google Play market  The most part of the apps are realized by single programmers or little teams and lacks in quality  Android apps are often developed according to an evolutionary life cycle, with very frequent releases via Google Play  Bugs causing failures and, in particular, crashes are very common  There is a strong need for testing automation processes and tools  In this talk, our techniques and tool supporting a process of Android GUI Testing Automation will be presented Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012 2
  • 3. Android apps  An Android application is composed of several types of Java components instantiated at run-time:  Activities, Services, Intents, Broadcast Receivers and Content Providers.  An Activity component:  is responsible for presenting a visual user interface;  provides a screen with which the users can interact in order to do something.  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 Event-Driven Systems  Three types of events can be triggered:  user events (such as Click, MouseOver, etc.);  events related to the lifecycle of the Activity classes  onStart, on Pause, onResume, onStop, onDestroy, …  events that are triggered by other input sources  such as GPS receiver, phone, network, etc. Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012 3
  • 4. Existing approaches to Android Testing Automation  JUnit Testing  Android Testing Framework  Supports the coding of executable test classes  Classes supporting the instrumentation and monitoring of Android apps are provided in the Android framework itself  Libraries such as Robotium and Monkeyrunner extends the framework  Random Testing  Monkey (included in the Android framework) supports the randomly automatic exploration of Android apps  Model Based Testing  TEMA Tools (Takala, Katara, Harty, 2011) represent a first tentative of approach for the generation of test code from a design model of Android app Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012 4
  • 5. Android GUI Ripping  We propose a technique and a tool for:  Automatic exploration of the GUI of an Android application via a systematic Ripping approach  Similar to approaches adopted for Web crawling  Crash testing  GUI model reverse engineering  JUnit test case generation Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012 5
  • 6. Android GUI Ripping Algorithm  Customizable  Selection of types of events to be fired  Adoption of a GUI traversing strategy (e.g. depth first, breadth first, etc.)  Termination criteria used to stop the GUI traversal  Setting of specific preconditions  Efficient  Provides heuristic solutions to the well known problem of GUI interface states and events explosion  GUI exploration criteria based on a Interface Equivalence Criterion Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012 6
  • 7. Ripping ≡ Algorithm Rotate ≡ Click Pages Click Click Refresh Press Menu 1. Task List Initialization; 1. New Post Task List Initialization; 2. while (Task List Is Not Empty) { 2. while (Task List Is Not Empty) { Extract a Task From The 3. Task List; 3. Extract a Task From The Task List; Execute the Task; 4. 5. Abstract the Current GUI Abstract State; 4. Execute the Task; … Update the GUI Tree 6. Model; 5. Abstract the Current GUI Abstract 7. if (GUI Exploration Criterion) then { State; 8. Define New Tasks ; 9. Add New Tasks To 6. Update the GUI Tree Model; The Task List; 10. } 7. if (GUI Exploration Criterion) then Click Add 11. } { Click About Account 8. Click Save Define New Tasks ; 9. Add New Tasks To The Task List; … 10. } Crash 11. } Click Edit 7 … … Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012
  • 8. Crash Testing Process  Preconconditions are set by generating a Snapshot Image of the device for the emulator  In the task execution step, the GUI Ripping algorithm is executed Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012 8
  • 9. A Demonstrational example  Android for Wordpress  Measured metrics  A Wordpress client for  Effectiveness Android  Number of crashes found  334 classes, ~10,000 LOCs  Number of different  More than 250,000 downloads bugs causing crashes  A set of three preconditions  LOCs coverage  No Login  Single Blog  Efficiency  Multiple Blogs  Number of test cases  Comparison between  Number of events Ripping and Random  Ripping time Testing with Monkey Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012 9
  • 10. Results Preconditions No Login Single Blog Multiple Blog Random (Single Blog) #Crashes 0 6 8 3 #Bugs 0 3 4 1 LOC Cov % 2.65 39.32 37.83 25.27 Time (h) 0.2 4.88 4.58 4.46 #TC 18 166 166 - #Events 36 517 502 14400 Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012 10
  • 11. Bugs and Crashes  The 14 crashes Id Crash Description Java Exception Ticket and Changeset found by the Ripping B1 The app crashes trying StringIndex https://android.tra process belongs to to opening the default OutOfBoun c.wordpress.org/tic post “Hello World” dException ket/206 https://android.tra four different bugs c.wordpress.org/ch angeset/398  Bugs have been B2 The app crashes when BadTokenE https://android.tra the Stats activity is xception c.wordpress.org/tic submitted to the bug rapidly opened closed (via the Back and ket/208 https://android.tra tracking system and key). c.wordpress.org/ch angeset/420 accepted/fixed by the B3 The app crashes when NullPointerE https://android.tra the Stats activity is open xception c.wordpress.org/tic programmer and the Refresh button is clicked while the ket/212 https://android.tra  Monkey was able to progress bar widget is still loading. c.wordpress.org/ch angeset/423 find only one of B4 The app crashes when NullPointerE https://android.tra the user opens a post xception c.wordpress.org/tic these bugs and tries to share it ket/218 within his blog. The https://android.tra crash occurs when there c.wordpress.org/ch is a single blog in the angeset/446 app. Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012 11
  • 12. Conclusions and Future Works  Our technique supports the execution of completely automatic generation and execution of test cases for Android applications. In our preliminary demonstration example:  Real bugs and crashes have been detected;  Good level of code coverage has been reached;  Testing time is compatible with smoke testing processes;  Reusable test cases has been automatically generated;  Our technique demonstrates its effectiveness with respect to standard Random testing tools such as Monkey Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012 12
  • 13. Future Works  This presentation covers the first part of a larger project on testing automation of Android applications  Some future works  Publication of the tool  As a standalone tool  As a service  A preliminary demo is available at http://wpage.unina.it/ptramont/GUIRipperWiki.htm  Further experiments with more applications and ripping parameters  Delay Time, ripping strategy (depth first/breadth first, activity equivalence criteria, maximum depth), input generation strategies, …  Sensor event testing Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012 13
  • 14. Porfirio Tramontana – ASE 2012 – Essen – September 6, 2012 14