Tutorial: iOS Objective-C Unit Testing Frameworks And How To Use Them

Debugging can be extremely tedious, and chasing down some bad code that you may have written weeks or months earlier just makes things that much worse.  This is where unit testing can be great as you can take care of those bugs in an isolated section of code before they affect the entire program and need to be chased down.

There are quite a few frameworks out there for unit testing with Objective-C including Xcode’s own OCunit which is terrific and easy to use in most cases.  I have found an excellent guide from Doug Sjoquist covering the  benefits and differences of using OCUnit in Xcode 4 along with the OCmock and GHUnit testing frameworks along with tutorials on the basic usage of each.

You can find the tutorial here:
Unit Testing Quick Start Guide

The official documentation for unit testing with Xcode is here.

The github for GHUnit is here.

The official page for Ockmock is here.

A great intro for anyone looking to understand the basics of unit testing with Objective-C especially if you have trouble following the official documentation.

Learn how to program an iOS app using Objective-C right from the start with The iOS Apprentice series. A set of epic tutorials for anyone - even if you've never programmed before.
Read more...
DeliciousTwitterFacebookLinkedInEmail

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can send a Tweet to @maniacdev on Twitter or submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Click on a tab to select how you'd like to leave your comment

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>