Research into Code Inspection
Research Findings
The following research findings, grouped here by subject, are relevant to the IfSQ Standards and the IfSQ Compliance Assessment Method:
-
Why should you inspect software?
- Quality processes reduce errors without increasing costs
- Inspections cut rework by half
- Inspected software costs 90% less to maintain
- Inspection catches 70% of defects
- Inspection catches 60% more errors than testing
- 85% of errors are trivial
- An hour of inspection saves 100 hours of work
- An hour of inspection saves 30 hours of maintenance
- Developers who inspect code are at least 20% more productive
- Developers find the majority of defects when preparing for code reviews
- Code inspection is four times more effective than testing
-
When should you inspect software?
- Fixing defects early cuts costs in half
- Catching defects during testing is 10 times more expensive
- Debugging represents half of development costs
- 90% of development work occurs after initial release
- 25% of requirements change during development
- 70% of rework caused by changing requirements
- Defect removal is the most expensive part of software process
- Inspection is 20 times more efficient
- Inspection is nearly twice as fast
- Inspection is 80% faster than testing
- Find design defects 6 times faster
- Inspection 4 to 7 times faster than testing
-
What should you look for?
- Best size for routines is 100-150 lines
- Better not to exceed 143 lines in a routine
- Long routines are more error prone
- Few understand more than 3 levels of nesting
- More than 4 levels of nesting too difficult
- Don't Repeat Yourself (DRY)
- Better to limit control flow complexity
- Competent programmers know their limits
- Repetitive code indicates poor design
- 39% of errors caused by interfacing
- Missing "else" for 50-80% of plain "if"s
- Better to write cohesive routines
- Coupling-to-Cohesion ratio inversely correlated to errors
- High cohesion correlated to low fix cost
- Choice of names impacts cost of debugging
- Unreferenced variables strong indicator for other errors
- Information-Hiding makes large programs 4 times easier to modify
