Why Is Error Prevention Important?

In short, automatic error prevention tools must be intelligent themselves.

Developing tools with such intelligence is more complicated, by several orders of magnitude, than simply preprogramming static error prevention equipment on a traditional assembly line. The difficulty in building automatic error prevention tools may explain why quality has historically been absent from the software creation process. Such tools simply did not exist, and without them automatic error prevention seemed expensive and difficult, if not impossible to achieve.

Intelligent Tools
The good news is that these difficulties have finally been overcome, and those concerned with quality can stop talking of automatic error prevention and begin implementing it. Within the last three or four years, new tools have emerged that are intelligent enough to exercise a new piece of software-to bend it, break it, and subject it to realistic and comprehensive test environments-and that are flexible enough to extend the same sort of testing to any number of software products.

Costs and Benefits of Unit Testing
Automatic error prevention requires development practices that are extremely difficult to execute without huge expenditures of manual labor and time. Consider unit testing. Unit testing isolates errors by testing small units of code as they are created, instead of testing finished applications. This strategy has the advantage of errors that are easy to find because the amount of code under test is significantly smaller, leading to further advantages of increased test coverage and the overall number of errors fixed.

Unfortunately, these advantages are costly. When performed manually, unit testing requires a huge investment in time and labor to:

  • Design and build test harnesses that will run the class. (Note: The harness itself must be thoroughly tested and declared bug-free, so as not to sabotage the source code.)
  • Design and create stubs that simulate external resources referenced by the class under test.
  • Design and build appropriate test cases that will test as much of the code as possible. Test cases should include white box test cases (to test application construction) and black box test cases (to test application functionality).
  • Perform regression testing to ensure no new errors were introduced into the code by modifications or corrections.

The difficulties inherent in executing these steps illustrate why unit testing is an underutilized feature of software development. The full benefit of unit testing can only be achieved by automating the process.

Automating Coding Standards
Coding standards is another effective development technique that is underutilized because of the difficulty of implementing it manually. Without automation,  there is little that can be done to enforce coding standards within a development group-some developers will consistently break standard rules by using individual coding styles, and others will simply forget to check their code against standards before checking it into  a source repository. The only way to ensure that a development group uses coding  standards in a consistent manner is to use a static analysis tool that automatically checks their code against industry accepted coding practices, as well as those of an individual company, group, or other coding rules.

Despite the availability of tools that automate these difficult tasks, automatic error prevention does not enjoy total acceptance. This advance is still considered so complex and unrealistic that many in the software industry have not seriously evaluated it. This is unfortunate-these tools are available and they must be utilized in order to completely cure the crippling industry-wide "bugs are the way it is" mentality.

A Call for Change
Automatic error prevention must become a rallying cry to bring software development to the same level of consumer confidence and quality assurance enjoyed in traditional consumer industries. The

About the author

TechWell Contributor's picture
TechWell Contributor

The opinions and positions expressed within these guest posts are those of the author alone and do not represent those of the TechWell Community Sites. Guest authors represent that they have the right to distribute this content and that such content is not violating the legal rights of others. If you would like to contribute content to a TechWell Community Site, email editors@techwell.com.