From: "Robert I. Eachus" <rieachus@attbi.com>
Subject: Re: Debugger Rant (was Re: How to debug an Ada program)
Date: Tue, 15 Jul 2003 23:33:05 GMT
Date: 2003-07-15T23:33:05+00:00 [thread overview]
Message-ID: <3F148F30.4010602@attbi.com> (raw)
In-Reply-To: e2e5731a.0307111826.48a106d5@posting.google.com
Alexander Kopilovitch wrote:
>>Shrug! I guess I have internalized a style of programming once known as
>>"Design to test." In other words, all (formal) requirements are
>>testable, and you design and code from day one to make passing those
>>tests as easy as possible.
> While being absolutely true, this is surprisingly hard to remember.
> Every time when I read this position I wholeheartly agree with it;
> moreover, several times I tried it (at least partially) in practice,
> and in each case a reward was excellent... and nevertheless, I'm unable
> to keep it in mind and apply regularly. And I know well that I'm not
> alone with this strange kind of "disability". Why it is happened, and
> how one can "internalize this style of programming" (using your words) ?
The answer to that is easy. When I sit down to write even a short
program, I take out a piece of paper, or open Notepad, or whatever, and
start doing requirements. All it takes to internalize design to test is
to recognize that even when you are doing a ten line example, THIS is
faster, THIS is better, THIS is much more likely to be bug free, and
THIS is much less stressful. That time with the (real or virtual)
notepad, often both, IS painful. And a lot of stuff gets scribbled out
as you realize that THIS IS A REQUIREMENT and you can't test it. But
what you do end up with is a design where each component has an
associated test, and that mapping eventually means that all sorts of if
and case statements go away, or only get tested in one place.
Fortunately by now, when I don't do this, I stop after about twenty
lines of code and go back and do it right. I'm too old to do things the
hard way.
When I do this, I can knock out over a thousand lines of tested code a
week. (Not counting test programs, but counting some documentation.)
Comparing my work with the sort of work done by government contractors,
my block comment headers are much smaller, I use more whitespace, and I
accomplish about ten times as much per line of code! At first I thought
this was crazy, then I took some existing code I hadn't examined, plus
the requirements document--which I knew well--and rewrote a couple of
units. The big difference, and it was HUGE, was that I moved a lot of
checking into the interfaces (including data types), while functional
decomposition propagates it down into the leaves (subprograms).
> PS. After writing above words, one fantastic vision occured to me - I imagined
> Web-based master class - yours, "Programming using Ada". Why not? You have
> tremendous experience, rock solid skills and views, you are alive to hidden
> errors and potentially dangerous solutions, you are apparently willing to
> share your knowledge, and you don't like to write books and articles
> (I searched the Net and found only one your article, and it was on quite
> specific issue). This is extremely suitable combination for a master class
> instructor. Well, I understand that one more component is needed - there
> should be example problems, and it isn't a simple/pleasant task to collect
> good ones. But my vision included even this side - in the form of real-world
> examples from several first chapters of the book "Problem Frames: Analyzing
> and Structuring Software Development Problems" by Michael Jackson.
I have significant parts of the book written, some of it was presented
as lectures around 1986. However, I have been seriously disabled for a
while now. Right now I am up to using the computer (and up to thinking,
which is more important), so I may be able to finish that book and a
couple of others.
--
Robert I. Eachus
�In an ally, considerations of house, clan, planet, race are
insignificant beside two prime questions, which are: 1. Can he shoot? 2.
Will he aim at your enemy?� -- from the Laiden novels by Sharon Lee and
Steve Miller.
next prev parent reply other threads:[~2003-07-15 23:33 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-09 4:42 How to debug an Ada program mauricio
2003-07-09 7:30 ` Preben Randhol
2003-07-09 16:07 ` Pascal Obry
2003-07-09 17:16 ` Cephus�
2003-07-09 21:28 ` Robert I. Eachus
2003-07-10 3:37 ` Cephus�
2003-07-10 5:05 ` Robert I. Eachus
2003-07-10 7:25 ` Preben Randhol
2003-07-10 22:49 ` mauricio
2003-07-15 1:20 ` Richard Riehle
2003-07-15 4:22 ` James Rogers
2003-07-15 12:09 ` Marin David Condic
2003-07-11 13:05 ` Debugger Rant (was Re: How to debug an Ada program) Marc A. Criley
2003-07-11 13:26 ` Preben Randhol
2003-07-11 14:36 ` Dmitry A. Kazakov
2003-07-11 15:13 ` Jerry Petrey
2003-07-11 18:42 ` Robert I. Eachus
2003-07-12 2:26 ` Alexander Kopilovitch
2003-07-15 23:33 ` Robert I. Eachus [this message]
2003-07-11 19:36 ` Wesley Groleau
2003-07-11 20:33 ` Preben Randhol
2003-07-11 21:26 ` Wesley Groleau
2003-07-12 7:07 ` Brian Catlin
2003-07-15 23:34 ` Robert I. Eachus
2003-07-16 19:24 ` Debugger Rant Marc A. Criley
2003-07-17 2:21 ` Alexander Kopilovitch
2003-07-18 19:52 ` Robert I. Eachus
2003-07-19 9:51 ` Pascal Obry
2003-07-17 16:33 ` Wesley Groleau
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox