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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, LOTS_OF_MONEY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d901a50a5adfec3c X-Google-Attributes: gid103376,public X-Google-Thread: 1094ba,9f0bf354542633fd X-Google-Attributes: gid1094ba,public From: "James Giles" Subject: Re: Fortran or Ada? Date: 1998/10/06 Message-ID: <6vdnqe$3nu@bgtnsc02.worldnet.att.net>#1/1 X-Deja-AN: 398354464 References: <3617AA49.340A5899@icon.fi> <6v9s4t$egn$1@ys.ifremer.fr> <3618dc33.0@news.passport.ca> <6vbhhc$5kj$1@nnrp1.dejanews.com> <6vdfq4$p1$1@nnrp1.dejanews.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Organization: AT&T WorldNet Services Newsgroups: comp.lang.fortran,comp.lang.ada Date: 1998-10-06T00:00:00+00:00 List-Id: dewarr@my-dejanews.com wrote in message <6vdfq4$p1$1@nnrp1.dejanews.com>... >In article , > "Ian St. John" wrote: >> >> Testing by itself can never guarantee correct code. The testing is just to >> determine syntax errors, oversights, etc. > >That's a bit strong, there are definitely cases where testing can be >exhaustive, e.g. in checking out a sqrt routine for IEEE short form >arithmetic. Indeed it is almost practical to do exhaustive testing on >long format division (which would have saved Intel many millions of >dollars :-) There are 2^128 different possible divide operations (each operand having 2^64 different possible values) - and that's assuming that you don't have to test each pair of operands for each possible value of the exponent and sign (in which case there are nearly 2^160 different operand pairs - each operand having 2^80 different values). Now, assuming that a Pentium class machine can test 100 million operations per second (an overestimate to say the least), it would take over 10^30 seconds to test all 2^128 divides. This still assumes you have an independent source of the correct answer for each divide to test against! Running, say, 1000 machines in parallel, each testing different divides, would reduce the time needed to "just" 10^27 seconds. A year has on the order of 3*10^7 seconds. Now, there are other kinds of tests. A "correctness proof" is a test which does not work by actual execution of the code or hardware, but by logical examination of the components of them. This is still only a test, since the "proof" has the same complexity as the thing being tested - and the same likelyhood of error. However, to a certain extent, such errors are independent of the errors in the actual code or hardware (not always: especially in cases where the "proof" is generated with automated tools, an error in one can be completely transcribed into the other). This makes it a useful exercise, especially for mission-critical code or hardware. -- J. Giles