Older blog entries for ade (starting at number 1)

am:: The most embarassing thing about having what you think are decent unit tests is when a bug report comes in that makes you realise you missed something pretty obvious. Anyone who has downloaded the 2002-07-04 build of KwikWiki will have noticed that it can't create new pages. Oops.

Mamading Ceesay sent me the bug report, complete with stacktrace. I follow the stacktrace and get to a line of code with a comment that says "assume file always exists." But files that haven't been created can't be assumed to exist.

It turns out that whilst I was fixing a bug in the reverse file index code (words weren't being removed from the index when were removed from pages) I injected this bug in the page creation code by making it try to open the pre-existing version of every page it tries to save. Mea culpa.

It's a fairly easy bug to fix but I'm trying to adhere fairly closely to XP principles in all my projects. So I now have to write a unit test that exposes it. Then and only then can I fix the bug.

In other news
I really need to get HttpUnit working as part of my build. The alternative to running tests in the app server would be to decouple more of my code from servlet technology so that they can be tested in isolation.

Barring extreme laziness I shall be going to the XP Tuesday Club this evening. A whole bunch of people from Thoughtworks are coming over so it ought to be interesting.

pm (or rather middle of the night/early morning next day):: The trivial bug turned out to be more trouble than I'd anticipated. Luckily the test I'd written failed with my quick fix. So I didn't have the embarassment of annoucing it was fixed and then saying sorry when I realised the problem was more subtle than I'd anticipated. In the end I wrote a proper solution on the tube whilst I was heading to the XP Tuesday Club.

I bumped into Martin Fowler and the rest of the Thoughtworks group on the way to XTC. They, and everyone else at XTC, were very friendly. Especially considering that this was my first visit.

It was very unstructured and laid back but I enjoyed it immensely. I shall be back.

There were lots of very interesting people there including, Duncan, the guy behind the Kew programming language. When I've had time to take a deeper look I shall probably post a link to Lambda.

And of course I put out a new release of KwikWiki.

10 Jul 2002 (updated 26 Nov 2009 at 15:09 UTC) »

Moving to Subversion from CVS is a bit like taking a taxi through Amsterdam when it's raining. You plough through puddles at 80kph and generally have a good time. However if other people are involved and you're actually trying to get some work done then things can get quite messy.

Luckily I'm only moving my personal projects over. On more than one occasion I've questioned my reasons for making the transition, especially this early in Subversion's lifetime. On the other hand it seemed like fun and CVS's few flaws can be quite annoying. Renaming a file without losing it's history doesn't seem that important until you need it. After reading Martin Fowler's book, Refactoring, and applying the lessons I've learned from it I've come to appreciate the value of developing code in a more disciplined way. This involves automated unit testing and constant refactoring (to eliminate duplication and reduce the build up of cruft) amongst many other practices which you can find in the Extreme Programming books. But if one is constantly refactoring then one needs a source control system that can track an artefact even when it's name changes or it moves from one directory to another.

Which is why I started learning Subversion in the first place.

I've bypassed the problem of disconnected operation by simply getting in the habit of moving my svn repository from laptop to desktop and back again whenever I'm on the road. It's not particularly elegant but it works. The main CVS feature I miss is the ability to browse the repository. Or at least be able to get a listing of it's contents.

And in other news mySql turns out to be closer to the SQL standard than MS Access. Porting a small Java web application from one to the other was relatively painless. In the end I didn't need the classes implementing the Factory pattern which were meant to hide differences between the two. The only real problem was Access's weird syntax for the LIKE operator.

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!