Test First Works.

18 August 2009 by Paul

I've been a big advocate of Agile development for a while.  The only thing is, I hadn't really done any true Agile development.

I've worked in an agile environment with an already designed system, and that worked well. We managed to do everything required, get it in on time, and add a bit more than was expected to boot.  We could never have done any of that work without tools like CruiseControl(.Net in this instance), unit testing, code coverage, or the metrics supplied by a myriad of other tools.  Not to mention the 3 massive architecture re-shuffles we did (ahh, we forgot a few things :-s).

And so the other day, as a skills sharpening excercise, and a means of doing something I'd wanted to do for a while, I began the task of upgrading an application I started writing 6-8 years ago, and shelved due to conflicts with my work some 4 years ago.  At the time, I had no idea about Agile and even less about Design Patterns.

My task: to upgrade the app using a whole host of cutting edge technologies and use Design Patterns judiciously throughout.  I pretty much had a design in my head, but when I started coding it, I got a little stuck.  I didn't quite know where to begin this journey, and of course I wanted it to be perfect.  So I dawdled round a few classes and didn't really get anything constructive.

Eventually, it struck me.  Test first! So I took a step back, and re-started my development in a TDD manner.  Interestingly, the app took shape in a near heart-beat.  One test had set up a structure of about 10 classes and interfaces, and spawned another 50 tests to test the functionality represented in those new application artifacts.  I'm still a long way away from the re-written app I set out to develop, but the exercise highlighted to me two very important lessons.

  1. TDD does work.  There's absolutely no doubt in my mind about it. (and yes, I do know that TDD is not Agile)
  2. I've got a long way to go to really be a true Agile guy.

The situation might be slightly skewed by the fact that I've thought about this application almost every day for the last 8 years, regardless of my ability to program it, but then how many developments are truly greenfield?  Almost every app I know takes a little something from somewhere else, and that's as good a starting point as any.  Before you know it, you'll have a full application architecture using Agile, and writing those pesky little tests first.

Enjoy.

YouTube Channel Launched

17 August 2009 by Administrator

We launched our YouTube channel last week including a video of our newest app (currently in review with Apple) - iTouch It.

Check it out!...

 

Using subversion to check in apps

10 August 2009 by Chris

We came across an interesting problem whilst trying to build an app with ad-hoc distribution for testing.

We use subversion for version control and as a central storage for all our source code and general documents etc. and using Versions as our tool to check out files (Versions is awesome by the way!) We were building an app on the mac that had the distribution profile installed and putting it on an iPhone. Things worked fine.

The problem came when we were then checking the .app file into the respository, checking it out on another mac and trying to install on another iPhone using iTunes. iTunes kept showing the message "An unexpected error has occurred".

We were stumped for a good few hours assuming this was something to do with the certificate signing until one of us had a brainstorm - .app files are like folders and so subversion was treating them as such and placing a .svn hidden directory within it. This was screwing with iTunes and so it would refuse to install the application.

The solution was to use .ipa files - basically a zip file with a certain structure that iTunes understands as an application. To create an ipa file do the following...

1. Create a folder called payload and place your app file in it.

2. Zip the folder

3. Rename the file with the name of your application and give it an ipa extension.

Subversion will treat these as a single file (just like it does any other zip file) and so these are left intact. Once we did this the application installed correctly on whatever machine checked the file out.