comp.lang.ada
 help / color / mirror / Atom feed
From: George Haddad <george.haddad@lmco.com>
Subject: Re: Test driver for internal subpgms?
Date: 1996/12/09
Date: 1996-12-09T00:00:00+00:00	[thread overview]
Message-ID: <32AC5F6C.23FF@lmco.com> (raw)
In-Reply-To: 32aa1016.2128178@netnews.voicenet.com


Owen Chang wrote:
> for test purposes only.  Also packages needed to support unit test
> must be with�ed into the package containing the unit under test.  In
> this case the number of lines added to the package body can be more
> than one line.

   I am not sure what you mean here, but (if I correctly understand what
you want) could you not merely 'with' the test-specific support units
into the body of the test procedure? I.e.:

with Test_Support_0;
with Test_Support_1;
separate(PKG_A)
procedure Test is
  ...

> It was argued that one should be able to come up with the needed set
> of inputs to an external subprogram .And if an input cannot be found
> such that the unit under test is called with a particular value, then
> there is no need to worry about it since the unit under test will
> never get it.  A subprogram so low level as to require special
> scrutiny should be moved into a support package and made external.  So
> there should never be a case where the �indirect approach� cannot
> work.  It is inefficient use of time to write driver code dedicated to
> an internal subprogram.
> 
> What do you think ?

   In a development effort where there are path coverage requirements,
it would seem that the internal code needs to be tested.  If external
inputs can't produce a given internal execution path, then one would
think the internal logic should be changed to eliminate the unreachable
path; however, sometimes the software test engineer isn't the author of
the package in question.  (At least on our projects  :-))  In fact, if
the package is being reused, one may not be permitted to rewrite it, but
one still has to test it.  So, it would seem prudent to have a method
for so doing.

   However, in Ada 95 (Disclaimer: I have only the barest acquaintance
with Ada 95), rather than having a TEST procedure, could you not declare
a child package (which can presumably access the internals of PKG_A),
and then invoke PKG_A.Test.Proc_B (for example) from your driver?
-- 
I found these opinions on my doorstep, would you please give them a good
home?




      reply	other threads:[~1996-12-09  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-12-08  0:00 Test driver for internal subpgms? Owen Chang
1996-12-09  0:00 ` George Haddad [this message]
replies disabled

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