Dr. Dobb's Journal March 1999
Paradigms Past: Learning to Debug
When EDSAC, the Electronic Delay Storage Automatic Computer, went online in 1949, no one had any significant experience in computer programming. The first program to run on the machine, written by the guy who caused it to be, Maurice Wilkes, was trivial: It computed the squares of the first n integers. Wilkes coded up the program in EDSAC's 18-instruction machine language, a clerk punched the paper tape and fed it to EDSAC, and the program ran flawlessly. The same with the second and third programs, which printed a more complicated table of squares and a table of prime numbers. No one thought it should be otherwise: You spent the necessary time to get the program right, then you gave it to the computer and it ran. The idea that there might be logical or transcription errors in the submitted code, or that the erroneous output of the computer could be used to find the errors, apparently hadn't occurred to anyone.
That era of blissful ignorance ended quickly and dramatically with the next program Wilkes submitted to EDSAC. According to Ivars Peterson, mathematics and physics writer at Science News and author of several books on mathematics and computing, you could just about build a course in debugging around all the errors Wilkes made in his first nontrivial program for EDSAC.
The problem Wilkes set for EDSAC was solving the Airy equation, a second-order differential equation that explains rainbows and has found application in quantum gravity and string theory. Peterson describes, at http://www.maa.org/ mathland/mathland_7_8.html, Wilkes's first attempt to program the solution to the Airy equation. There were 20 mistakes in the 126-line program.
Some were keypunching errors, like punching a V for a U. In some places Wilkes apparently wrote instructions in a skeletal form and then forget to add flesh to the bones. There were instructions in the wrong order, and missing instructions. It seems clear that Wilkes neither checked the program before giving it to the keypunch operator, nor verified the punched version.
Of course, the program didn't work, and Wilkes had to try to find the errors and correct them. He had many opportunities to find and correct his errors in this program over the succeeding days. The keypunch machine was on the floor below, and Wilkes later recalled, "It was on one of my journeys between the EDSAC room and the punching equipment that...the realization came over me with full force that a good part of the remainder of my life was going to be spent in finding errors in my own programs."
Wilkes had discovered the debugging cycle.
-- M.S.
Copyright © 1999, Dr. Dobb's Journal