the software stability curve

February 8th, 2008

It's always fun to start coding something from scratch, because it has no faults yet, you get a clean slate.

Being there from the beginning of the software life cycle also means that you see the whole thing up close. Baby's first steps, first school play, it's an adventure. I've noticed something that happens to my perception, though.

In the very beginning I have a clear vision of what I want to do and how I'm going to realize it. But the code isn't there yet, and the code that has been written up to this point isn't ready either. So when I'm coding and testing I find a lot of bugs. Some are things I didn't realize at the outset, and some are just errors in bad code. Both get fixed, but in the throes of this process I'm very in tune with how raw this thing still is. It's unstable: push it two inches beyond where it's supposed to be and it self destructs.

At this point I'm excited about the project, because it's new and I'm in the middle of it, enthusiasm running high. But I'm also conscious of how unstable it is presently. So although I'd like to, I'm not eager to give it to people. I don't want to expose them to this that I very well know is unlikely not to crash while they use it. I want to protect them from that. I also don't want someone to come back with a desk and bash me over the head with it. It's great, it's just not ready to be used yet.

The perception also depends on the type of bugs I find. There are both incidental and structural bugs, although the latter feeds the former much of the time. If I've coded a similar kind of thing before, I probably did something really stupid the last time, and I may have learned from that. Unfortunately, the space of mistakes is huge, so by the time I've exhausted all the mistakes and I'm guaranteed that from now on I'm not making any more, I would have aged considerably. But at least I can get it right when I'm starting with a clean slate. That or I can hack it up and redo the structure if I'm not too far into the process yet.

So when I'm in the midst of development and the code is visibly unstable, it sometimes feels like this is not only the current station but also the final destination. It's always going to feel like this.

But over time something unexpected happens. I run the code 50 times, it crashes 3 times. When I start to close in on feature completeness and say 80% code completion the code actually starts to be dependable. Structurally the system is almost ready, and what remains is to fill in the blanks. If the structure is decent the incidental bugs start dropping off too. So it's turning into a piece of code I can actually use, just what I had in mind in fact. :cap:

Without quite knowing when or how I begin to gain confidence in the code. And when I bounce off a few pieces of bad input and a couple of unforeseen scenarios get handled gracefully, my mood almost points toward celebratory.

I know I promised you a curve. Well, I lied, I don't know what the curve looks like. :P But it's there, be sure of it!

:: random entries in this category ::