Prevention Techniques Used for Extinguishing Fires
We have a lot of great techniques and tools for increasing the quality of our products in our Software Development Toolbox: design, unit testing, reviews, acceptance testing, etc. The difficult (and not always obvious) part is to use them wisely in the development process.
In this posting, I want to concentrate on reviews and unit testing. Both are powerful quality enhancers. Unit testing is a great tool for reducing the number of functional defects. Design and code reviews are extremely useful for perfecting the internal quality of the product as well as its functionality. However, their benefit highly depends on the time they are applied at.
Starting to think about extensive unit testing only when functional problems emerge, is practically futile. Unit testing requires a well designed product in order to be effective (or even possible). In fact, thinking about testing while designing the product will improve the design. Trying to write unit testing for existing code which was not designed to support testing, requires an extensive amount of time and refactoring efforts.
Code reviews can help identifying a wide range of problems (both functional and non-functional) in the quality of the code. However, when done on an large amount of code, after months of development, the ability to analyze the code thoroughly is greatly reduced, and the chances for fixing the code at this stage of development are also not high. The result is valuable resources dedicated for review, and little change to the quality of the code.
These two techniques are great prevention techniques. They prevent problems (or identify them almost at the same time they are implemented into the product). Neither of them is useful as a fire-extinguishing technique. When your product is already breaking on site, no crisis-mode review will help you solve the real problem. When QC is already finding numerous bugs in your product, no unit testing will help you change this situation without a massive rewrite.
Applying reviews and unit testing from the first day of the project is the most cost-effective approach. These tools are designed for preventing of quality problems, and not for dealing with them when it is already too late.











