Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Choosing iOS testing frameworks

We would like to integrate a tests suite in our iOS app. To have an overall idea, this app is using web services, is saving files on the device and has some complex navigation parts. The requirements: - run the tests suite with Jenkins - being able to launch the test suite on a set of devices and iOS versions - we don't expressly need something readable by non devs like Calabash proposes

We were thinking about doing some workflow testing (interaction bringing from one screen to another) and unit testing. We googled a bit but articles are often at least 2 years old which is like the Paleolithic period in the mobile world. But still, it gives some nice first inputs.

For Unit Testing, we were thinking about:

  • GHUnit
  • XCTest
  • Kiwi

For workflow testing, we were thinking about:

  • Zucchini
  • Calabash

Regarding all the mentionned requirements, does anybody see any advice to chose one framework or the other (or another proposition)?

Thank you for any feedback.

ps: by the way, some interesting articles we have found on the subject that can help: http://blog.lesspainful.com/2012/03/07/Calabash-iOS/ http://iosunittesting.com/faq/

like image 371
Toka Avatar asked Apr 07 '14 12:04

Toka


1 Answers

I recommend Kiwi for unit testing for several reasons:

  • It supports nested contexts that can each have their own setup and teardown blocks. This allows your tests to be more DRY. XCTest only has one setup and teardown method which is used for all the tests in a file. With Kiwi's nested contexts, you can have setup code that is performed before some but not all of your tests based on how you define the contexts.
  • Kiwi has great support for mocking/stubbing dependencies when needed. I have found it to be more robust than OCMock (mocked class methods with OCMock stuck around after the test if you forgot to call -stopMocking whereas Kiwi always makes sure to teardown mocked class methods after each test).

I am not experienced in workflow/application testing but I plan to eventually check out KIF and UIAutomation.

I would highly recommend looking at iOS Tests/Specs TDD/BDD and Integration & Acceptance Testing for a more comprehensive discussion of testing libraries.

like image 109
tboyce12 Avatar answered Sep 21 '22 13:09

tboyce12