small medium large xlarge

Back to: All Forums  Other Stuff
16 Oct 2009, 09:37
Alexandre FRIQUET (3 posts)

Hi everyone,

First of all please do not take into account my english as it is not my native language ;)

I am nearly new to programming and I am very interested in Cocoa Development. I first want to thank the writers and publishers of these books for the great stuff they have done for us. Really Thank You!

I have bought and read the books on Cocoa Programming, Core Data and iPhone SDK Dev (some partially) but in no one I found paragraphs regarding unit testings with XCode. I thought that unit testing was one of the bases of pragmatic programming but unfortunately they are not presented for the previous frameworks. I would be interested in knowing the reason of such a lack (in my mind). Isn’t it possible (or easy) to implement unit testing on XCode for Cocoa(Touch)/Core Data? Do mac programmers use such feature (unit testing)?

I saw there were dedicated books for JUnit or NUnit. Wouldn’t it be interesting to have such an idea for the Mac Programming environment? Of course in my mind it does not deal only with the “How To”, but also with the “Why”, “When”, “What for” in order to help beginners (and autodidacts) like me understand the advantages and drawbacks (if there are ;-)) of such a technics…

Looking forward to reading you.

Regards Alex

19 Oct 2009, 18:53
Daniel H Steinberg (97 posts)

Thanks Alex,

I’ve wrestled back and forth with this during the past year as I’ve written the Cocoa book. I’m a big TDD fan and swore by JUnit when I did Java development. OCUnit is the Apple sanctioned approach to unit testing and it just doesn’t feel right to me. The rhythm is wrong. Particularly in a dynamic environment with so much of the coding done in IB, I would expect a much more powerful tool.

I know that BBum has written that they use unit testing internally and that helped make Core Data what it is today – so it has been successfully applied to large frameworks.

There are some third party wrappers for OCUnit that look promising but not, IMO, at a point where I felt we could include them in our books. Apple has some docs on how to get started with OCUnit that should be enough for you to set up and get started.



21 Oct 2009, 07:23
Alexandre FRIQUET (3 posts)

Thanks Daniel for your reply. So my fears were right and unit testing on Mac exists but is not as embedded and trivial as it should be. I will then have a look again in Apple’s documentation and on various posts and podcasts found on the web. I wish Apple really take into account such a demand ;)

Regards Alex

You must be logged in to comment