Not all quality is free. But it’s cheaper than you think

8. March 2009

I started writing a reply to this post but it got kind of long, by the time I started thinking about adding pictures it dawned on me that it’s probably a good idea to write my own post on the subject.

The discussion here is based on an idea from lean development. Traditionally people thought that quality had a price. Removing defects has a cost so more quality means higher cost. Lean production tells us this is not true. If you remove the defects sooner you can remove them cheaper. By removing the cause of the defects you can prevent them from being added. This will not only improve the quality but actually remove the cost of fixing the defects. Agile methodologies like XP show us that this works for software too. Up to a point.

There are a couple of ways you can prevent defects from appearing in your software. The two most efective things you can do are TDD or test first development and pair programming. Both give you early feedback about defects and prevent you from introducing them. Both have their own types of defects they will prevent. Test first programming seems suited for removing defects related to low level behaviour of components in your software. Pair programming has a more wide range of defects it will prevent, having two pairs of eyes and two brains look at the same piece of code. I’ve found that most errors it prevents are maintenance related. High level interaction problems are usually too complex to find this way.

The biggest improvement in quality you will get from these methods is not so obvious though. I’ve found both methods force you to think about low level specifications before implementing them. Writing a test forces you to think about how the code you’re testing is going to behave. You’ll have to specify this behaviour in your test before implementing it. Writing down executable specifications like this is very powerful. I’ve found the dynamics of TDD don’t feel like testing at all. It focusses the development effort but TDD will not replace testing. Simply because you won’t find all classes of errors.

I’ve found two places where developer testing breaks down.

The most obvious place is in testing your requirements. Requirements are notoriously imprecise. Problems in writing down the requirements or in interpreting the requirements will often only be found in an aditional inspection phase. Software might be working correctly but is it actually doing the right thing. Usability issues also fall in this category.

Integration of components is also a source of defects that won’t be found with TDD or pair programming. In simple cases where components just call each other integration issues are often found by the compiler. But in more complex cases, for example when components should work together in a multithreaded application defects are almost inevitable.

I don’t think you can elliminate inspection. Software is just too complex. I don’t think zero defects is achievable either. But when looking at common development practices today I think there is a lot of low hanging fruit. Most development organizations can indeed save on inspection and defect-removal by increasing quality using these practices. But even then they’ll be a long way from zero defects.

The original fallacy was to think the cost of removing defects was a straight line that went up. But assuming the cost per defect is a straight line with a downward slope is too simplistic too. Here’s the picture I promised:quality

 

 

 

 

 

 

Quality will start to cost money when all the easy bugs are gone. But until then we should invest in it as much as we can.

Comments

3/8/2009 3:39:18 PM

Willem van den Ende

Let me show by example, and remove a defect by early inspection Smile :

Third paragraph : "Both give you early feedback about defects and prevent you from introducing you". Last you should probably be a 'them' (referring back to 'defects').

The last paragraph reads to me as a paradox, and I like that:
"Quality will start to cost money when all the easy bugs are gone. But untill then we should invest in it as much as we can."

(challenge: spot a spelling defect in the last sentence. Firefox showed me one when pasting it into this comment ('Andon' I guess)).

I guess that assuming we can meaningfully plot something about defects in two dimensions - apart from showing our lack of understanding, which you do well Smile - is too simplistic.

Assuming we could, the graph might be quite irregular, something like the graph that goes with the satir change model (and then iterate) - very jagged.

Willem van den Ende Netherlands

3/8/2009 9:09:12 PM

Vasco Duarte

This was a good post. I like your graph with the three possible curves. I too think that the real cost/benefit of the Zero Defects approach is closer to the third graph however, I believe that both myself and you forgot to add to the arguments the non-obvious (therefore unpredictable) effects of getting closer to Zero Defects.

The fact is that if you get close to Zero Defects the dynamics of your project will start to change (build never fails, you never miss a deadline, have more time to improve the code, etc.). When the project dynamics change it is very likely that the current valid assumptions about software development will change. We will get into an alternative reality, if you will. In that alternative reality things may be so different that it is impossible for us to imagine what the effects could be. Including on cost.

Lean makes the prediction that if you increase quality, your costs will be lower and your process will be much faster. What happens when your quality approaches "perfection"? (I know Utopia, but  bear with me)

I'd say that if you can get there, it's likely that your whole understanding of the software development process will change with it...

I guess that what I'm saying is: the third curve seems the obvious approximation to a reality that we've never experienced...

Vasco Duarte Finland

7/9/2010 4:02:13 PM

trackback

commercial inspection

commercial property inspection protects buyers & sellers

commercial inspection

Comments are closed

Powered by BlogEngine.NET 1.5.0.7
Theme adapted from BlogEngine.NET standard theme by Mads Kristensen

Mendelt Siebenga

Mendelt Siebenga with coffeeMendelt Siebenga works as a C# programmer. In his spare time he's been known to pick up Python, Lisp and even a soldering iron from time to time.

You can also find me here