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=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,27544cb48c942326 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.213.35.69 with SMTP id o5mr1658507ebd.5.1319714920755; Thu, 27 Oct 2011 04:28:40 -0700 (PDT) Path: l23ni47464bkv.0!nntp.google.com!news2.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.musoftware.de!wum.musoftware.de!newsfeed.straub-nv.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Thu, 27 Oct 2011 13:28:39 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Length of unbounded_string. References: <4ea68441$0$8041$703f8584@textnews.kpn.nl> In-Reply-To: Message-ID: <4ea94067$0$6625$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 27 Oct 2011 13:28:39 CEST NNTP-Posting-Host: b3f122db.newsspool2.arcor-online.net X-Trace: DXC=C9Ma_41d82iUoRk[hk2WalA9EHlD;3Ycb4Fo<]lROoRa8kFSDEfdW7fnc\616M64>jLh>_cHTX3jm]l]3EdRk4Ff X-Complaints-To: usenet-abuse@arcor.de Xref: news2.google.com comp.lang.ada:14206 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Date: 2011-10-27T13:28:39+02:00 List-Id: On 27.10.11 10:56, Simon Wright wrote: > "Randy Brukardt" writes: > >> Even people who should know better do it (and I know I have, >> too). It's a pain to create a reproducing example, but a lot of time >> when I do that, it becomes clear what is wrong (and it often is >> "operator error"!). > > Me too. A natural extension of this phenomenon into the workplace seems to be writing tests. Whenever packages or types can be tested in isolation, there will be additional benefits. Like pieces of source to hand over to the help desk. The additional benefits are without additional effort, since they flow naturally from the design and development of tests. (I'm partly forced to work in this way using Python, since even pylint's results are not always close to the diagnostic powers of an Ada compiler; however, there is even more incentive to do the same when writing Ada. A win-win situation.) Some additional benefits, I think, in no particular order: *) test cases increase the likelihood of isolated pieces of software that can be forward to help desks *) writing tests means documenting and verifying assumptions. This resembles the "detect early" argument associated with Ada: "Ouch, I had thought this type behaved such-and-such, and not that way ...!" Knowing what you are assuming seems better than the opposite, and the sooner you know it the better. *) Thinking is needed to write tests, therefore doing so clarifies understanding during development. Even later, software is more clearly understood by readers, since test cases are manifestations of thinking. *) done properly, I think test cases will improve decoupling of modules, because developing one test should neither impede nor be impeded by developing others. Perhaps even because testing forces to concentrate on separating things for testing. It has taken a bit of patience and getting used to, but writing tests early seems well worth it. With or without "formal methods".