next up previous
Next: Identifying the source of Up: Debugging Tips Previous: Bugs

Recognizing the existence of a bug

The first step in debugging any application is of course to recognize that there is a bug. The difficulty of detecting varies widely from bug to bug.

Minor bugs that only cause incorrect results are the most difficult to detect. This is especially true in computational software unless you have a firm idea of what the results should be. Because most computational software in physics is to simulate some non-analytical system, the results are rarely known until the simulation is done. This makes computational software very susceptible to hidden bugs because a wrong answer may not be detected. This is why it is necessary to test your code against at least one known and simple system. By comparing to analytical systems, results of previous simulations, and/or results of physical experiments, you will discover and fix inconsistencies and eventually verify the validity of your own code.



Spencer Eugene Olson 2005-01-19