OCUnit, one of the first testing unit frameworks for any language is available at

A tutorial, "Unit Testing for Objective-C using ProjectBuilder and OCUnit" is available on Stepwise at

see also SenTestingKit


The tutorial at Stepwise is very old and uses deprecated macros. Instead, you should use these macros

STAssertNil(a1, description, ...)

STAssertNotNil(a1, description, ...) STAssertTrue(expression, description, ...) STAssertFalse(expression, description, ...) STAssertEqualObjects(a1, a2, description, ...) STAssertEquals(a1, a2, description, ...) STAssertEqualsWithAccuracy(left, right, accuracy, description, ...) STAssertThrows(expression, description, ...) STAssertThrowsSpecific(expression, specificException, description, ...) STAssertThrowsSpecificNamed(expr, specificException, aName, description, ...) STAssertNoThrow(expression, description, ...) STAssertNoThrowSpecific(expression, specificException, description, ...) STAssertNoThrowSpecificNamed(expr, specificException, aName, description, ...) STFail(description, ...) STAssertTrueNoThrow(expression, description, ...) STAssertFalseNoThrow(expression, description, ...)

These are all listed with comments in /System/Library/Frameworks/SenTestingKit.framework/Versions/A/Headers/SenTestCase_Macros.h

The code from the tutorial should look like this with the new macros:

#import "TestPerson.h"

import "Person.h"

@implementation TestPerson - (void) testFullName { Person *person = Person alloc] init];
[person setFirstName:@"Pablo"]; [person setLastName:@"Picasso"]; [[STAssertEqualObjects([person fullName], @"Pablo Picasso", nil); [person release]; }

More info on unit testing can be found via google. You might want to read this since: Test-Driven Development Is Not About Testing.