Outlining the challenges in mobile app development and testing
Speaking to TechTarget, Erdal Tuleu, director of engineering at imo, outlined how mobile app development has created new testing challenges such as ensuring that messages are delivered to multiple clients and endpoints. He stated that imo team members routinely run around with a “whole bag of devices” to vet each one’s peculiarities.
“In the past it wasn’t too common to have more than one station,” Tuleu told TechTarget. “People usually logged into their laptop or desktop and closed it before going home and logging in again there. Now it’s fairly common for people to have more than one station. For example, you can have it open on your laptop and again on your phone.”
It’s not just devices that are challenging. In a post for DeveloperEconomics, Jim Cowart lamented that developers often are unaware of what tools are available for helping them overcome common obstacles.
Unit testing in iOS, Android and PhoneGap/Apache Cordova
Take unit testing, which typically targets a small slice of code and assesses its behavior. Since unit tests are automated, they are a highly efficient way to look for problems such as regression bugs. Here’s how unit testing can be handled with iOS, Android and Phone Gap.
Writing for the M-Way Solutions blog, Marcus Kohler pointed out that unit testing tools are freely available and built-in to XCode. He provided the following code example of a simple unit test that would check whether a given topic existed:
Topic *namedTopic = [[Topic alloc] initWithName:
@”the Topic should have the name I gave it”);
Overall, doing unit testing for iOS is inexpensive and requires minimal setup. Plus, the large selection of bundled tools means that teams usually have what they need to follow test-driven development approaches.
Google recommends the JUnit framework for doing unit tests on Android. Various extensions can simulate Android elements.
Alternatively, there’s Roboelectric. It runs unit tests directly in the Java Virtual Machine. Tests can be done from the IDE and as part of continuous integration processes.
Unit testers may also try out code using the PhantomJS WebKit browser. Like Roboelectric for Android, PhantomJS is easy to weave into a continuous integration workflow for automatic testing of the codebase.