Thirty seven build runs later...

Three Pair and the development lifecycle

Imagine Cup It occurred to us that we should put more technology related stuff in our Reg Developer blogs, after all that's what really interests us and probably what interests you too.

We guess it makes sense to firstly talk about how we go about developing our application.

At the moment we have 35,045 lines of code, although it's true that many of those will just be { and } because we like nicely presented, block indented code. Even after you consider our formatting, we still have a fair chunk of actual useful code. Unfortunately we haven't got a single end to end use case completed yet, but before we get carried away with talking about what we've got, let's talk about what we want to have.

We've approached the development of this as being driven by three main scenarios. A scenario is a sequence of use case events with a pretty story tying them together that we think should show off the best features of our system. So things like authenticating against the back end won't be in a scenario, but phoning up and getting a voice prompt menu and leaving a message for someone will be.

The scenarios are one approach at tackling the problem, a somewhat customer focused approach. To make sure our system actually works, we've also gone down the traditional approach of drawing fantastically complicated design diagrams, with more arrows then you can shake a stick at.

We started out by deciding on the main architectural components, then laid down the interfaces between the components, and lastly the data that would ultimately need storing. Much like everyone else we have used a distributed tier approach.

We have a data access layer using the Data Mapper pattern, oh yes, our University (Hull) even teaches design patterns and practices. Our data layer then connects to a business tier which provides services to the clients either through MSMQ/Web Services or just good ol' remoting. The idea here is that the client doesn't know what data goes where or even that objects need to have the Save method called if you want them to end up in a database.

Instead, clients call methods on the business tier like CreateNewUser which maps directly to a use case for the client, yet on the back end it involves a fair few Objects and Tables.

That's the design philosophy from 30,000 feet: now to look at the development cycle...

Were lucky in that our university has a good set of resources for us and so far one of the most useful has turned out to be Team Foundation Server (TFS). In the past we've all had experience using Source Safe, CVS, and Subversion, all of which have their own problems and merits - well except maybe Source Safe for which we couldn't really find a nice word for. Anyway, for this project we decided to take a more serious approach and use TFS. After a somewhat steep learning curve - well, steep compared to SVN and Tortoise - it actually became a core part of how we worked.

We're using the scrum approach to development where every (late) morning we stand up in a circle and go through the tasks for the day and any blockers that we have. We then mark-up the tasks on a daily milestone whiteboard, which in turn is fed off our weekly (sprint) milestone board, which is built from the master plan. The master plan, of doom, is a series of feature sets for each scenario attached to a delivery date, and on that date we expect to have a deployable and useable demo.

Deployable. There's an interesting word, indeed one that is sparsely ever mentioned at university where most students will demo their final-year projects from the laptop they built it on. After many a bad experience when it came to taking the code that worked fine in debug mode on your laptop to another machine and then watching it break horribly, we finally learnt our lesson.

So now we use TFS and MSBuild, we have an install script that removes the previous version of our system and creates all the websites, database, users, and settings for the new version. So every morning at 2am come rain or shine TFS builds our solution - so long as no one has checked in bugged code!

Following a somewhat convoluted MSBuild file, the build output is copied to the right directory structure on a nice UNC share from which the install script can be fetched from. We can even zip it up and drop it onto SharePoint for all to see. So every morning the three of us come in, fetch the build and run it so that we all have a local version of the latest system which we then develop against. Except for maybe Tom, who seems to think prototypes shouldn't go in the source tree - who knows, maybe they shouldn't.

So this funky development procedure leaves us on a good stage to implement our application, which hopefully means we'll be on track for the finals in August! ®

Sponsored: Today’s most dangerous security threats