Is KIF iOS in line with mobile testing best practices?
As your users turn to mobile the number of apps and devices you need to test your apps on is growing rapidly. And, just as in web testing, there is a need for robust, reliable, and easy-to-use tools for mobile testing. Automation is key as you can't test all the device / browser combinations manually. So the question is, what framework do you use for testing?
In the world of mobile testing, there are a number of open source projects tackling the problem of mobile automation. One of these is KeepItFunctional, or KIF. KIF was created by Square in 2011 to automate iOS apps.
The team who created KIF had a few goals in mind for the framework:
- requires minimal setup to run a test suite
- allows developers to develop tests in the same language as the rest of their code to minimize learning and adaption layers
- can be easily extended to fit developers’ needs
- works in CI setups
The framework allows for running tests on both simulators and real devices, and once the Xcode project has been configured, there are no external dependencies. KIF iOS tests are written in Objective-C, and with the help of WaxSim, tests can be integrated with CI systems like Jenkins.
Comparing KIF to Appium
Sauce Labs mobile testing is powered by Appium, a cross-platform mobile automation framework that follows Selenium WebDriver’s JSON Wire Protocol. We chose to support Appium because we believe it has a considered philosophy that keeps the future of mobile automation in mind. KIF, while a useful framework, does have some major differences from Appium.
First, KIF is purely for iOS automated testing. This means that developers and companies who want to do both iOS and Android testing will need to find a second automation framework for Android testing. This also means that any work that is done to implement KIF or write scripts will have to be redone for Android. In a world that increasingly requires companies to support multiple platforms, this could make mobile automated testing much more difficult and time-consuming.
Additionally, there are some other key differences between Appium & KIF iOS testing which we’ll explore by looking at Appium’s philosophy for mobile automation and how KIF compares.
Appium’s philosophy for mobile automation follows four rules:
- Test the same app you submit to the marketplace.
- Write tests in any language or framework.
- Use a standard automation specification and API.
- Build a large and thriving open-source community effort.
Below, you can see how KIF compares to Appium in relation to these four tenets.
Appium’s first rule for mobile automation posits that to maximize confidence in automated testing, you should test the same app you submit to the marketplace. On this front, KIF does well, since there are no external dependencies for the app. This minimizes the likelihood that you will release an app with unforeseen bugs or regressions.
KIF, however, does not follow Appium’s philosophy of allowing developers to write tests in any language or framework. KIF iOS tests are written in Objective-C, which will be fine for some, but not for everyone. Supporting as many frameworks and languages as possible keeps developers options open and gives them the flexibility to choose what language they’re writing in based on their needs and not simply because they have no other choice.
KIF also fails to use a standard automation specification and API. This means that developers must spend time learning KIF’s idiosyncrasies rather than depend on commonly known specifications. This also means that developers using KIF can’t easily switch frameworks if needed, because they use a tool that differs markedly from other projects.
Last, KIF, while it does have active forums, does not focus on cultivating a truly thriving open-source community to push it forward. Appium, though a younger project, has a thriving community supporting its development, whether by filing bug fixes or contributing code. Appium has held several hackathons, and now has its own meetup group. We believe that it is this enthusiastic community effort that will maximize Appium’s potential.
KIF can be a great option for a iOS mobile automation, and many have found success with it. However, we’re also excited for Appium’s potential.
Interested in diving in and trying Sauce Labs for iOS testing?