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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,93a8020cc980d113 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!198.186.194.250.MISMATCH!transit3.readnews.com!news-out.readnews.com!panix!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: What is wrong with Ada? Date: Thu, 12 Apr 2007 14:47:19 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1176150704.130880.248080@l77g2000hsb.googlegroups.com> <461B52A6.20102@obry.net> <461BA892.3090002@obry.net> <82dgve.spf.ln@hunter.axlog.fr> <1176226291.589741.257600@q75g2000hsh.googlegroups.com> <4eaive.6p9.ln@hunter.axlog.fr> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1176403643 1164 192.74.137.71 (12 Apr 2007 18:47:23 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 12 Apr 2007 18:47:23 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:yDu96kBeQ/AvyIAcLo80jE2vCj4= Xref: g2news1.google.com comp.lang.ada:14957 Date: 2007-04-12T14:47:19-04:00 List-Id: Brian May writes: >...The only way you can > be sure the code is bug free is too regularly test every possible > path, ... Well, yeah, static checking is helpful, but I think you overstate the case: There is no way to be sure the code is bug free! Not in any language. Not using testing, nor any other method (including so-called proof of correctness). Testing every possible path is not enough. Here's a function that detects prime numbers (except that it has a bug): function Is_Prime (X: Integer) return Boolean is -- Returns True if and only if X is prime. begin if X = 2 then return True; else return False; end if; end Is_Prime; If I test with inputs 2 and 4, it gives the right answer for both, and I have covered all paths. But I have failed to detect the bug. And it is impossible to cover all paths in a program containing unbounded loops or recursion, because there are an infinite number of them. - Bob