Leverage Automation to Make Mobile Testing Manageable

The most significant facet of mobile testing is understanding the mobile ecosystem.

Mobile applications are growing in use and sophistication along with the speed of the networks and the increasing power of the devices. To be sure, mobile application testing can be done with minimal automation, but a high level of test automation will help assure the best quality mobile applications.

The most significant facet of mobile testing is to understand what goes on in the mobile ecosystem to be able to design tests appropriately. This sounds obvious, but due to the complex nature of the mobile ecosystem, it isn’t. The multiplicity of devices and operating systems alone make for a very challenging testing matrix, but layered on that are a variety of hardware operational nuances. These include what are best described as interruption events; things like incoming call and message notification, change in network speed, and power warning notices.

The risk of having a test work for a while and then inexplicably break is high in the absence of a significant emphasis on up-front test design and structure. For example when testing an application download function, the outcome of the test is dependent on the application, the device and the OS version. What seems as basic as automatically installing an app and launching it without manual intervention can be surprisingly complex.

Design Then Test

For any automation effort the primary key to achieving success will be the approach. As a rule of thumb test automation is successful when the “5% rules of test automation” can be achieved, which means that no more than 5% of test cases should be executed manually, with no more than 5% of testing resources applied to reach that level of automation. This is aggressive, but achievable. Having this as a goal puts the focus on effective testing, not on test execution or automation scripting. Establishing an aggressive goal will help drive efficiency throughout the entire test team.

Anyone who has been testing for any length of time knows there are many ways to get a short-term boost in testing efforts. However, to achieve lasting results it is necessary to have a good high level organization of tests and an automation tool that can effectively execute tests and increase the scale of testing without adding overhead. Ideally, the automation tool should incorporate an agile keyword-driven automation framework. The proper organization and the right tool will enable mobile test processes that include all of these:

  • Effectiveness. It must be robust and aggressive enough to find the hidden bugs and problems
  • Efficiency. It must minimize time, costs and utilization of resources
  • Manageability. Managing testing and test automation can be even more challenging than managing software development
  • And…not boring or repetitive. Bored testers are not sharp testers. Monotonous execution tasks should be done by automation, so testers can focus on more creative and ambitious test scenarios.

At LogiGear, our test teams are trained on the Action Based Testing method (ABT). ABT borrows from state-of-the practice object-oriented software programming that radically changed software development. The approach it promotes makes test design and development essentially one and the same. ABT focuses on the use of action keywords to design tests for automation and the modular test design concept it promotes integrates especially well with Agile practices. In application we have found this approach enables test teams to consistently attain the 5% goal of test automation.

Test Tools

Few testing organizations are exempt from the pressure to test faster. The typical response is to focus on selecting an easy-to-use tool and then create manual tests routines and automate them, or create tests based on an existing tool. Either way can be adequate for a few hundred test cases, but it is difficult to scale. Test sequences captured with record and playback are fast to create but costly to maintain. Lengthy test scripts usually contain steps that are likely to be repeated in other tests. Any application change that includes common steps will impact all tests and increase maintenance time and/or require creating new tests. The rapid rate of change in the mobile environment almost guarantees test requirements will change. And we all know that nothing saps productivity like recreating hundreds of tests.

The TestArchitect tool set was specifically designed to support ABT and employs a modular concept to streamline test design and management. The benefit of the modular approach is that when there is a change in an application, only the associated task(s) or function(s) in a module need to be changed, not the entire test. Take a secure logon operation as an example. With ABT a test of the secure logon would be created as an action with a keyword name. For every test requiring logon, the action would be included so the test could execute. If the logon action changed, say from a numeric entry to a motion sequence, one update to the logon action script would automatically update every test that required the logon script.

We have, and are currently working with a number of companies to improve their mobile testing efforts by incorporating ABT and TestArchitect. What follows are the test processes supported in TestArchitect that make mobile testing successful.

One Test, Multiple Targets

There are 3 dominant code bases for mobile devices: iOS, Android and Windows Mobile that most applications will be designed for. For every platform, you will likely need to test different hardware configurations, for example iPhone and iPad, Nexus S and Galaxy Tab, etc. This means there is a substantial opportunity for bugs to appear between different versions, and every time you make a code change there is risk of breaking something that used to work. Here it should be evident that creating and maintaining separate tests for each variation is not very practical.

The ideal solution is to create one set of tests that can be used for multiple devices and applications. This is what action keywords and modular test design enable you to do— by separating tests from the underlying code. Tests are created using actions that outline the task of the test. The automation tool assembles the test scripts from the actions, freeing test developers from tedious coding. The abstraction engine in TestArchitect translates the test cases into the appropriate code for the target device(s). There is some work required by automation engineers to map the appropriate interface, but this is a fairly minor task. The result is that 100 or 1000 test cases can be multiplied across a number of devices and OSs, with a fractional use of testing resources.
Mobile UI Testing

Mobile devices rely heavily on object oriented user interfaces for screens and controls. Routines are increasingly executed by taps, swipes and pinches and less on keypad inputs. Test cases that verify the flow and dialogs of the UI should be created and executed early in the test cycle to catch UI issues that could impact automation in the later stages. This will eliminate hours of investigative time to find the tests that need to be corrected.

There are two methods to test the UI actions–image based and object based testing. Object access to controls is a much more powerful and a maintainable option. It will expose virtually all properties of a screen or control to the test tool and also be visible to a developer. These properties can be used to identify a control or to verify the control values. For example with this approach the caption on a button will be visible as the “text” property of that button.

Object oriented testing isn’t impacted by UI dynamics such as changes in background, image size or orientation. Automating the testing requires access to the OEM provisioning files (Apple’s is ipa and Android is APK). TestArchitect installs its signature in the file to be able to interact with the object. The downside is that not all apps can access the provisioning files, for example Android security will not allow access to built-in applications.

Image-based automation will provide a true “end user approach” that verifies the tests sees the same image as the user. The test automation engine acquires the images from the on-screen display to perform the tasks required for the test. It doesn’t matter what the underlying technology is; if it is visible on the screen, image-based automation can interact with it.

Since it appears that image-based testing would work more often than object-based testing it begs the question, “Why not just use image-based testing”? The answer is that it is generally more sensitive to even minor changes in the UI or the application under test, and it is harder to let the same test run across different devices with different screen resolutions. In order to verify the app continues to work as expected when any of the parameters change, test cases with images for those specific parameters are needed. Here again, the modular test structure in TestArchitect makes it possible to minimize maintenance by creating a module just for the images. By just updating the test in the image module, all tests containing the images will be updated.

Testing Multiple Devices

Any good mobile test automation will include testing multiple devices simultaneously. This can involve running one test on many devices in parallel, and depending on the application it may require testing devices while interacting with each other. These types of tests can be run with agents or simulators, or a combination of both.

Mobile emulators can be essential for developing and testing a quality application. Emulators are good from the standpoint of running standard UI interactions and being able to do exploratory and benchmark testing economically. The technology enables developers to verify certain functionality that is not specific to any device, carrier or operating system, and for testing usability including data input, button use, etc. – all with the convenience of a full keyboard and mouse. However, emulators and simulators don’t operate in the real world and it is always recommended to test real devices in the native operating environment. Once satisfied the test parameters are correct, automation agents can execute tests on the actual devices (and run tests in parallel with emulators) for specific versions of devices and or OS so that testing effort can be maximized.

Cloud based services are also an option for testing multiple devices. The benefit is that these services have a wide range of devices and you pay only for use. The risk is uncertainty of the validity of the outcome. Many of the phones used in cloud based services have been jail-broken which can result in unintended consequences. This can be the case when an application relies on a specific carrier’s network security–what worked fine in the lab may not work when released to customers. Again, a good way to validate this is to test one or more actual devices.

There are device connectivity options as well. Devices can be connected to the host machine via USB and Wi-Fi. In most cases a USB connection is necessary to set up the automation agent, but once operational the tests can be driven over Wi-Fi. This has the benefit of testing the sensitivity of the application and device to changes in speed and or network signal strength–which users will encounter in the real world.

Summary

The demands for mobile test automation will continue to grow along with the increasing adoption of mobile devices. Due to the multiple OS standards and the multitude of device providers testers face a highly complex testing environment. By adopting the right techniques and methods and employing the appropriate tools, it is possible to tackle complex automation and be able to effectively scale as the need requires. It all starts with planning. Part of that planning should include learning and implementing new methods and tools that will improve efficiency. Those who are committed to long-term success in their field recognize this and embrace it.

Hans Buwalda

Hans leads LogiGear’s research and development of test automation solutions, and the delivery of advanced test automation consulting and engineering services. He is a pioneer of the keyword approach for software testing organizations, and he assists clients in strategic implementation of the Action Based Testing™ method throughout their testing organizations.

Hans is also the original architect of LogiGear’s TestArchitect™, the modular keyword-driven toolset for software test design, automation and management. Hans is an internationally recognized expert on test automation, test development and testing technology management. He is coauthor of Integrated Test Design and Automation (Addison Wesley, 2001), and speaks frequently at international testing conferences.

Hans holds a Master of Science in Computer Science from Free University, Amsterdam.

Hans Buwalda
Hans Buwalda, CTO of LogiGear, is a pioneer of the Action Based and Soap Opera methodologies of testing and automation, and lead developer of TestArchitect, LogiGear’s keyword-based toolset for software test design, automation and management. He is co-author of Integrated Test Design and Automation, and a frequent speaker at test conferences.

The Related Post

To help testers gain an edge, here’s a list of free resources Mobile testing is making leaps and bounds of progress in the overall testing space. As this field is highly dynamic, a tester must constantly evolve and improvise his or her knowledge of mobile testing. To help software testers gain an edge, I have compiled the following list ...
LogiGear Magazine – September 2013 – Mobile Testing
Manual testing teams may not be able to test all the processes with each build Test automation of applications has been around for many years. There are many of us in the automated testing field that started very early in the test automation phase, but the introduction of mobile devices has brought on a new angle ...
This is the second part of a two part article that analyzes the impact of product development for the internet of things (IoT) on software testing.  Part one of this article (LogiGear Magazine, Sept 2014) gave a wide view on the IoT, embedded systems, and the device development aspects of testing on these projects. This ...
LogiGear Magazine December 2012 – Mobile Test Automation  
To ensure the success of an app, QA must be involved in all stages of development. Quality Assurance (QA) plays a vital role in the development of mobile applications, but many overlook the critical nature of this piece of the app development process. To ensure the success of an app, QA must be involved in ...
To start with, we need a Test schedule. The same is created in the process of developing the Test plan. In this schedule, we have to estimate the time required for testing of the entire Data Warehouse system. There are different methodologies available to create a Test schedule. None of them are perfect because the ...
Testing appears to be the least popular topic in Android development circles based on the relatively few books on Android app testing. Most tend to focus on development because, unfortunately (but true), application testing isn’t be something most developers think much about, or if they do, they don’t do it systematically (I’m guilty of this ...
What you need to know to get started Introduction to mobile application testing Gone are the days when the telephone was an appliance that sat in a corner and had to ring to get our attention, or a computer was a machine only few people used — these devices are now an extension of our ...
Great mobile testing requires creativity to find problems that matter. I’d like to take you through the thought process of testers and discuss the types of things they consider when testing a mobile app. The intention here is to highlight their thought processes and to show the coverage and depth that testers often go to.
Whether Or Not You Have a Mobile App You’re walking down the street. You see something interesting, and you want to know more about it. What do you do? Do you wait until you get home, open up your laptop, and type “google.com” into your search bar?
The mobile application ecosystem is very dynamic. OEMs are launching new devices and new customization, and new OS versions are delivered every now and then. This is the constant challenge that most enterprises face.

Leave a Reply

Your email address will not be published.

Stay in the loop with the lastest
software testing news

Subscribe