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.

©2011 iPhone, iOS 4, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.

.

DeliciousTwitterTechnoratiFacebookLinkedInEmail

Leave a Reply

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