Comparison of GUI Testing Tools for Android Applications

Total Page:16

File Type:pdf, Size:1020Kb

Comparison of GUI Testing Tools for Android Applications Comparison of GUI testing tools for Android applications University of Oulu Department of Information Processing Science Master’s Thesis Tomi Lämsä Date 22.5.2017 2 Abstract Test automation is an intriguing area of software engineering, especially in Android development. This is since Android applications must be able to run in many different permutations of operating system versions and hardware choices. Comparison of different tools for automated UI testing of Android applications is done in this thesis. In a literature review several different tools available and their popularity is researched and the structure of the most popular tools is looked at. The two tools identified to be the most popular are Appium and Espresso. In an empirical study the two tools along with Robotium, UiAutomator and Tau are compared against each other in test execution speed, maintainability of the test code, reliability of the test tools and in general issues. An empirical study was carried out by selecting three Android applications for which an identical suite of tests was developed with each tool. The test suites were then run and the execution speed and reliability was analysed based on these results. The test code written is also analysed for maintainability by calculating the lines of code and the number of method calls needed to handle asynchrony related to UI updates. The issues faced by the test developer with the different tools are also analysed. This thesis aims to help industry users of these kinds of applications in two ways. First, it could be used as a source on what tools are over all available for UI testing of Android applications. Second, it helps potential users of these kinds of tools to choose a tool that would suit best their needs, depending on if they are most interested on test execution speed or in the easiness of developing a reliable test suite. The results of this study are the first benchmarking of these Android UI testing tools. From this thesis one can see how a few of the tools available fare up against each other in a small-scale study. Tau and Espresso share the first place in maintainability, since Tau requires the least amount of lines of code, but Espresso requires no waiting method calls to ensure synchronization of the UI. While Tau faced least general issues during the test suite development, Espresso is clearly the fastest of the tools and it attains highest level of reliability, so it seems to be the best choice of the tools. Keywords Software Testing, UI testing, Android, Test Automation, Appium, Espresso, Robotium, Tau, UiAutomator Supervisor D.Sc. Professor Mika Mäntylä 3 Foreword I want to thank my thesis supervisor Mika Mäntylä for his great patience, his guidance during my work for this thesis and that he at a times pushed me to continue this work so that it is finally finished at this point. I would also like to thank him greatly for the opportunity to work on this thesis, since it was he who had the general idea in mind when he inquired if I wished to work on it. Without him I would have never worked on this subject. I’d also like to thank the University of Oulu and my department for providing me a chance to study in there and learn much more of the world. A word of thank you should also go to Miikka Kuutila and Päivi Raulamo-Jurvanen for their help in making the long summer during which I worked on this thesis go much faster and for their hints and help while I worked with this. Thanks to my family without whom I would not be where I am now, and finally a big thank you to Ilona Myyri, without whom my life would be a lot bleaker. 4 Contents Abstract ............................................................................................................................. 2 Foreword ........................................................................................................................... 3 Contents ............................................................................................................................ 4 1. Introduction .................................................................................................................. 6 2. Prior Research .............................................................................................................. 9 2.1 Android applications ............................................................................................ 9 2.2 GUI testing ........................................................................................................... 9 2.2.1 GUI testing on Android .......................................................................... 10 2.3 Android GUI testing tools and libraries (RQ 1.1) ............................................. 11 2.3.1 Android testing tools in articles and blogs ............................................. 11 2.3.2 Closer look at the tools available for Android GUI testing .................... 13 2.4 How do the tools rank in popularity? (RQ 1.2) ................................................. 16 2.4.1 Tool popularity in Google trends ........................................................... 16 2.4.2 Tool popularity in Stack overflow .......................................................... 18 2.4.3 Which are the most popular tools ........................................................... 20 2.5 Architecture of the popular tools (RQ 1.3) ........................................................ 20 2.6 Automatic test generation for Android (RQ 1.4) ............................................... 26 3. Methodology .............................................................................................................. 30 3.1 Research methods .............................................................................................. 30 3.2 Research questions ............................................................................................. 31 3.2.1 Research Question 1 ............................................................................... 32 3.2.2 Research Question 2 ............................................................................... 33 3.3 Empirical research ............................................................................................. 35 3.3.1 Applications chosen for evaluating the testing tools/libraries ................ 36 3.3.2 Devising the test set ................................................................................ 38 3.3.3 Running the test set ................................................................................ 43 3.3.4 Test run environment .............................................................................. 43 4. Findings ...................................................................................................................... 45 4.1 General findings and sources of difficulty for the tools (RQ 2.1) ..................... 45 4.1.1 General points of problem ...................................................................... 45 4.1.2 Issue severity per tool ............................................................................. 47 4.2 Execution times (RQ 2.2) .................................................................................. 51 4.3 Maintainability (RQ 2.3) .................................................................................... 61 4.3.1 Lines of Code ......................................................................................... 61 4.3.2 Number of waits ..................................................................................... 63 4.4 Reliability (RQ 2.4) ........................................................................................... 64 4.4.1 Failures in the Notes test suite ................................................................ 66 4.4.2 Failures in Amaze test suite .................................................................... 66 4.4.3 Failures in Wikipedia test suites ............................................................. 67 4.5 Ranking of the tools ........................................................................................... 69 5. Discussion and Implications ....................................................................................... 73 5.1 Encountered issues while developing the test sets (RQ 2.1) ............................. 73 5.2 Execution times (RQ 2.2) .................................................................................. 74 5.3 Maintainability (RQ 2.3) .................................................................................... 76 5.4 Reliability (RQ 2.4) ........................................................................................... 78 5.4.1 A look at the tests that fail ...................................................................... 79 5.4.2 Costs related to failures .......................................................................... 81 5.5 Tool rankings ..................................................................................................... 81 6. Conclusions ................................................................................................................ 83 5 6.1 Limitations ......................................................................................................... 83 6.2 Further research ................................................................................................. 84 7. Acknowledgements .................................................................................................... 86 References ......................................................................................................................
Recommended publications
  • Types of Software Testing
    Types of Software Testing We would be glad to have feedback from you. Drop us a line, whether it is a comment, a question, a work proposition or just a hello. You can use either the form below or the contact details on the rightt. Contact details [email protected] +91 811 386 5000 1 Software testing is the way of assessing a software product to distinguish contrasts between given information and expected result. Additionally, to evaluate the characteristic of a product. The testing process evaluates the quality of the software. You know what testing does. No need to explain further. But, are you aware of types of testing. It’s indeed a sea. But before we get to the types, let’s have a look at the standards that needs to be maintained. Standards of Testing The entire test should meet the user prerequisites. Exhaustive testing isn’t conceivable. As we require the ideal quantity of testing in view of the risk evaluation of the application. The entire test to be directed ought to be arranged before executing it. It follows 80/20 rule which expresses that 80% of defects originates from 20% of program parts. Start testing with little parts and extend it to broad components. Software testers know about the different sorts of Software Testing. In this article, we have incorporated majorly all types of software testing which testers, developers, and QA reams more often use in their everyday testing life. Let’s understand them!!! Black box Testing The black box testing is a category of strategy that disregards the interior component of the framework and spotlights on the output created against any input and performance of the system.
    [Show full text]
  • Mobile Developer's Guide to the Galaxy
    Don’t Panic MOBILE DEVELOPER’S GUIDE TO THE GALAXY U PD A TE D & EX TE ND 12th ED EDITION published by: Services and Tools for All Mobile Platforms Enough Software GmbH + Co. KG Sögestrasse 70 28195 Bremen Germany www.enough.de Please send your feedback, questions or sponsorship requests to: [email protected] Follow us on Twitter: @enoughsoftware 12th Edition February 2013 This Developer Guide is licensed under the Creative Commons Some Rights Reserved License. Editors: Marco Tabor (Enough Software) Julian Harty Izabella Balce Art Direction and Design by Andrej Balaz (Enough Software) Mobile Developer’s Guide Contents I Prologue 1 The Galaxy of Mobile: An Introduction 1 Topology: Form Factors and Usage Patterns 2 Star Formation: Creating a Mobile Service 6 The Universe of Mobile Operating Systems 12 About Time and Space 12 Lost in Space 14 Conceptional Design For Mobile 14 Capturing The Idea 16 Designing User Experience 22 Android 22 The Ecosystem 24 Prerequisites 25 Implementation 28 Testing 30 Building 30 Signing 31 Distribution 32 Monetization 34 BlackBerry Java Apps 34 The Ecosystem 35 Prerequisites 36 Implementation 38 Testing 39 Signing 39 Distribution 40 Learn More 42 BlackBerry 10 42 The Ecosystem 43 Development 51 Testing 51 Signing 52 Distribution 54 iOS 54 The Ecosystem 55 Technology Overview 57 Testing & Debugging 59 Learn More 62 Java ME (J2ME) 62 The Ecosystem 63 Prerequisites 64 Implementation 67 Testing 68 Porting 70 Signing 71 Distribution 72 Learn More 4 75 Windows Phone 75 The Ecosystem 76 Implementation 82 Testing
    [Show full text]
  • Behavioral Analysis of Android Applications Using Automated Instrumentation
    2013 Seventh International Conference on Software Security and Reliability Companion Behavioral Analysis of Android Applications Using Automated Instrumentation Mohammad Karami, Mohamed Elsabagh, Parnian Najafiborazjani, and Angelos Stavrou Computer Science Department, George Mason University, Fairfax, VA 22030 { mkarami, melsabag, pnajafib, astavrou}@gmu.edu Abstract—Google’s Android operating system has become one application is not a straight forward task due to variety of the most popular operating system for hand-held devices. Due inputs and heterogeneity of the technologies [12]. to its ubiquitous use, open source nature and wide-spread Two primary methods are being employed for mobile appli- popularity, it has become the target of recent mobile malware. In this paper, we present our efforts on effective security cation analysis: white-box approach and black-box approach. inspection mechanisms for identification of malicious applications In black-box testing only the inputs and outputs of the appli- for Android mobile applications. To achieve that, we devel- cation are being exercised. On the other hand, for white box oped a comprehensive software inspection framework. Moreover, approach the source code need to be analyzed. Since the source to identify potential software reliability flaws and to trigger code of the malicious applications that we get from Google malware, we develop a transparent instrumentation system for automating user interactions with an Android application that Play is not available we cannot analyze the internal structure does not require source code. Additionally, for run-time behavior of the malicious applications to figure out what they exactly analysis of an application, we monitor the I/O system calls gener- do, but we can utilize the black-box testing to define their ated the by application under monitoring to the underlying Linux functionality.
    [Show full text]
  • Exploring Languages with Interpreters and Functional Programming Chapter 11
    Exploring Languages with Interpreters and Functional Programming Chapter 11 H. Conrad Cunningham 24 January 2019 Contents 11 Software Testing Concepts 2 11.1 Chapter Introduction . .2 11.2 Software Requirements Specification . .2 11.3 What is Software Testing? . .3 11.4 Goals of Testing . .3 11.5 Dimensions of Testing . .3 11.5.1 Testing levels . .4 11.5.2 Testing methods . .6 11.5.2.1 Black-box testing . .6 11.5.2.2 White-box testing . .8 11.5.2.3 Gray-box testing . .9 11.5.2.4 Ad hoc testing . .9 11.5.3 Testing types . .9 11.5.4 Combining levels, methods, and types . 10 11.6 Aside: Test-Driven Development . 10 11.7 Principles for Test Automation . 12 11.8 What Next? . 15 11.9 Exercises . 15 11.10Acknowledgements . 15 11.11References . 16 11.12Terms and Concepts . 17 Copyright (C) 2018, H. Conrad Cunningham Professor of Computer and Information Science University of Mississippi 211 Weir Hall P.O. Box 1848 University, MS 38677 1 (662) 915-5358 Browser Advisory: The HTML version of this textbook requires a browser that supports the display of MathML. A good choice as of October 2018 is a recent version of Firefox from Mozilla. 2 11 Software Testing Concepts 11.1 Chapter Introduction The goal of this chapter is to survey the important concepts, terminology, and techniques of software testing in general. The next chapter illustrates these techniques by manually constructing test scripts for Haskell functions and modules. 11.2 Software Requirements Specification The purpose of a software development project is to meet particular needs and expectations of the project’s stakeholders.
    [Show full text]
  • Software Testing: Essential Phase of SDLC and a Comparative Study Of
    International Journal of System and Software Engineering Volume 5 Issue 2, December 2017 ISSN.: 2321-6107 Software Testing: Essential Phase of SDLC and a Comparative Study of Software Testing Techniques Sushma Malik Assistant Professor, Institute of Innovation in Technology and Management, Janak Puri, New Delhi, India. Email: [email protected] Abstract: Software Development Life-Cycle (SDLC) follows In the software development process, the problem (Software) the different activities that are used in the development of a can be dividing in the following activities [3]: software product. SDLC is also called the software process ∑ Understanding the problem and it is the lifeline of any Software Development Model. ∑ Decide a plan for the solution Software Processes decide the survival of a particular software development model in the market as well as in ∑ Coding for the designed solution software organization and Software testing is a process of ∑ Testing the definite program finding software bugs while executing a program so that we get the zero defect software. The main objective of software These activities may be very complex for large systems. So, testing is to evaluating the competence and usability of a each of the activity has to be broken into smaller sub-activities software. Software testing is an important part of the SDLC or steps. These steps are then handled effectively to produce a because through software testing getting the quality of the software project or system. The basic steps involved in software software. Lots of advancements have been done through project development are: various verification techniques, but still we need software to 1) Requirement Analysis and Specification: The goal of be fully tested before handed to the customer.
    [Show full text]
  • Software Testing Training Module
    MAST MARKET ALIGNED SKILLS TRAINING SOFTWARE TESTING TRAINING MODULE In partnership with Supported by: INDIA: 1003-1005,DLF City Court, MG Road, Gurgaon 122002 Tel (91) 124 4551850 Fax (91) 124 4551888 NEW YORK: 216 E.45th Street, 7th Floor, New York, NY 10017 www.aif.org SOFTWARE TESTING TRAINING MODULE About the American India Foundation The American India Foundation is committed to catalyzing social and economic change in India, andbuilding a lasting bridge between the United States and India through high impact interventions ineducation, livelihoods, public health, and leadership development. Working closely with localcommunities, AIF partners with NGOs to develop and test innovative solutions and withgovernments to create and scale sustainable impact. Founded in 2001 at the initiative of PresidentBill Clinton following a suggestion from Indian Prime Minister Vajpayee, AIF has impacted the lives of 4.6million of India’s poor. Learn more at www.AIF.org About the Market Aligned Skills Training (MAST) program Market Aligned Skills Training (MAST) provides unemployed young people with a comprehensive skillstraining that equips them with the knowledge and skills needed to secure employment and succeed on thejob. MAST not only meets the growing demands of the diversifying local industries across the country, itharnesses India's youth population to become powerful engines of the economy. AIF Team: Hanumant Rawat, Aamir Aijaz & Rowena Kay Mascarenhas American India Foundation 10th Floor, DLF City Court, MG Road, Near Sikanderpur Metro Station, Gurgaon 122002 216 E. 45th Street, 7th Floor New York, NY 10017 530 Lytton Avenue, Palo Alto, CA 9430 This document is created for the use of underprivileged youth under American India Foundation’s Market Aligned Skills Training (MAST) Program.
    [Show full text]
  • Unit Testing, Integration Testing and Continuous Builds for Android
    Unit Testing, Integration Testing and Continuous Builds Manfred Moser simpligility technologies inc. http://www.simpligility.com @simpligility Agenda Get an overview about testing and continuous integration for Android app development Why testing? What can we test? How can we do it? 2 Manfred Moser simpligility.com Apache Maven See previous presentation Maven used to control build and more Good library reuse and dependency use – makes testing easier out of the box Strong tool support But its all possible without Maven too... Why (automated) testing? Find problem early and you ● Can fix it quickly ● Safe money on QA testing ● Do not get negative customer feedback ● Deal with feature requests instead of bugs ● Avoid production problems ● Can refactor (and change) without breaking old stuff 4 Manfred Moser simpligility.com What are we testing? Plain java code Android dependent code Configuration User interface Look and feel 5 Manfred Moser simpligility.com JVM vs Dalvik/Android stack JVM based: ● Faster ● More tools available ● More mature tooling Dalvik based: ● Necessary for integration tests ● Reproduce actual behaviour ● Full stack testing (beyond VM, to native..) 6 Manfred Moser simpligility.com JVM testing tools ● JUnit ● TestNG ● EasyMock ● Unitils ● Cobertura ● Emma ● and many more 7 Android SDK Test Tools ● Integrated Junit ● use on emulator/device though ● Instrumentation Test Tools ● rich set of classes for testing ● now well documented ● MonkeyRunner ● control device/emulator running tests ● take screenshots ● jython 8 Dalvik/Android
    [Show full text]
  • Large-Scale Android Dynamic Analysis
    Andlantis: Large-scale Android Dynamic Analysis Michael Biermayz, Eric Gustafsonz, Jeremy Ericksony, David Fritzy, Yung Ryn Choey ∗ySandia National Laboratories fmbierma, jericks, djfritz, [email protected] zUniversity of California, Davis fmhbierma, [email protected] Abstract— In this paper, we present Andlantis: a highly scalable Analyzing Android applications for malicious behavior is an dynamic analysis framework for analyzing applications on important area of research, and is made difficult, in part, by the Android operating system. Andlantis runs the Android the increasingly large number of applications available for the operating system in a virtualized environment and is able platform. While techniques exist to perform static analysis on a to provide the virtual device with artificial network data in large number of applications, dynamic analysis techniques are order to provide an environment which closely replicates that relatively limited in scale due to the computational resources of a physical device. Andlantis is able to schedule and run required to emulate the full Android system to achieve accurate thousands of Android instances in parallel, enabling us to execution. We present Andlantis, a scalable dynamic analysis investigate the behavior of mobile malware at scale. system capable of processing over 3000 Android applications per hour. During this processing, the system is able to collect Andlantis employs a scalable high-performance emulytics valuable forensic data, which helps reverse-engineers and mal- framework, minimega, to parallelize this expensive task as ware researchers identify and understand anomalous application much as possible and achieve a level of throughput un- behavior. We discuss the results of running 1261 malware samples precedented in Android dynamic analysis.
    [Show full text]
  • Model-Based Verification for SIMULINK Design
    Minnesota State University, Mankato Cornerstone: A Collection of Scholarly and Creative Works for Minnesota State University, Mankato All Graduate Theses, Dissertations, and Other Graduate Theses, Dissertations, and Other Capstone Projects Capstone Projects 2015 Model-Based Verification for SIMULINK Design Victor Oke Minnesota State University - Mankato Follow this and additional works at: https://cornerstone.lib.mnsu.edu/etds Part of the Electrical and Computer Engineering Commons Recommended Citation Oke, V. (2015). Model-Based Verification for SIMULINK Design [Master’s thesis, Minnesota State University, Mankato]. Cornerstone: A Collection of Scholarly and Creative Works for Minnesota State University, Mankato. https://cornerstone.lib.mnsu.edu/etds/517/ This Thesis is brought to you for free and open access by the Graduate Theses, Dissertations, and Other Capstone Projects at Cornerstone: A Collection of Scholarly and Creative Works for Minnesota State University, Mankato. It has been accepted for inclusion in All Graduate Theses, Dissertations, and Other Capstone Projects by an authorized administrator of Cornerstone: A Collection of Scholarly and Creative Works for Minnesota State University, Mankato. Model-Based Verification for SIMULINK Design By Victor Oke Master’s Thesis submitted in partial fulfillment of the requirements for the degree of Masters of Science in Engineering. Department of Electrical and Computer Engineering and Technology Minnesota State University, Mankato Mankato, Minnesota December 2015 Advisor: Dr. Nannan
    [Show full text]
  • Software Testing: Way to Develop Quality Software Product 1Dipti Pawade, 2Harshada Sonkamble, 3Pranchal Chaudhari, 4Shubhangi Rathod 1,2,3Dept
    ISSN : 0976-8491 (Online) | ISSN : 2229-4333 (Print) IJCST VOL . 4, Iss UE SPL - 1, JAN - MAR C H 2013 Software Testing: Way to Develop Quality Software Product 1Dipti Pawade, 2Harshada Sonkamble, 3Pranchal Chaudhari, 4Shubhangi Rathod 1,2,3Dept. of I T, K. J. Somaiya College of Engineering, Mumbai, India 4Dept. of IT, P. I. I. T. M. S. R., Navi Mumbai, India Abstract reaction to the input. The testing is a process of comparing the Software testing is one of the most important phase of software behaviour of the software against oracles principles by which one development life cycle. No one can underestimate the importance can recognize a problem. The good practice is to test software of software testing process on software quality assurance. as early as it has been written. The testing concept is evolved Organization pays 40% of its efforts on testing process. A powerful with time. Table 1 illustrate the concept evolution of testing [1]. testing technique results in reduced software development cost Software testing life cycle comprises of the different phases [2] and time and improved performance. That is why choosing an mentioned in Table 2. appropriate testing technique is very important. In this paper we have discussed various testing approaches and methods, their Table 2: Software Testing Life Cycle peculiarities and finally discussed functional and non-functional Phase Activity testing. Phase I: Software requirements/design is Requirements/ reviewed in detail and basic idea of Keywords Design Review what needs to be tested is derived. Testing Evolution, Software Testing Life Cycle, Testing Approach, Testing Technique, Functional Testing, Non-functional Testing Phase II: Detailed test plan is derived.
    [Show full text]
  • Guide to Test Automation Tools 2017 - 2018
    Guide to Test Automation Tools 2017 - 2018 WHITEPAPER QATestlab 2017 Copyright 2017 ©QATestLab. All Rights Reserved Table of Contents Summary 3 Introduction 3 1. Test Automation Tools. Market review 1.1. Selenium WebDriver Framework 4 1.2. Appium Framework 5 1.3. Robotium Framework 7 1.4. Serenity Framework 9 1.5. Robot Framework 10 1.6. Galen Framework 12 1.7. HP Unified Functional Testing (UFT) 14 1.8. Ranorex Studio 16 1.9. TestComplete 19 1.10. Telerik Test Studio 20 1.11. Applitools Eyes 22 1.12. Test Automation Tools and Frameworks: Comparison of 23 Technical Aspects 2. Test Automation Tools Approved by QATestLab 2.1. Selenium WebDriver 26 2.2. Appium 28 2.3. TestComplete 29 2.4. Ranorex Studio 31 3. Summary 32 Contact Information 33 2 Copyright 2017 ©QATestLab. All Rights Reserved Summary Table of Contents Click the section to jump This whitepaper aims at providing the comprehensive data on the most ahead popular test automation tools in 2017 - 2018 including the description of Summary their parameters which can be considered when selecting a tool / framework for test automation. The document also provides the Introduction comparison of the leading test automation tools highlighting both 1. Test Automation advantages and disadvantages, and also main objectives, technical Tools. Market review characteristics and the information about a provider. 1.1. Selenium WebDriver Framework The whitepaper is aimed to assist in selecting a proper test automation 1.2 Appium Framework tool avoiding time and money losses. Besides, it includes the 1.3 Robotium recommendations on the most effective test automation tools, Framework 1.4 Serenity Framework information about their effectiveness and maintainability, which were 1.5 Robot Framework prepared by QATestLab on the ground of successful execution of 50 test 1.6 Galen Framework automation projects.
    [Show full text]
  • Profiling the Responsiveness of Android Applications Via Automated
    Profiling the Responsiveness of Android Applications via Automated Resource Amplification Yan Wang Atanas Rountev Ohio State University Ohio State University ABSTRACT Android run-time|the user may decide to uninstall the ap- The responsiveness of the GUI in an Android application is plication and/or rate it negatively in the app market. an important component of the user experience. Android Android guidelines [9, 6] are very clear on the importance guidelines recommend that potentially-expensive operations of designing responsive applications. The general rule is the should not be performed in the GUI thread, but rather in following: \In any situation in which your app performs a separate threads. The responsiveness of existing code can potentially lengthy operation, you should not perform the be improved by introducing such asynchronous processing, work on the UI thread, but instead create a worker thread either manually or automatically. and do most of the work there." [9]. One simple view is that all potentially-expensive opera- There are various mechanisms for achieving this goal. Typ- tions should be removed from the GUI thread. We demon- ical examples include user-managed threads, AsynchTask, strate that this view is too simplistic, because run-time cost and IntentService. The responsiveness of existing code under reasonable conditions may often be below the thresh- can be improved by introducing these mechanisms either old for poor responsiveness. We propose a profiling ap- through manual refactoring or by using automated transfor- proach to characterize response times as a function of the mations (e.g., [12, 11]). A natural question that arises in size of a potentially-expensive resource (e.g., shared prefer- this context is the following: which operations should be re- ences store, bitmap, or SQLite database).
    [Show full text]