Test suite
Home Up Discussion board Downloads Revision History The future New on this site Acknowledgements etcetera Site map, search

 

Home
Up

 

 

Reliability in the face of complexity is the real challenge of software development, as discussed in this paper.

Download and explode the test cases

The current version of the test suite can be downloaded from here in unix and here in windows format.   Explode this file into its own directory, perhaps one called tests.  These test cases can be studied to see how to set up the code. 

The readme_tests.htm file describes several Perl scripts that are included in the documentation.

The test suite should not be placed in a directory which contained an older version until the old version is first deleted.  Names change from time to time, and placing the current version of the suite on top of an old one will not overwrite all the old ones.  This will cause problems when the test suite is run.  Either start with a new directory or first delete the contents of the directory.

The "assert" commands within the test suite

A large code must be completely checked every time anything is changed.  The code uses extensive self-checking during a calculation to insure that the results are valid.  The assert commands tell the code what answer to expect, based either on analytical or previous results. They allow the code to confirm that it has found the correct answer, and a distinctive string is printed if the right answer is not obtained.  The Perl script checkall.pl will examine all output files to search for failed asserts, which indicated a problem.

All of the test cases include assert commands in the input stream.  These have nothing to do with the simulation or the astrophysics, but instead provide a way for the code to do extensive automatic self-checks.  The Perl script tests_remove_asserts.pl will remove all the asserts if you wish to reuse these scripts for other purposes.

The asserts should not be included in actual calculations.  They are only here for verification of results.

Running the test cases 

The test suite includes Perl scripts to run all the test cases and then check for problems.  These are files that have names  *.pl.  

The runall.pl script will run all the input files.  You will need to edit runall.pl so that the string "$exe" points to your executable for Cloudy.  This test suite takes about seven hours on my 2GHz MHz pc, so you might want to do this overnight.

Check the results

If anything goes wrong the code will announce this at the end of the calculation by printing a line that includes the string PROGLEM or "botched asserts".  If the code crashes then the normal end-of-calculation string will not be printed.

The test distribution includes the Perl script checkall.pl that will check for problems once the test cases have been computed.  Run this script and notice what it says.

The tests cases stars_atlas.in stars_costar.in stars_costarhalo.in stars_rauch.in and stars_werner.in require the compiled stellar atmosphere files.  These are not expected to execute properly if you choose not to set up the stellar atmospheres.

Test cases output

These files contain the results of the test suite. Results are available for the following platforms,
PC (WinXP, Visual Studio .net ),
PC (gcc 3.3.3, Cygwin, PC end of lines - the rest of the tests have Unix eol),
HP SDX,
Alpha ccc
 

Note that the code that generated this output did not have any hot fixes included. 

Next step, apply any hot fixes.

Hit Counter
Last changed 09/03/06.
Return to the Cloudy Home Page.
Copyright 1978-2006 Gary J. Ferland