From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,34872f3f22b5b140 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-10 08:04:40 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!worldnet.att.net!207.217.77.102!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: Suggestion for gnatstub Date: Sun, 10 Nov 2002 10:58:50 -0500 Organization: MindSpring Enterprises Message-ID: References: <3dcb9e51$0$303$bed64819@news.gradwell.net> <3DCBC4C9.AD436CD9@earthlink.net> NNTP-Posting-Host: d1.56.b7.a0 X-Server-Date: 10 Nov 2002 16:04:39 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Xref: archiver1.google.com comp.lang.ada:30684 Date: 2002-11-10T16:04:39+00:00 List-Id: 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 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?