SlideShare a Scribd company logo
1 of 29
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
TESTBEDS 2011,Berlin, Germany




Context and Motivations
• Context:
 ▫ Testing of Android Applications.

• Motivations:
 ▫ Dealing with open issues in Android
   testing.
 ▫ Introducing a new GUI based testing
   approach.
TESTBEDS 2011,Berlin, Germany




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.
TESTBEDS 2011,Berlin, Germany




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.
TESTBEDS 2011,Berlin, Germany




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.
TESTBEDS 2011,Berlin, Germany




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.
TESTBEDS 2011,Berlin, Germany




Android Applications are EDS
• The processing in Android applications is event-
  driven.
• 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.
TESTBEDS 2011,Berlin, Germany




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?
TESTBEDS 2011,Berlin, Germany




EDS Testing: current approaches
• EDS testing techniques described in the
  literature:
 ▫ are based on suitable models of the system or sub-
   system 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.
TESTBEDS 2011,Berlin, Germany




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.
TESTBEDS 2011,Berlin, Germany




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.
TESTBEDS 2011,Berlin, Germany




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.
TESTBEDS 2011,Berlin, Germany




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.
TESTBEDS 2011,Berlin, Germany




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:
TESTBEDS 2011,Berlin, Germany




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.
TESTBEDS 2011,Berlin, Germany




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.
TESTBEDS 2011,Berlin, Germany




The Testing Tool
• A tool, named A2T2 (Android Automatic Testing
  Tool), is developed in Java technology to support
  the testing technique proposed.
• A2T2 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.
TESTBEDS 2011,Berlin, Germany




A screenshot of the tool in execution
TESTBEDS 2011,Berlin, Germany




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.
TESTBEDS 2011,Berlin, Germany




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




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 non-
  numeric 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).
TESTBEDS 2011,Berlin, Germany




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.
TESTBEDS 2011,Berlin, Germany




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.
TESTBEDS 2011,Berlin, Germany




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.
TESTBEDS 2011,Berlin, Germany




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.
TESTBEDS 2011,Berlin, Germany




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.
TESTBEDS 2011,Berlin, Germany




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.
TESTBEDS 2011,Berlin, Germany




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 !!!

More Related Content

Similar to A GUI Crawling-based Technique for Android Mobile Application Testing

Android Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdfAndroid Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdfNomanKhan869872
 
Mobile Application Development powerpoint
Mobile Application Development powerpointMobile Application Development powerpoint
Mobile Application Development powerpointJohnLagman3
 
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...DicodingEvent
 
Android App Developement
Android App DevelopementAndroid App Developement
Android App DevelopementAayush Gupta
 
Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...
Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...
Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...Riccardo Coppola
 
Android 130923124440-phpapp01
Android 130923124440-phpapp01Android 130923124440-phpapp01
Android 130923124440-phpapp01rajesh kumar
 
Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA NITIN GUPTA
 
Innovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best PracticesInnovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best PracticesSolstice Mobile Argentina
 
Seminar on android app development
Seminar on android app developmentSeminar on android app development
Seminar on android app developmentAbhishekKumar4779
 
Introduction to android mobile app development.pptx
Introduction to android mobile app development.pptxIntroduction to android mobile app development.pptx
Introduction to android mobile app development.pptxridzah12
 
Scope of Android and Future Work
Scope of Android and Future WorkScope of Android and Future Work
Scope of Android and Future WorkRabiRehman1
 

Similar to A GUI Crawling-based Technique for Android Mobile Application Testing (20)

Android Applications
Android ApplicationsAndroid Applications
Android Applications
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Android ppt
Android ppt Android ppt
Android ppt
 
Android Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdfAndroid Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdf
 
Mobile Application Development powerpoint
Mobile Application Development powerpointMobile Application Development powerpoint
Mobile Application Development powerpoint
 
Android
AndroidAndroid
Android
 
Project
ProjectProject
Project
 
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
 
Android App Developement
Android App DevelopementAndroid App Developement
Android App Developement
 
Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...
Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...
Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...
 
Android 130923124440-phpapp01
Android 130923124440-phpapp01Android 130923124440-phpapp01
Android 130923124440-phpapp01
 
Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA
 
Android technology
Android technologyAndroid technology
Android technology
 
Android
AndroidAndroid
Android
 
Innovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best PracticesInnovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best Practices
 
Seminar on android app development
Seminar on android app developmentSeminar on android app development
Seminar on android app development
 
AlekyaNyalakonda_Resume
AlekyaNyalakonda_ResumeAlekyaNyalakonda_Resume
AlekyaNyalakonda_Resume
 
MoizChhatriwalaPotrfolio
MoizChhatriwalaPotrfolioMoizChhatriwalaPotrfolio
MoizChhatriwalaPotrfolio
 
Introduction to android mobile app development.pptx
Introduction to android mobile app development.pptxIntroduction to android mobile app development.pptx
Introduction to android mobile app development.pptx
 
Scope of Android and Future Work
Scope of Android and Future WorkScope of Android and Future Work
Scope of Android and Future Work
 

More from Porfirio Tramontana

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.pdfPorfirio 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
 
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 AutomationPorfirio Tramontana
 
A technique for parallel gui testing of android applications
A technique for parallel gui testing of android applicationsA technique for parallel gui testing of android applications
A technique for parallel gui testing of android applicationsPorfirio Tramontana
 
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...Porfirio Tramontana
 
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...Porfirio Tramontana
 
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 WSEPorfirio Tramontana
 
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 ...Porfirio Tramontana
 
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 Porfirio Tramontana
 
Reverse Engineering Web Applications
Reverse Engineering Web ApplicationsReverse Engineering Web Applications
Reverse Engineering Web ApplicationsPorfirio Tramontana
 
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 Porfirio Tramontana
 
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 BlindPorfirio Tramontana
 
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 TestingPorfirio Tramontana
 
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 ToolPorfirio 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
 
Considering Context Events in Event-Based Testing of Mobile Applications
Considering Context Events in Event-Based Testing of Mobile Applications Considering Context Events in Event-Based Testing of Mobile Applications
Considering Context Events in Event-Based Testing of Mobile Applications Porfirio Tramontana
 
Using GUI Ripping for Automated Testing of Android Apps
Using GUI Ripping for Automated Testing of Android AppsUsing GUI Ripping for Automated Testing of Android Apps
Using GUI Ripping for Automated Testing of Android AppsPorfirio Tramontana
 
A Toolset for GUI Testing of Android Applications
A Toolset for GUI Testing of Android ApplicationsA Toolset for GUI Testing of Android Applications
A Toolset for GUI Testing of Android ApplicationsPorfirio Tramontana
 
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 ComprehensionPorfirio Tramontana
 
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 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
 
A technique for parallel gui testing of android applications
A technique for parallel gui testing of android applicationsA technique for parallel gui testing of android applications
A technique for parallel gui testing of android applications
 
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...
 
Considering Context Events in Event-Based Testing of Mobile Applications
Considering Context Events in Event-Based Testing of Mobile Applications Considering Context Events in Event-Based Testing of Mobile Applications
Considering Context Events in Event-Based Testing of Mobile Applications
 
Using GUI Ripping for Automated Testing of Android Apps
Using GUI Ripping for Automated Testing of Android AppsUsing GUI Ripping for Automated Testing of Android Apps
Using GUI Ripping for Automated Testing of Android Apps
 
A Toolset for GUI Testing of Android Applications
A Toolset for GUI Testing of Android ApplicationsA Toolset for GUI Testing of Android Applications
A Toolset for GUI Testing of Android Applications
 
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
 

Recently uploaded

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 

Recently uploaded (20)

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 

A GUI Crawling-based Technique for Android Mobile Application Testing

  • 1. 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
  • 2. TESTBEDS 2011,Berlin, Germany Context and Motivations • Context: ▫ Testing of Android Applications. • Motivations: ▫ Dealing with open issues in Android testing. ▫ Introducing a new GUI based testing approach.
  • 3. TESTBEDS 2011,Berlin, Germany 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.
  • 4. TESTBEDS 2011,Berlin, Germany 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.
  • 5. TESTBEDS 2011,Berlin, Germany 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.
  • 6. TESTBEDS 2011,Berlin, Germany 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.
  • 7. TESTBEDS 2011,Berlin, Germany Android Applications are EDS • The processing in Android applications is event- driven. • 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.
  • 8. TESTBEDS 2011,Berlin, Germany 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?
  • 9. TESTBEDS 2011,Berlin, Germany EDS Testing: current approaches • EDS testing techniques described in the literature: ▫ are based on suitable models of the system or sub- system 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.
  • 10. TESTBEDS 2011,Berlin, Germany 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.
  • 11. TESTBEDS 2011,Berlin, Germany 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.
  • 12. TESTBEDS 2011,Berlin, Germany 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.
  • 13. TESTBEDS 2011,Berlin, Germany 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.
  • 14. TESTBEDS 2011,Berlin, Germany 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:
  • 15. TESTBEDS 2011,Berlin, Germany 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.
  • 16. TESTBEDS 2011,Berlin, Germany 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.
  • 17. TESTBEDS 2011,Berlin, Germany The Testing Tool • A tool, named A2T2 (Android Automatic Testing Tool), is developed in Java technology to support the testing technique proposed. • A2T2 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.
  • 18. TESTBEDS 2011,Berlin, Germany A screenshot of the tool in execution
  • 19. TESTBEDS 2011,Berlin, Germany 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.
  • 20. TESTBEDS 2011,Berlin, Germany The obtained GUI-Tree Class IC1 that IC3 IC2 comprehends the Interfaces: I1, I2, I3, I13, I14, I6, I7, I8, 15, I11, I16 I10,I17, I18 I4, I5, I9,I12, I19
  • 21. TESTBEDS 2011,Berlin, Germany 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 non- numeric 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).
  • 22. TESTBEDS 2011,Berlin, Germany 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.
  • 23. TESTBEDS 2011,Berlin, Germany 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.
  • 24. TESTBEDS 2011,Berlin, Germany 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.
  • 25. TESTBEDS 2011,Berlin, Germany 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.
  • 26. TESTBEDS 2011,Berlin, Germany 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.
  • 27. TESTBEDS 2011,Berlin, Germany 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.
  • 28. TESTBEDS 2011,Berlin, Germany 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.
  • 29. Thank you for your attention !!!