views:

1122

answers:

6

I just sat in on a seminar about developing apps for the iPhone. The speaker told me that there is NOTHING available for writing unit tests or functional tests for your iPhone software.

Is this true? Is there really no testing story for the iPhone as of now?

+6  A: 

Yes you can do unit testing, I hope the seminar didn't cost too much. http://stackoverflow.com/questions/159280/do-ocunit-and-ocmock-work-on-the-iphone-sdk

Chris Lundie
+5  A: 

Not true. Before SDK 2.2 there wasn't an official Apple sanctionned unit testing support, but they've since added OCUnit support, which is documented on the Apple website. http://stackoverflow.com/questions/159280/do-ocunit-and-ocmock-work-on-the-iphone-sdk

Google provides a great toolkit (Google Toolbox for Mac) http://code.google.com/p/google-toolbox-for-mac/wiki/iPhoneUnitTesting

I think Google's is a bit more complete because you can also do some functionnal user interface tests.

Hope that helps.

François P.
+2  A: 

No, this is not true. As of iPhone SDK 2.2, OCUnit works fine. In addition there are other open-source unit test libraries you can use with the iPhone.

http://developer.apple.com/tools/unittest.html

August
+5  A: 

Others have pointed out the available options, but I'll point out that even if there weren't any unit-testing frameworks available, there is nothing preventing you from rolling your own. Unit test frameworks aren't that complicated, so lack of one is no excuse.

Kristopher Johnson
+2  A: 

Sen:te (the creator of the testing framework included with Xcode) explains how to use OCUnit with an iPhone project: http://www.sente.ch/s/?p=535&lang=en.

nst
+1  A: 

Gorilla Logic has just open sourced FoneMonkey, a true record/playback functional testing tool for the iPhone that works with OCUnit.

You can learn more at http://www.gorillalogic.com/fonemonkey.

Stu Stern