The first computer bug, a moth, rests taped to Grace Hopper’s 1947 logbook now at the National Museum of American History, but she left no record of the procedure used to identify its location. “Differential debugging,” because it presents a methodical procedure for identifying the source of computer problems, would have helped her if she needed it. The heuristic described, differential debugging, locates errors by comparing a working system with an errant one. The procedure works, eventually, because computer systems should produce the same output given the same input.
Comparing working and nonworking programs helps the programmer to narrow down where the difference, and thus the problem, lies. The method starts with examining the log files of both systems. If that fails, the author advises using tools external to the system to execute trace calls to the operating system. Failure then leads to examining the two sets of environmental variables, which should be made as similar as possible. If that fails, the next step is to examine both the source code and, if needed, the assembly language code.
To complement these general principles, the author presents some specific techniques. One is to find the simplest test case that illustrates the error, thereby reducing the size of the problem space. The author also recommends some specific Unix tools to employ. The article provides a useful framework for debugging if there are two systems to compare. But, even in that circumstance, it wisely makes no promises of success.