57.

Dissecting Bug Patterns: Why It's Useful

Just as good programming skills involve the knowledge of many design patterns (which can be combined and applied in various contexts), good debugging skills include knowledge of the common causes of bugs and how to fix them. In my column for IBM developerWorks, I first referred to these common causes as bug patterns.

Bug patterns are recurring relationships between signaled errors and underlying bugs in a program. Knowledge of these patterns and their symptoms helps the programmer to quickly identify new occurrences of the bug, as well as to prevent them from occurring in the first place.

Bug patterns are related to anti-patterns, which are patterns of common software designs that have been proven to fail time and again. Such negative examples of design are an essential complement to traditional, positive design patterns. But while anti-patterns are patterns of design, bug patterns are patterns of erroneous program behavior correlated with programming mistakes. The concern is not with design at all, but with the coding and debugging process.

The problem is that it can take many years for programmers to learn to recognize these patterns through experience alone. If we identify such patterns and teach them explicitly, we can leverage the experiences of many programmers to improve the effectiveness of each.

This concept is not novel to programming. Medical doctors rely on similar types of recurring relationships when diagnosing disease. They learn to do so by working closely with senior doctors during their internships. Their very education focuses on learning to make such diagnoses.

Once a beginning programmer can recognize these patterns, he is able to diagnose the cause of a bug and correct it more quickly. Furthermore, by explicitly identifying and communicating these correlations, developers can mutually benefit from each other's experience in debugging, thereby acquiring proficiency far more quickly than they would have otherwise.



Bug Patterns in Java
Bug Patterns In Java
ISBN: 1590590619
EAN: 2147483647
Year: N/A
Pages: 95
Authors: Eric Allen

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net