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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e866340cc4a9381f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1993-03-08 18:56:36 PST Newsgroups: comp.lang.ada Path: sparky!uunet!spool.mu.edu!howland.reston.ans.net!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ames!nsisrv!news1.gsfc.nasa.gov!bambam!nbssal From: nbssal@bambam (Stephe Leake) Subject: Re: testing Generics Message-ID: <8MAR199313194203@bambam> News-Software: VAX/VMS VNEWS 1.4-b1 Keywords: generics testing Sender: usenet@skates.gsfc.nasa.gov Organization: NASA Goddard Robotics Lab References: <226@hathor.CSS.GOV> Date: Mon, 8 Mar 1993 18:19:00 GMT Date: 1993-03-08T18:19:00+00:00 List-Id: In article <226@hathor.CSS.GOV>, jeffe@hathor.CSS.GOV (Jeff Etrick) writes... >I wanted to know what the net's opion on generic testing was. > >I believe a generic procedure should be simple enough to test using a >test >driver which multiply instantiates the procedure for each intended use. If >this is not practical, then the generic is likely too complicated and >perhaps should be disected into more easily managed/tested parts. > >Generics is Ada-ese for reusable objects, much the same way that objects >in >C++ or other OOP languages. Once a reusable object has been tested, it >should not have to be retested as it is imbedded into other applications. Part of the point of using a generic is that it reduces testing. If you have a generic that accepts a generic scalar type parameter, you do not need to test it will all possible scalar types (a totally impossible task!); you only need to test it with representative samples from each class; integer, enumeration. You need to be careful when writing the body not to make any assumptions about the type (like integer types start at 0). The careful use of Ada attributes usually eliminates this kind of assumption. Stephen Leake NASA Goddard Robotics Lab internet : nbssal@robots.gsfc.nasa.gov