Basic knowledge collection for iOS App Testing:
“You know, everybody has a cell phone, but I don’t know one person who likes their cell phone. I want to make a phone that people love.” – Steve Jobs.
That was about the iPhone by Steve Jobs. Steve really made Apple work towards making their mobile device an all-time favorite one for everyone.
Users have always loved Apple mobile devices, be it, the iPhone, the iPod Touch or the iPad. Current data suggest that there are almost 1 billion Apple devices operational in the world that are running on iOS.
That’s a whole billion of them.
Following is the market share analysis of iPhones in 2016:
What You Will Learn:
- iOS Testing
- Types of iOS Application Testing
- Manual Testing – Using Device
- Manual Testing – Using Emulator
- iOS Automation
- Best Practices to Test an iOS Apps
- iOS Automation Frameworks
- Recommended Reading
iOS is a mobile operating system that was designed by Apple precisely for their devices, often termed as iDevices. Since 2007, when the iOS was made for the iPhones only, the operating system evolved to support the Touch devices and the iPads too.
Current research reports that iOS is the second most popular mobile operating system in the market. Android runs on devices built by various manufacturers, but the beauty of iOS is that it is restricted only to Apple hardware, which clearly states the popularity of the operating system.
iOS has seen a total of 10 major releases over the years and has offered notable feature updates in its every release.
This iOS operating system is famous for its user-friendliness, fluidity in operations, crash free apps etc. While discussing the APPs, the Apple iTunes app store for iOS is quite too rich with a number of apps shooting up to 2.2 million. The downloading of apps has rapidly gone up to a whopping 130 billion in number.
iOS is an operating system, which is not restricted by any zonal or language barrier. This is one of the major factors of this operating system that is becoming so famous in merely 10 years of its development. It supports 40 different languages.
Not just the languages, even the UI of iOS devices is very appealing and classy as well when compared to the Android devices.
While talking about the Applications in detail, below mentioned are some of the statistics on it:
- The Apple iTunes app store gets almost 1000 new application submission each day.
- About 1/3rd of the total applications in the Apple iTunes app store are free to download.
- The paid iOS application charges range from 1.10 to 1.30$ on an average.
- The average price for an iOS game ranges from 0.55 to 0.65$.
How many applications have you used on your iPhone, iPod Touch or iPad?
Quite a handful! Right? Starting from Gmail and Facebook to Clash of Clans and Asphalts. This kind of applications, the numbers, and the variety of users bring software testers some serious business. Don’t they??
As a tester, not only the functionality, but an in-depth UI testing also needs to be done to verify the app on iPhone, iPod and iPad due to the variation in their sizes.
As discussed earlier, iOS is only limited to Apple hardware or Apple made devices. That’s indeed a huge relief. However, there are numerous Apple devices and their versions that support iOS.
Bottom line is that Apple has a closed system, unlike Android which is an open system. The releases of OS or devices are well planned.
This is an added advantage because:
- The size of the devices that are available or going to be released are fixed and as a QA we need to have a very clear idea of what all devices are out of the market. It becomes easy for a QA to decide the test bed for testing
- Like devices, we don’t need to do a deep analysis for the OS, since it is a closed system, it is less time (and effort) consuming to decide about the test bed for OS testing.
- Apple has a good variety of their own automation tools although they are a bit tricky to learn.
- I remember that for GPS testing for Android I had to spend 2-3 days to find out how to create dummy scripts to send fake location. But it was very simple and straightforward in iOS as it has an inbuilt functionality to send fake GPS for walking, running, cycling etc.
- For the initial testing, it is not recommended to test the GPS by a field test, sending dummy GPS data is advisable and it saves time as well.
- Apple has strict guidelines for submitting an application, this is a great help in a way rather than getting rejected after submission and a good chance of success, unlike other OS where there are no strict guidelines.
- The functionality of the device and OS itself is fixed and straightforward hence it reduces the chances of missing out the ways in which an app can work. In iOS, there is no way to force stop an app while we can kill and force stop apps on android. Thus complexities are reduced for testing here.
These are some of the advantages that we derive from Apple products but not necessarily that these are the advantages of every product or app. While for the apps which are developed in Cross-platform, iOS is difficult to handle.
The high-level classification is as shown below:
The first step in getting into iOS application testing is to consider the type of implementation.
The application implementation can be any of the below 3 types:
1) Web-based Applications: These are the applications which behave similarly to the build in iOS applications. These are the normal websites that a user accesses on the iPhone’s Safari browser.
2) Native Application: An application which is developed using the iOS SDK [Software Development Kit] runs natively on the supported iOS devices like VLC, Flipboard, Uber etc.
3) Hybrid Application: This is the mixture or hybrid of both the types mentioned above. This gives access to the web content through a web content viewing area and also has some user interface elements for iOS. Eg. Zomato, Twitter, Gmail etc
Types of iOS Application Testing
The different types of iOS application testing [as it is done in typical conditions] can be as follows:
- Manual Testing – Using Device
- System Testing
- UI/UX Testing
- Security Testing
- Field Testing
- Manual Testing – Using Emulator
- Unit Testing
- Integration Testing
- UI testing
- Automation Testing
- Regression Testing
- BVT Testing
- Compatibility Testing
- Performance Testing
Example of an Application:
Before moving into the various aspects of iOS testing processes, let’s take an example of a typical iOS application.
Let’s take a sports team fundraising application into account. The application will have a social account login [Google / Facebook] and a Payment page.
Before going to the payment page, there should be an option to select the system defined amounts or a custom field to key-in the amount. Once the payment is completed, a certificate PDF should be displayed on the screen and at the same time, the PDF must also be emailed to the email account of the user who is currently logged in.
Manual Testing – Using Device
a) System Testing:
This type of iOS testing is performed on the system to check if the various components of the system work together.
In this testing process, the iOS application is launched on a real Apple device followed by its interaction with the user interface to trigger a specific set or sets of user action(s). Typical user actions can be a touch operation or a swipe operation on the screen.
Finally, the result is tested against the expected outcome.
For our Example given above, a typical system test can comprise of the following steps:
- Log in to the iOS sports team and fundraising application using the Facebook account login using open Authentication.
- Select a pre-defined system amount of $10 from the given options.
- Proceed to the payment gateway.
- Select PayTm mobile wallet option for the payment process.
System tests are the operations which mostly cover the various End to End flows in the system. Each test has to be executed with the various available configurations. And, it also depends on the device and the iOS version on which the application is installed.
b) iOS UI Testing
The UI/UX of the iOS devices has been a key element in their success story.
UI/UX testing in iOS devices can be classified into the following categories:
- Inputs: Testing of the Touchscreen functionalities [like Long/Short touch, 3D touch, scrolling], button sizes, positioning of the buttons, Color of the fonts and their size etc., fall into this category.
- Hard Keys: Native applications function seamlessly with the inbuilt hardware keys/hard keys present on the device such as the Home Key, Sound buttons etc. The application under test should also interact with the hard keys in a similar fashion.
- Soft Keys/ Soft Keyboard: How annoying is it when the Keyboard doesn’t appear when you are in your Whatsapp message page? The appearance of a keyboard, facility to hide when you don’t need it, support for smileys, symbols, all the characters/symbols etc. are necessary.
- In our Example, the keyboard can come into the picture at multiple places such as entering the custom amount, keying in the Credentials/Card details in the payment gateway etc.
- Screen: The application if supported across multiple devices should be tested for its orientation in all the devices. There can be some resolution changes based on the device which is chosen for the testing process. At the same time, testing should also be carried out for portrait/landscape modes and the use of the keyboard in each of the cases.
If your app is created not just for iOS then there are few pointers that need to be specifically tested for iOS like:
- Lists: In iOS when there’s a list to be displayed, it always shows up an altogether new screen, unlike Android where a pop-up shows up.
Following is an Example of the same:
- Messages: When an app crashes then the message shown in iOS is different from that in an Android. Also if you have observed, small messages flash on android phones when you free memory like ‘#GB memory freed’ etc., but we can never see flash messages in iOS.
Following is an Example:
- Delete Confirmation: If you observe closely an iOS app, on a delete confirmation popup, the Cancel action is on left of the Delete option. While in Android or other OS it is vice versa.
These are some of the examples which need separate test cases and testing as iOS has its default UI, messages etc., which can’t be changed.
c) Security Testing:
In our example, we have an application with a payment gateway and a login page supported by social page integration.
For Example, let’s assume that you have an ICICI app on your phone and when you log in rather than your account information if someone else’s information is displayed or if you perform a money transfer and the app sends the OTP to some other phone number which is not yours, you can imagine what will happen. Thus, security testing is a must.
Data in terms of Social media login and the payment gateway should be encrypted or secured so as to make the application safe from hacks.
d) Field Testing:
A field test is done to verify the behavior of the app on the phone’s data network.
This test is usually done when the app reaches a stable stage and is not crashing when tested in-house and all the functionality issues have been fixed. This is mainly done to test the performance of the app on the slow data network.
Manual Testing – Using Emulator
a) Unit Testing:
This is mostly done by the development team/individual developer. This testing checks if a particular module of the source code is functioning as expected or not.
Developers design unit test cases for a single component i.e. an isolated module on which they work. This test proves the individual module to be functioning after which it is injected into the source code to work as an element of the integrated architecture. As the header says, this is mostly a manual test run and done using test emulation.
b) Integration Testing:
In the previous steps, we discussed more on unit testing. Now, as we are sure of the functionality of the individual units/modules, it becomes necessary to check the integration as well. This testing is performed to find out the issues related to various integration points.
In our Examples, we can call the login as one module and the payment gateway as another module.
Unit testing will cover the testing of both individually. However, Integration testing will test the integrity of both the modules.
c) UI Testing:
As explained above a UI testing needs to be done for an app as it is a key factor in the success of the app.
Purchasing all phone models for testing is practically not possible because it would cost a lot. Hence using emulator is the best option as it is free of cost and also obvious UI bugs are easily caught on emulators.
a) Regression Testing:
In the ever-changing environment, changes are continuously done to enhance the application or to fix the issues that were found in the previous version of it. While implementing the changes, there comes the chance where the changes done to the application can alter the existing functionality.
In simple terms, the changes done may introduce a new set of issues in the application.
To verify if the application performs in the same way even after the changes are implemented, Regression testing has to be performed. And, as it is a repetitive activity, automation comes in handy for this kind of test run.
b) BVT Testing:
It is a good custom to have an automated suite run on the new build released for testing as it saves a lot of time and if the basic functionalities are crashing, it gets reported immediately. When compared to a manual effort the results of automated basic verification tests to accept or reject a build can be taken in minutes.
c) Compatibility Testing:
As discussed, there are numerous devices/types that are released by Apple. To be exact, there are 15 different types of iPhones, 6 iPod Touch models, 10 iPad models and 2 iPad Pro models on the market.
Now, when an app such as ours [Sports team fundraising application] is developed, it should be supported by all of the above-mentioned devices. That implies one thing that- All the test cases are to run on all these devices.
Now, manual effort is not possible when the number of devices is huge as this. For compatibility, automation testing is preferred.
d) Performance Testing:
Some of those that are tested in Performance testing are:
- How the application behaves when it is made operational or runs for a very long time. During the operational period, make the application communicate/interact/remain idle.
- The same operation has to be performed with the different amount of loads each time.
- How the system behaves when the data transfer is really huge.
These cases are repetitive in nature and are mostly done using automation.
Best Practices to Test an iOS Apps
Testing iOS applications can be tough, tricky, challenging unless it is done correctly.
In order to move the iOS app testing in the right direction following practices can be implemented:
#1) Forget Emulators: In most of the cases, emulators are preferred over the real devices. But, that’s not the ideal case. Things like User interactions, Battery consumption, network availability, performance on usage, memory allocation cannot be tested on the emulators. So, try to test on real devices all the time.
#2) Automate things rather than doing manually: How quick are you in doing a specific task? In today’s world, everyone is mainly concerned about the time spent. Automation not only reduces the execution time but also increases effectiveness, efficiency and the coverage of the software testing.
#3) Share the work: Share the testing across teams including the development team. We can get the help in terms of manually executing the test cases as well as get the help from the development team in terms of automating the manual test cases.
#4) Catch the Crash Logs: The application for iOS may be freezing or crashing under certain circumstances. To fix the issue, crash logs play a vital role.
Following steps can be performed to capture the crash logs:
- For MacOS:
- Sync the iOS device with the computer [Mac].
- For Mac OS, hold down the Option key to open up the Menu bar.
- Go to Go Menu and click on Library.
- Navigate to ~/Library/Logs/CrashReporter/MobileDevice/<iOS device name>/.
- The log file’s name should start with the application’s name.
- For Windows OS:
- Sync the iOS device with the computer [Windows].
- Navigate to C:\Users\AppData\Roaming\Applecomputer\Logs\CrashReporter\MobileDevice\<iOS Device name>\
- The log file’s name should start with the application’s name.
#5) Capturing the Console Logs:
Console logs give the overall information of the applications on the iOS device.
This can be done using tools such as iTools. In the iTools application, click on the “Toolbox” icon when the iOS device is connected to the system on which iTools is running. Clicking on “Real-Time log” gives the real-time console log.
#6) Capturing Screen: It becomes easy to understand the issue and hence it is easy to fix if the steps are visual.
It is advisable to record the screen or take screenshots of the issues to make the development team understand them better. The screenshot can be taken using the inbuilt feature by pressing the Power and Home button together.
The recording of a screen can be done by using Quick time player recording while the iOS device is connected to Mac using the lightning cable.
iOS Automation Frameworks
Some of the most commonly used automation frameworks are listed below:
Appium uses Selenium Web driver to automate iOS application testing.
This platform is independent and can be used both on the web and mobile devices [both Android and iOS]. This is an Open source one and is not restricted by language. Application changes or source code access is not required for automating using Appium.
Appium works seamlessly independent of the application type: be it, Native, Hybrid or Web.
Calabash is an Open source cross-platform framework which supports both Android and iOS automation testing.
Calabash tests are written in Cucumber which is similar to that of a specification and is easy to understand. Calabash consists of libraries which enable the user to interact with both native and hybrid applications. It supports interactions such as gestures, assertions, screenshot etc.
#3) Earl Grey:
Earl Grey is Google’s own internal UI testing framework. This has been used for testing YouTube, Google Photos, Google Play Music, Google Calendar etc.
Earl Grey is made Open source recently. Some of the major advantages of Earl Grey are, Build-in synchronization, Visibility checks before interactions, true user interaction [Tapping, swiping etc.]. This is very similar to Espresso by Google which is used for Android UI automation.
#4) UI Automation:
UI Automation is developed by Apple and is very similar to UI Automator to Android. The APIs are defined by Apple and the tests are written in JAVA.
KIF stands for “Keep it Functional”. This is a third party and Open source framework.
This is an iOS integration test framework which is closely related to and used for XCTest test targets. KIF is easy to configure or integrate with the Xcode project and thus additional web server or additional packages are not required. KIF has a wide coverage in terms of iOS versions.
iOS application testing can be a most challenging task to do. Hope you had a good understanding of iOS application Testing through this article.
However, selecting the right approach, the best possible testing process, methodologies, tools, emulators/devices, etc will make iOS application testing very successful.
Our upcoming tutorial will brief you all the basic concepts involved in Android App Testing Tutorial.