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,29d8139471e3f53e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Preventing type extensions Date: Fri, 24 Sep 2010 10:16:09 +0200 Organization: Adalog Message-ID: References: <87iq2bfenl.fsf@mid.deneb.enyo.de> <874odv9npv.fsf@ludovic-brenta.org> <87y6b7cedd.fsf@mid.deneb.enyo.de> <66a3704c-54f9-4f04-8860-aa12f516134b@t3g2000vbb.googlegroups.com> <87d3sib44t.fsf@mid.deneb.enyo.de> <134q4k2ly2pf4$.17nlv1q6q5ivo.dlg@40tude.net> <4c8dec8e$0$6990$9b4e6d93@newsspool4.arcor-online.net> <8f6cceFrv2U1@mid.individual.net> <135a7dc9-3943-45e4-884b-3cc6bce3db0a@q18g2000vbm.googlegroups.com> <81799aab-a2e8-4390-8f42-abceaa5fc032@m1g2000vbh.googlegroups.com> <5c0d7798-ba09-4bd0-a28f-f1b028cce927@y3g2000vbm.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 24 Sep 2010 08:16:19 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="vslmL83UgSXHD8TS0/yPxA"; logging-data="14929"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/PpJ9l1jpdnbW25R/HDAbe" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 In-Reply-To: <5c0d7798-ba09-4bd0-a28f-f1b028cce927@y3g2000vbm.googlegroups.com> Cancel-Lock: sha1:6HYp7CGvg0V3BkHLNPZfAkErTxE= Xref: g2news1.google.com comp.lang.ada:14225 Date: 2010-09-24T10:16:09+02:00 List-Id: Le 22/09/2010 19:28, Cyrille a �crit : >> Because they are unique, coverage testing drops from N to 1. > > No idea of what you are talking about... I suppose this is a reference > to what OOTiA calls "pessimistic testing" but I still don't understand > your claim. > Let's take an example: type T is tagged...; procedure M1 (X : T); procedure M2 (X : T); procedure M1 (X : T) is begin ... M2 (T'class (X)); -- Redispatching end M1; Under the "big case" model, the dispatching call is equivalent to a case statement where each branch corresponds to one of the classes that inherit from T. Therefore, coverage testing will require that M1 (and similarly every primitive operation that includes at least one redispatching) be tested for every descendant of T (even if M1 is redefined by a class D rather than inherited, it is possible to call the original one with a parameter of type D with a conversion). If you define: procedure M2_Class (X : T'class) is begin M2 (X); end M2_Class; and replace every redispatching call to M2 by a call to M2_Class, then the big case disappears. You need (of course) to check coverage for M2_Class, but M1 needs to be checked only for values of type T, not for descendants. That's what I meant when I said that coverage testing drops from N to 1 -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Adalog a d�m�nag� / Adalog has moved: 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00