comp.lang.ada
 help / color / mirror / Atom feed
From: nbssal@bambam (Stephe Leake)
Subject: Re: testing Generics
Date: Mon, 8 Mar 1993 18:19:00 GMT
Date: 1993-03-08T18:19:00+00:00	[thread overview]
Message-ID: <8MAR199313194203@bambam> (raw)
In-Reply-To: 226@hathor.CSS.GOV

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



  reply	other threads:[~1993-03-08 18:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-03-05 13:14 testing Generics Jeff Etrick
1993-03-08 18:19 ` Stephe Leake [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-03-07 18:59 John Goodsen
1993-03-07 19:10 John Goodsen
1993-03-09  5:26 agate!howland.reston.ans.net!zaphod.mps.ohio-state.edu!darwin.sura.net!ha
1993-03-11  0:22 cis.ohio-state.edu!magnus.acs.ohio-state.edu!zaphod.mps.ohio-state.edu!uw
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox