iOS App Testing

Posted Sep 8th, 2021

Photo by ThisIsEngineering from Pexels

iOS app testing can be a complex undertaking. This article describes the general issues relating to iOS testing in context and will shed light on the specifics of the Sauce Labs offering.

What is iOS App Testing?

This refers to the process when an iOS application is tested on actual Apple devices. The goal of this process is to evaluate whether it works as expected (or not) for specific user actions. The actions may include installation time, load time, user interface, user experience, appearance, behavior, functionality, and performance.

Why Use iOS App Testing?

There are three kinds of iOS apps, each with their own characteristics: native, web, and and hybrid. Something that works in one kind of app may not work in another, and will require testing to alert the developer to the situation.

Native apps

Native apps are apps traditionally built in Swift or Objective-C, using the native APIs provided by the official iOS SDK (software development kit). They leverage the native APIs and UI components Apple provides in the SDK.

Web apps

Web apps are simply mobile versions of web sites. The design of the web site is optimized for desktop browsers, and may not work well with a smaller screen.

Hybrid apps

Hybrid apps are a mix of the previous two kinds of app. There is a native UI component known as a “webview,” which can be embedded into native apps. A webview gives a user a transparent window into web content from any URL, even local URLs. Hybrid apps give creators the ability to develop some or all of their app logic using web technologies, but retain access to some of the native APIs like camera or media library access.

Types of iOS Application Testing

There are several methodologies available to perform iOS testing. The particular one used by a developer will depend on the app and the environment that surrounds the tester.

Manual Testing For iOS

Manual testing is testing “by hand”. It consists of running the app on a device or iOS simulator, and then navigating through different pre-determined test scenarios. Apart from verifying working functionality according to pre-determined scripts, manual testing is also used in an exploratory fashion, or to help figure out what the test scenarios should be in the first place.

Automated Testing

Manually testing the entire functionality every time a change is made in the app code is problematic. The time it would take to manually verify an increasingly large number of scenarios starts to slow down the development and release cycle. The solution is to write test scripts which automatically walk your app through the test scenarios, and make the appropriate verifications along the way.

There are two main types of automated tests: end-to-end tests and unit tests.

End-to-end tests are when the entire application stack is exercised, from the UI to the app logic to any network requests or backend server functionality. Hopefully, a real user experience is simulated.

A unit test involves coding to test a single component of an app, taken in isolation. The test typically passes to the component a series of variables, and checks that the component returns the correct values. Unit tests help to fix bugs early in the development cycle and save costs from having to correct problems later in the design cycle. OCUnit is a unit testing framework for Objective C in the Mac OS. The biggest advantages of an OCUnit framework is the tight integration into XCode development environment.

Frameworks

UIAutomation is a JavaScript library from Apple that simulates user events on target iOS applications.  It was first introduced in SDK 4, and was removed in iOS 10.

Appium is open source, and is built on the idea that testing native apps shouldn't require including an SDK or recompiling your app. It can be used with native, hybrid and mobile web apps. It drives iOS, Android, and Windows apps using the WebDriver protocol.

Frank is an open-source automated acceptance test framework for iPhone and iPad. It has been fairly well supported over the years.

KIF (Keep It Functional) is an open source functional testing framework. It allows for easy automation of iOS apps by leveraging the accessibility attributes that the OS makes available for those with visual disabilities.

Some of the iOS testing frameworks, including Appium (which Sauce supports), enable connecting to a CI system and run automatic iOS tests in the context of agile development process. Mobile CI is in its infancy relative to CI for web apps, and does not yet always work as smoothly as CI with traditional testing tools.

Get Started Now!

Sauce can show you what is current in mobile testing by giving you a free trial of what you need for your particular situation. Just visit https://saucelabs.com/sign-up to begin the process.


Written by

Sauce Labs


Topics

Mobile TestingiOS TestingApp TestingFrameworksAutomated testing