Wednesday 14 July 2010

Lazy, stupid or insane?

There's never enough time to do all the things I know I should. Life is constant juggle to get stuff done. Work is the perfect example.. ridiculous deadlines tend to overtake the development process and (sometimes) code you're less than proud of gets out. So you'd think I'd learn when working on my own side projects.. right?

Currently myself and another a likeminded dude are working on a grails based football (that's Australian football in case you're wondering) tipping application. The idea had been kicking around (bad pun intended) for a while. We were feed up with the main AFL site which is based on flash. It does the job but each year they provided 'enhancements' which are unnecessary or just don't give us what we want. Anyway enough complaining, we'll build our own. We've given ourselves a very generous timeline to get this done so that it will be close to perfect at release.

Herein lies the problem. Grails makes it so easy to get from "hey let's do this" to "wow look what I just made" that all my good intentions to do the right thing are forgotten. I've read enough material by learned people (like this and this) to know that I should be writing tests for my stuff. Preferably before or during development. However after being distracted by a couple of other side projects, I went back to the tipping project today only to find that the last great feature I'd implemented had busted some core functionality that had been working on early in the project. Lazy, stupid or insane... take your pick.

So now that I've learned my lesson I'm off to install the grails cobertura plug in and see if I can get that percentage up and avoid future problems.

As a side note what do people think is reasonable test coverage? 70%, 80%, (gulp) 100% ??