A Practical Guide for iOS App Testing [with Code Examples]
Project managers have always had a complicated relationship with testing. In the early days, it was considered a necessary evil that slowed the release process – but saved money in the long term. Technology has moved on since those days so, in the age of mobile development, is testing (and in particular unit testing) still the universal panacea it once was?
It’s not just managers that have a complicated relationship with testing, developers do as well. The friction stems from a range of egotistical and psychological sources. A simple question illustrates this nicely: “What would you rather spend your time doing?”
- Learning how to display a table with data you fetched asynchronously from a remote server?
- Grinding your way through a list of tests to ensure your network stack is working as it should?
I thought so, and you’re not the only one. Testing just doesn’t have the ‘coolness’ factor – and so doesn’t appeal to the ego.
Mobile testing, which we will be focussing on in this article, has its own specific problems. I often hear from colleagues how “mobile testing is harder than testing on a server”. And there is some truth to this. Usually, newbie iOS developers assume that testing a mobile app means simulating every step a user might perform. While that’s one way of testing, it’s probably the hardest. It’s also rarely necessary. If your app is well modularized, with low coupling between different parts, you can carry out the same type of tests as a developer writing server code.
Ultimately, what it comes down to is knowing what’s worth testing and what isn’t. This article will help you answer that question. It’s a mobile testing ‘bare minimum’ guide to readying an iOS app for release. One that balances best practices with developing in the real world.
Table Of Contents
The Basics of Mobile Testing: Types and Vocabulary
Let’s take a look at some key vocabulary. To start with, there are three types of testing you need to be aware of. There are multiple options here, for the same reason that there are different types of cars. If you need to move heavy equipment, you might select a pick-up. But if you have to ferry the kids to soccer practice, then a minivan is your go-to option.