comp.lang.ada
 help / color / mirror / Atom feed
From: Andre Spiegel <spiegel@berlin.informatik.uni-stuttgart.de>
Subject: ANNOUNCE: `tg', a test driver generator for Ada programs
Date: 1996/05/09
Date: 1996-05-09T00:00:00+00:00	[thread overview]
Message-ID: <lhmenou9dxo.fsf@berlin.berlin.informatik.uni-stuttgart.de> (raw)


`tg', a simple test driver generator for Ada programs, can now be
found under the address

     ftp.informatik.uni-stuttgart.de:/pub/local/tg-3.0.tar.gz

I wrote this little helper some time ago, found it pretty useful, and
finally bundled it for release.  What is `tg'?  Here's an extract from
the README file:

---------------------------------------------------------------------------

tg is a program that helps testing software.  If you want to test a
piece of software, that normally means you have to execute it over and
over again, passing various sets of input data to it, and verifying
that it gives the correct results for each input.  You normally write
a program that does all this automatically.  Such a program is called
a "test driver".

tg can generate such test driver programs, given a very succinct
description of the individual test cases.  tg translates this
description into a complete Ada program.  If you compile this
test driver, link it with the software you want to test, and execute
it, it performs all the test cases and tells you whether the software
under test behaved as expected or not.

tg is designed for the Ada programming language, but you can also use
it for software written in other languages.  You might even test
binary programs with it, of which you don't have the source code at
all.

---------------------------------------------------------------------------

Here's a small example.  Suppose you want to test an Ada function
which counts the number of `&' characters within a given string.

     function Count_Ampersand (Str : in String) return Natural;

   One of your test cases might be to call it with parameter
"abc&&&abc" and verify that the result is three.  The code for this
could look as follows.

     Put ("Testing three ampersands in the middle... ");
     begin
       Count := Count_Ampersand ("abc&&&abc");
       if Count = 3 then
         Put_Line ("pass.");
       else
         Put_Line ("fail.");
       end if;
     exception
       when others =>
         Put_Line ("fail.");
     end;

   That is a lot of code for a single test case.  In `tg' notation, to
specify this test case, you would just write:

     ***** Testing three ampersands in the middle...
     test Count := Count_Ampersand ("abc&&&abc");
     pass Count = 3

   The `tg' command translates this into code similar to that shown
above and puts it into a complete driver program.

---------------------------------------------------------------------------

`tg' is written in Ada 95 and compiles out-of-the-box with GNAT, the
GNU Ada Compiler, version 3.01 or higher.  Documentation is provided
as a GNU texinfo manual, and in postscript form.  `tg' is free
software, released under the FSF's General Public License (GPL).

Comments, suggestions, etc. are welcome.

Andre Spiegel                    
University of Stuttgart, Germany
<spiegel@berlin.informatik.uni-stuttgart.de>




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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-05-09  0:00 Andre Spiegel [this message]
1996-05-10  0:00 ` ANNOUNCE: `tg', a test driver generator for Ada programs Ray Mosley
1996-05-11  0:00   ` Mike Young
1996-05-13  0:00 ` Andre Spiegel
replies disabled

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