Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Little Engines That Could


Mar99: Paradigms Past: Learning to Debug

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

Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.