Tuesday, February 17, 2009

patch programming

It is again that time of the year when we work like crazy to clear the list of bugs; it is right after we developers did our part of feature regression testing, and right before the product will enter the QA phase, and then product launch.

It is that time of the year when we won't make important changes to the codebase not to break existing functionality. That time of the year when I am answered back with "I suggest you keep that in mind for the next version and just put a workaround instead".

That period when good old refactoring is not practiced much, and instead we code-patch. Some of the patches will be checked in with TODOs, but some of them will lack even this. Because I expect the number of TODOs in the code to increase, I decided I would put a "baseline" on the number of TODOs and compare them with the new number after release. So here it is, 895 TODOs and 31 FIXMEs. I am thinking now at a possible new code quality metric TODOs/codebase size.

If you are the optimistic type, you will have your hopes that after product launch, we will definitely replace the hacks with proper code. And I just have my doubts because everybody will be coding new features in that time of the year.

The result of all this development process can't be other than increasingly dirtier code. But how much can the code become dirtier before "exploding"? And what will this explosion mean? From a technical perspective it can mean writing the same amount of code in more time, or hiring more developers, or less frequent releases, or less features in new product versions. The peak could be a rewrite. All of these have economical consequences that you can easily infer.

I gave all of this some thought and the solution I see is practicing Zero Known Bugs. ZKB means a much shorter period like this one, so less opportunities to introduce hacks. ZKB on anybody's buglist means more confidence that making a change won't break existing functionality, means more focus on activities with added-value like new features. Zero-bugs means a smaller QA team, less fiddling with the bug tracker and less time from managers that weekly count bugs and take time sending encouraging emails that say We can do it together. It also means more free weekends and less stress.

So why not do it? I guess my next step is how I can convince the one who make decisions that this is the way to go.

P.S. After I wrote this, I intended to find a good link about ZKB. You should read it. So yes, it is controversial like most of the software development topics. But be it exactly zero, or 2, the principle is valid and we as a team are far from it, so I still needed to write this piece as one who had never been in a team that practiced ZKB :(

1 comment:

Anonymous said...

Bravo, your idea is useful