Manage Learn to apply best practices and optimize your operations.

Master interrupt testing on mobile devices

Since mobile devices were made to be interrupted, the challenge is to create -- and test -- an app that rolls with it all. Yvette Francino explains how interrupt testing works.

Smartphones have plenty of great capabilities, allowing users to multitask like never before. This is excellent...

for a consumer, but for the tester it means coming up with new ways of testing. For example, in the middle of working on a mobile application you get interrupted by a phone call or text message. Will your application be able to operate as expected once you get back to it? Interrupt testing can be time-consuming when done manually, but using tools to simulate interruptions can lighten the load for testers. Let's take a closer look at interrupt testing, challenges and tools for mobility applications.

Types of interrupts

Interrupt testing is one of the most crucial types of testing for mobile applications, but because this type of testing is unique to the mobile market, it's an area in which testing skills and accompanying tools are still evolving. There are a variety of interrupts that can occur while using an application. These interrupts, such as incoming calls and text messages, can happen at any time, and the user should not be expected to "pause" their application or save needed data. It will be up to the application to ensure the appropriate action happens when an interrupt occurs.

Some examples of interrupts include:

  • Incoming and outgoing SMS and MMS
  • Incoming and outgoing calls
  • Battery removal
  • Cable insertion and removal for data transfer
  • Network connectivity enabled or disabled
  • Device power cycle
  • Incoming push notifications
  • Low memory or battery notification

Primarily, interrupt testing should ensure that applications are able to cleanly suspend and resume without disrupting the intended functionality. Depending on the nature of the application and the platform, different things may happen. The action an application takes during an interruption needs to be decided as a requirement up-front so that proper validation can occur. For example, if your application has an audio component, will the audio temporarily be suspended when the interrupt occurs? If your application is in the midst of logging on when an interrupt occurs, will it crash? Will it continue with the login? Will it save the login data?

Each mobile platform has its own recommendations for interrupt handling. For example, stale resources need to be cleaned up on iPhone applications when low memory notifications are received. If the iPhone application is data-centric, the state of the application is required to handle any premature exit of the application and have the ability to initiate from the same point when the application resumes.

Mobile applications that are client-server based need to be able to gracefully deal with loss of connectivity and properly sync up once the network is again available.

Automated testing

Though you'll want to do some manual testing for usability, automated test tools can provide a great deal of help in simulating interruptions.

One automated mobile application tool that can help with interrupt testing, among other types of mobility testing, is mAutomate. MAutomate is a record and playback tool for mobile application testing. Testers are able to record a clean functional test, without the interrupts, to be executed on target devices. Then, using the tool's wizard, the tester can insert interrupts at any stage in the test script without writing a single line of code. The tool is able to simulate the specified various interrupts on the device under test and then send the screenshot results back to the tool's Web interface.

There are other automation test tools available for mobility and interrupt testing depending on the device's operating system. For Android apps, a command-line tool called The Monkey is available through their SDK. Though the tool is advertised as a way to stress test mobile applications, it's also useful as an interrupt test tool.

"Monkey testing" is a term used to indicate testing in a random fashion, or generating random keystrokes or events -- such as a monkey might do -- to see how the system under test reacts. Using The Monkey mobile test tool, the tester is able to send a pseudo-random stream of user events to an emulator or device and then validate for appropriate behavior or report on errors or unhandled exceptions.

For iOS apps, there's a similar open source tool available via GitHub, UI AutoMonkey.

UI AutoMonkey is able to generate multiple commands that can be used, again, for both stress testing and interrupt testing. A template is configured that tells the tools which commands should be executed during the test session. After execution, the tool will generate an overview of problems or potential issues.

Automation tests such as these can be set up to be run automatically with every commit as part of a continuous integration system. This ensures that no code will be deployed without passing all automated regression tests.

With the large number of unpredictable events that can happen on mobile devices, interrupt testing is crucial, but can be a challenge. However, thanks to readily available automation tools, the tester is able to simulate interrupts and catch issues quickly. Some amount of manual exploratory testing for usability will still be necessary, but thanks to automation test tools, the majority of the tedious testing can be accomplished quickly and repeatedly, helping the team build and deploy a high-quality mobile application.

Next Steps

Here's why testers cannot afford to get complacent

The ABCs of mobile testing

Do you have the guts to be a software tester?

This was last published in March 2016

Dig Deeper on Unit, Integration and Functional Software Testing

PRO+

Content

Find more PRO+ content and other member only offers, here.

Join the conversation

6 comments

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

What is your favorite go-to tool for interrupt testing?
Cancel
Agreed that interrupt testing is an important aspect of mobile testing, which is why I’m surprised that so few testers are experienced with it. Then again, it’s an important aspect of non-mobile testing as well, and I know many testers never actually consider it at all.
Cancel
Michael, it's actually ironic, considering that the concept of interrupts pre-dates mobile and windows-based multitasking. State of registers and the stack upon entering and exiting an interrupt was like a number one concern, and many ugly crushes and intermittent problems were caused by the interrupts.
Cancel
Agreed. Interrupts are covered fairly extensively in the BBST Foundations course offered by the AST but, I think for many students, it’s the first time that they have been exposed to interrupts and the effects that they can have on the system under test.
Cancel
"Interrupt testing can be time-consuming when done manually, but using tools to simulate interruptions can lighten the load for testers".
"Thanks to automation test tools, the majority of the tedious testing can be accomplished quickly and repeatedly."

It seems to me that the author carries an attitude that testing is a burden that no one wants to do. I'd suggest to invest some time learning what testing really is.
Cancel
Hi Albert, I've been involved in the world of software quality and test for many years and I think there are tedious tests (regression tests) and tests that allow us to use creativity (exploratory tests). Certainly if automated test tools can handle much of the tedious, it will allow testers to use their creative skills to an advantage.
Cancel

-ADS BY GOOGLE

SearchMicroservices

TheServerSide.com

SearchCloudApplications

SearchAWS

SearchBusinessAnalytics

SearchFinancialApplications

SearchHealthIT

DevOpsAgenda

Close