Unit Testing falsehoods
Sadly, the discussion was like asking blind people to critique a painting. None of the participants (save the host, Scotty) actually knew what Unit Testing was, or had ever done any. It was the most ill informed discussion I’ve had the misfortune to hear in a long while.
“asserts are just another form of unit testing.”
“Well, I know my code, so I don’t have to bother with unit testing.”
“Unit testing doesn’t give any value.”
(all paraphrased, but it’s the gist of things).
It’s weird, sort of like jumping back 10 years in time. Like the whole agile thing never happened.
Now, I completely accept that XCode might have terrible support for unit testing. It’s possible, I have’t got that far yet. Likewise, OCUnit might be hard to use. But that doesn’t negate the value of knowing that you’ve fixed something and don’t have to go back to it.
This is particularly surprising, given the high quality of what I’ve seen in Cocoa so far. Apple is big on design patterns. In particular, MVC plays a huge rôle in Cocoa apps. Controllers and Views might well be hard to test, because they’re part of the GUI. But your Model (which is the core of your application) should really be amenable to testing.
I really hope that the rest of the Mac development community isn’t so stuck in the dark ages.