July 2009

Archive for July 2009

New imagineClub website design poll

I just got email from Kristof  with a raw draft of a new design for the imagineClub website I’m currently building. I’d really like to hear your feedback on this:

iC-sd2

Update: Sorry I didn’t include any more background on the topic. imagineClub is a club that focuses on helping students at Klagenfurt University with their studies and enable them to easily access new Microsoft technology. I wrote a more complete article about the imagineClub some time ago.

Please take a few seconds to answer this little survey. It will help us reach a decision and improve the design:

Read more →

Don’t forget the Refactor in Red-Green-Refactor

When first learning about TDD all sources I read focused pretty much on one thing: writing the tests.

Few sources really talk about the full TDD workflow:

  • Write a failing test
  • Make it pass
  • Refactor the code
  • start over

Arguably that the hardest part of doing TDD is 1+2, while possibly the most important one is 3!

Some people tend to stress the fact that automated tests can be a safeguard against breaking existing code. And although I like this aspect, I believe if your code is structured well and was built with the open-closed principle in mind,  chances are you’ll never touch old code in the process of implementing new features.

But during refactoring, you play to TDDs strengths. You don’t write new stuff, you focus on the stuff that’s already there and that already works. You search for ways to improve what’s already there while not changing it’s behavior. And very often this final refactoring step is the only thing that really brings value to your process, since it not only uses those tests you just wrote, it also facilitates future change allowing you to produce cleaner code than you would without refactoring.

Think of refactoring as fortifying the wall you’ll be building the next floor upon. Without it the you may be fine, but 3 floors from now you’ll have a lot of work at your hands to be able to commence work.

Getting things right the first time is incredibly hard. On my last project it even took me some quality pair programming once to come up with something great, and 80% of the pair programming was mostly spent on refactoring a raw idea from a 80% solution into a 100% solution. So, don’t spend too much time with hunting the ideal of writing a 100% solution the first time, rather try to get it 80% right and don’t stop improving it until you are at 100%!

Read more →