Our most senior programmer, Trey, was glaring at me across the conference room table, with a trace of desperation in his voice. I was explaining to our team that we were going to start doing peer reviews of code and unit testing results before they could submit their work for quality assurance testing.
Trey was expressing his displeasure with this decision, stating that if his code worked, then why should anyone care about what is under the hood?
This conversation took place a few years ago, but it still sticks in my memory because Im a stickler for following standards and for well documented code. Having inherited poorly written code, I can empathize with the programmers who have to deal with crappy legacy code.
And guess what, even if it works, it can still be crappy. Thats because if something changes in the environment to cause that code to stop working or there are enhancements needed, some poor sap will have to figure out what planet the initial coder was on.
So I started to wonder what software is available to automate the process of writing more efficient code that reduces testing time and overall maintenance costs. Such software does exist, so the real question is: why hasnt it become more prevalent?
Agitar Software came to mind because they plowed through over $30 million in venture investments. According to their web site -- which is still operational, although their assets were purchased by McCabe -- their Agitator product helps developers understand the behavior of their code as they write it.
The idea is to help prevent bugs and unnecessary code complexity that can become tomorrow's maintenance headache.
But I had to do many variations of Google searches on software quality tools to even find a few decent examples. Noticeably absent were the usual slew of Google adwords. I did find a decent blog by Andrew Glover that had a major focus on this topic, but otherwise it was slim pickings.
So why isnt there more of a market for measuring and improving the quality of code?
From a developers perspective, you want to get the job done in the expected timeframe. Of course you dont want your code to blow up in testing. But how important is the quality and maintainability of the code?
Lets face it; these metrics arent high on the list of todays overburdened developer. That is unless it is made a priority by management.
If a developer knows that their annual reviews will take into consideration the quality of code based on standards set by management, then just delivering software that works isnt going to be in the developers best interest.
Throw in peer reviews and peer pressure becomes a good thing.
Before you upstanding, accountable developers start huffing and puffing, let me state that of course many developers take pride in the quality of their work without any outside influence. If you put your name on a module there is some consideration of getting your reputation tarnished by shoddy work.
But put that same developer under the intense pressure of a tight deadline and in short order they just arent thinking that far down the road.
From managements perspective, they too will operate based on what is important in the company culture, what will advance their career and what will put more cash in their pocket. If youre lucky enough to work for high quality company, then management will also care about what makes the software shine over time.
The fact is that if developers are incented to deliver code on time with no regard for overall quality of standards, then that is exactly what will happen. Code is delivered on time, passes quality assurance testing and seems to work just fine in production. Everything is hunky dory.
Or is it?
As soon as that software needs to change or the software it is integrated with changes, all of a sudden problems arise. The original developer may not even be with the company any more, thus a new developer has to deal with spaghetti code.