TDD for iPhone development

I’m getting more familiar with the tools and technology surrounding iPhone development but I still face challenges daily. Hi, my name’s Cliff. You’re here because a random Yahoo/Google search or cross-link from another site pulled you in by your chin hairs. (In the case of women reading you’re here because you’re trying to figure out where you husband/significant other spends all of his spare time.) Bear with me as I try to make sense of the tedium involved in XCode unit testing.

Not yer Daddy’s cup o’ Java!
For score and several years of Java development has seasoned me similar to a rotisserie side of pork spinning slowly over an open hearth. As a flavored piece of pig, I’ve come to expect certain things… from my IDE… from advertised test tools… from any form of modern development. For one, I don’t expect a ton of over head associated with adding a new test. Consequently, copying the Google tools for mac files into each project that wants to be agile is becoming painful. I’ve also come to expect… no demand a certain ability to easily decouple. Running things in isolation is key to true unit tests, not requiring the stars to line up is crucial. I’ve also grown used to the CLASSPATH. For those that only deal in XCode, Ruby, or Cocoa the CLASSPATH is the bane of all Java development allowing one to easily gain and/or dismally lose runtime visibility of entire libraries of supporting logic. Today I’m having trouble getting Objective-C class implementations to be visible without individually adding them. While that’s not too bad I found a classpathy work-around while playing with another open source project a while ago. This other project was setup with individual modules which made me very happy since it smells of modular reuse. It’s main module contained all of the supporting logic and could be embedded or reused in any client application. Writing tests that exercised anything from the project became a simple matter of adding that main module as a dependency of the test target.

My Dilemma
Because I started a project sans knowledge of how to properly decouple I have a bunch of classes tied to the default application build target in XCode. I tried to add this target’s output as a dependency of my test target as I did with the other project. Since the output is an executable application I believe it’s causing things not to work as expected. If you have any idea of a work-around that doesn’t involve adding each file loaded by the test to be manually added to both the application and the the test target then speak up.

Retribution *Ahem* Reimbursement
I’ve asked people to do my work for me plenty times before and I’m not ashamed to do it again. As your reward for being a faithful reader of my blog and committing occasional insight to my struggles you can expect silent but honorable mention as I speak to others on behalf of your contribution. Followup posts on this site to highlight your involvement in any way will be edited, reworded, and/or deleted prior to clearing moderation. (In all reality, I sincerely appreciate all comments and feedback. I don’t actually steal credit unless you request that I do and at the end of the day we’re all working towards a common goal… Don’t take nothing you read here seriously… it’s just jokes!)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s