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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9e7db243dfa070d7 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!newsfeed.straub-nv.de!noris.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Do people who use Ada also use ocaml or F#? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <87k4kz3mda.fsf@mid.deneb.enyo.de> <5jjgrklivesk$.z0is5qe7mgbt.dlg@40tude.net> <82mxpmz7t3.fsf@stephe-leake.org> Date: Sun, 7 Nov 2010 00:03:04 +0100 Message-ID: NNTP-Posting-Date: 07 Nov 2010 00:03:03 CET NNTP-Posting-Host: 1282efc7.newsspool3.arcor-online.net X-Trace: DXC= On Sat, 06 Nov 2010 16:56:14 -0400, Robert A Duff wrote: > Stephen Leake writes: > >> To truly test a generic, you need to test with all possible >> instantiations. > > To "truly" test a procedure, you have to call it with all > possible parameter values (and all possible globals, > if it uses those). Loaded at all possible memory addresses, etc. There is no such thing as a "true" test. Some things have to be taken for granted/proved. >> That's much more effort than testing a single concrete procedure. > > Well, I agree that testing a generic is typically harder > than testing a single procedure. That's because generics > are typically more, um, "general". No, it is because there are more things which can be safely assumed for a well-designed procedure than for a well-designed generic. Furthermore, I would bet that practically any generic can be broken per erroneous instantiation, e.g. by passing function "-" where "+" expected. We discard these cases as unlike, but we cannot prove that they indeed do not happen, until we instantiate, with is the essence of being non-testable. For procedures testing usually covers the inputs necessary to deduce that it works for all other inputs. Erroneous usages do not exist or well known/detectable/preventable. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de