Quality Coding

Category Archives for iOS TDD

Emoji: Grimacing Face and Relieved Face

Is TDD Worth It? A Positive Testimonial


Is TDD worth the extra effort? I got a reaction from one person who tried applying my tips.

Andy Dwelly began applying my TDD screencasts to his iOS coding. Here’s what he writes in Some notes on Test-Driven Development:

At first progress was almost painfully slow.

Yup. It seems like there’s a lot to learn. The real barrier, I think, is that there is a lot to unlearn. When you first start applying Test-Driven Development to real your code, your productivity will take a hit. This is totally normal. But if you’re willing to press through the learning curve, your productivity will increase again — in ways you haven’t experienced before…

Continue reading

How to Do UIViewController TDD


This screencast focuses on the question I get the most: “Do you do test-driven development for view controllers?” It’s clearly a roadblock for many people. This screencast should remove that roadblock.

It also answers the question, “Is it worth doing?”


  • Three types of unit test verification
  • View controller unit tests: the trick
  • TDD demo
  • How UIViewController TDD can actually help you code faster

Continue reading

Objective-C TDD: How to Get Started


TDD is a series of small steps. It can be difficult to grasp until you see those steps demonstrated.

That’s why I made this screencast. It was sparked by a Stack Overflow question that said, “All the examples of unit testing I read about seem to be extremely simple and trivial.” The question asks how to write unit tests for a piece of sample code that uses NSUserDefaults.

Continue reading

Emoji: Open Book

Test-Driven iOS Development: Book Review


Many programmers assume that Test-Driven Development doesn’t work well for iOS development. This ill-founded assumption really comes from a lack of any experience with TDD. But because iOS developers learn most of their chops by referring to other people’s code, it also comes from a lack of helpful examples.

Disclosure: The book links below are affiliate links. If you buy anything, I earn a commission, at no extra cost to you.

So I was really glad when Graham Lee’s book Test-Driven iOS Development came out. Finally, something I can point others to besides my code!

Continue reading

Emoji: Bowling

Xcode TDD Kata: Practice with the Bowling Game


How do you learn Test-Driven Development? I could explain the principles and practices of Xcode TDD, but the question that comes back is, “But what do I actually do in Xcode?”

That’s what the Bowling Game TDD Kata is for. I have a Swift version and an Objective-C version.

Continue reading

eBay Instant Sale app icon

iOS Test-Driven Development: Can It Really Work?


Test-Driven Development: Does it work for iOS apps?

Short answer: Sure! Here’s an example:

I developed this iPhone app using Test Driven Development

Yeah, that’s a really old image, and no, you can’t find this on the App Store anymore. But this was an app published by eBay. Here’s the unit test coverage:

92% line coverage!

Continue reading