Unit Testing Series

Fri Feb 1 2013 | Mark Struzinski

I have wanted to get better at unit testing and the tooling around it for some time. I usually start out determined to get a good amount of the code covered by unit tests, and to possibly get some UI tests built around user interactions. Unfortunately, deadlines intervene, and the tests get abandoned. With my most recent project, I decided to put all of these practices in place.

This is going to require learning as I go, and I intend to document my progress here for my own learning and hopefully to help anyone else who is researching the same thing.

I intend to use the following technologies:

  • Unit testing using standard the OCUnit/SenTest frameworks included with Xcode
    • I’ve flirted with other projects in the past, including Kiwi . I really like the syntax and organization that Kiwi provides, but I want to stick with the out of the box stuff for now
  • Integration/UI testing with Frank. I’ve got a fair amount of experience with Frank. I’ve also played with KIF, and much prefer the separation and tooling that Frank provides
  • Continuous Integration using Jenkins
  • Build versioning using a build script for automated version increments for release builds

I’m going to try to document my thought process and all the steps I take along the way. Hopefully, I can get some constructive feedback on any improvements I can make.


This is a post in the Unit Testing Beginner Series series.

Other posts in this series:

This is part 4 in a multi-part series on iOS unit testing and integration testing. In the last post, we discussed setting up Core Data and the Magical Record library. This week, we’re going to set up our logic testing bundle. Let’s get started.

This is part 3 in a multi-part series on iOS unit testing and integration testing. In the last post, we discussed setting up SVProgressHUD.

This is part 2 in a multi-part series on iOS unit testing and integration testing. In the last post, we discussed setting up the project and adding some dependencies with CocoaPods.

Today, I’m going to go through setting up some initial code to use the 3rd party libraries to make sure that the libraries are working. Then we’ll set up logic tests and see what breaks with CocoaPods (spoiler: compiler errors ahead!).

I’m continuing on my task to get a full project using iOS unit tests and integration tests. My first step is to set up logic tests in Xcode. I recently watched an excellent unit testing course on Lynda. In that course, Ron Lisle goes over the advantages of using logic tests. The most compelling factor in using logic tests over application tests is speed.

I have wanted to get better at unit testing and the tooling around it for some time. I usually start out determined to get a good amount of the code covered by unit tests, and to possibly get some UI tests built around user interactions. Unfortunately, deadlines intervene, and the tests get abandoned. With my most recent project, I decided to put all of these practices in place.