Structure and Interpretation of Computer Programmers

I make it easier and faster for you to write high-quality software.

Thursday, April 12, 2012

Test-Driven iOS Development

Here it is, after more than a year in the making, the book that they really did want you to read! Test-driven IOS Development (Developer’s Library) (affiliate link) has finally hit the stores[*].

I wrote this book for the simple reason that it didn’t exist. Like Professional Cocoa Application Security (Wrox Professional Guides) (another affiliate link), I knew that the topic was something many people were interested in, including myself. I wanted a single place I could go to find out about using Xcode for writing unit tests, and how the Test-Driven Development approach could be applied to writing Cocoa code with Objective-C.

Well, it turned out that this place didn’t exist, so I tried my best to create it. In the book you’ll see how the BrowseOverflow app was built entirely in a test-first fashion, using OCUnit and Xcode 4. Along the way, I hope you’ll see how TDD can be useful for your own projects.

If you’re interested in finding out more about test-driven development for iOS apps, I’ll be giving a talk on the subject at iOSDev UK in Aberystwyth in July. And of course I’m happy to field questions about the book or about TDD here or over on Twitter. And of course my unit testing video training course is still available from

Happy testing!

[*]The availability appears to vary by country and format, so if it isn’t in your favourite (e)bookstore yet just be patient and keep refreshing that page like it’s the WWDC site.

posted by Graham at 23:01  


  1. Do you have an affiliate link for those of us in the US?

    Comment by mandaris — 2012-04-13 @ 00:14

  2. No, I’ve only got a UK Amazon account. Just buy a few copies of the book so I get bigger royalties ;-)

    Comment by Graham — 2012-04-13 @ 00:36

  3. Hi Graham,

    As a self-taught iOS developer unit-testing is something I have never really looked into or done at all (in any language, even at work it isn’t done).

    Tempted to get this book but is it targeted at people who have done no testing at all in the past or do I need to know the basic concepts beforehand?



    P.S. saw your talk last year and will be there again this year armed with questions and apps :-D

    P.P.S. Amazon UK says not published yet, refresh, refresh, refresh… :-D

    Comment by Oliver Foggin — 2012-04-16 @ 11:45

  4. Hi Oliver,

    I hope the book is suitable for you. It relies on some knowledge of the iOS SDK: you should be able to read Objective-C, and understand what UIKit classes like UIViewController and UITableView do. You don’t need to know anything about testing, the book will introduce the concepts you need before getting into details about how to implement test-driven development for an iOS app. Of course, if you have problems you apparently know where to find me ;-)

    Comment by Graham — 2012-04-16 @ 22:59

  5. Hi Graham, it seems that the kindle edition is only available to customers in the UK. Are you planning on making it available to the rest of the world? I really do hate these regional restrictions I must say that the kindle store imposes. Anyway, looking forward to getting hold of a copy. :-)

    Comment by Jamie — 2012-04-27 @ 06:02

  6. I’m not the publisher, you’ll have to take that up with InformIT.

    Comment by Graham — 2012-04-27 @ 18:55

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress