Where do Software Defects Originate?
Defects in software are inevitable. What are the root causes of software bugs?
Although the perception is that the defects are caused only by faulty code, this is NOT so. In fact more defects are caused by poor requirements, poor architecture or poor design (collectively) than poor code. So, what are the root causes of software bugs, and why should we care?
By looking into the root causes of software bugs, where and when the bugs appear first, we can establish better ways to avoid them in the future. Our goal is to find and fix the problems as early as possible, so that they are not experienced by users.
It is interesting to note from the graph above that more defects come from pre-coding work, than coding itself. That is, the sum of the defects from requirements, architecture and design is greater than the coding defects. Given that the code is built on the foundation of the previous three, we will end up coding the wrong thing or in the wrong way unless we fix those pre-coding defects first.
Defect potential is the likely number of defects generated and latent within each artefact. For example, if we spend a day writing requirements, it is inevitable that we will make a few mistakes. We can then say that there is a defect potential based on the size of the requirements. Using a universal metric for size (the function point) allows us to compare defect potentials across different artefacts.
If you have an understanding of the defect potential, you can then take the next step and consider the steps required to detect those defects, remove them and then verify that they have been removed.