comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <mcondic.auntie.spam@acm.org>
Subject: Re: Suggestion for gnatstub
Date: Sun, 10 Nov 2002 10:58:50 -0500
Date: 2002-11-10T16:04:39+00:00	[thread overview]
Message-ID: <aqm02n$vqk$1@slb0.atl.mindspring.net> (raw)
In-Reply-To: x7v8z0233vr.fsf@smaug.pushface.org


Obviously, I can sit down and write it all from scratch if I like, too.
That's not nearly so satisfying as getting it done by someone else for you
free of charge. :-) Seriously, its just a suggestion as a "desirable"
switch-selectable feature. If it never gets implemented, it is hardly the
end of civilization as we know it - one just has to hand-mod the produced
code. You've got to do that eventually anyway.

In the world I live in, it would not be possible to leave stubs in a
delivered system, so I'm not worried about that. Ultimately, if you do worry
about such things, there's nothing to stop hand-generated stubs or bad
subroutines or any other sort of trash from getting through, so why worry
about a machine generated stub? And besides, what about procedures with only
a "null ;" statement? That's sort of an envisioned use - test stubs - so
maybe they should have been disallowed by the language?

As to the value? I've often had a higher level procedure where I want to
check the logical flow or correctness in some "grand overview" sense without
worrying so much that it got the right answer to anything. In a case like
that, stubs that simply execute but produce no useful output are a fine
thing. It shouldn't be hard to imagine such a case. A high level thing gets
some user input & parses it to decide what calculations to do, then goes
back to get more input from the user. Initially, you just want to check that
your parser is working right and you aren't interested in the calculations.
If the functions all raise exceptions rather than return zeros or some other
innocuous - yet wrong - value, its a bit of a pain in the posterior to have
it crash with an exception in the middle of your smoke testing. I could
easily come up with more examples. The whole concept of "iterative builds"
is built around such development practices.

As a switch selectable choice, if you don't consider such a thing to be
"safe" you don't have to use it. For those who would find it useful and
aren't concerned about potential safety issues, well, there it is!

MDC
--
======================================================================
Marin David Condic
I work for: http://www.belcan.com/
My project is: http://www.jast.mil/

Send Replies To: m c o n d i c @ a c m . o r g

    "I'd trade it all for just a little more"
        --  Charles Montgomery Burns, [4F10]
======================================================================

Simon Wright <simon@pushface.org> wrote in message
news:x7v8z0233vr.fsf@smaug.pushface.org...
>
> One of the advantages of an open code gnerator is that you can fix it
> to do this sort of thing.
>
> However, I would seriously question what you're suggesting. I don't
> want the slightest chance that code like this could make it into the
> delivered system unnoticed. And what value can there possibly be in a
> test that doesn't pick up the fact that values being returned are
> arbitrarily different from what they should be?





  reply	other threads:[~2002-11-10 15:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-08 11:14 Suggestion for gnatstub Victor Porton
2002-11-08 12:56 ` Marc A. Criley
2002-11-08 13:23   ` Marin David Condic
2002-11-08 21:09     ` chris.danx
2002-11-15 17:08       ` Wes Groleau
2002-11-15 17:35         ` Stephen Leake
2002-11-16 14:36         ` Marin David Condic
2002-11-09 14:15     ` Simon Wright
2002-11-09 14:50       ` Marin David Condic
2002-11-09 20:05         ` Simon Wright
2002-11-10 15:58           ` Marin David Condic [this message]
2002-11-10 20:31             ` Robert A Duff
2002-11-11 13:46               ` Marin David Condic
2002-11-11 15:31                 ` Robert A Duff
2002-11-11 20:32                   ` Randy Brukardt
2002-11-11  6:31             ` Simon Wright
2002-11-09 15:44       ` Robert A Duff
2002-11-09 20:08         ` Simon Wright
2002-11-09 21:56           ` Robert A Duff
2002-11-10  8:42             ` Pascal Obry
2002-11-10 12:20               ` Simon Wright
2002-11-10 16:04               ` Marin David Condic
2002-11-14 20:10               ` Robert I. Eachus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox