Go to the first, previous, next, last section, table of contents.

Test suites

The implementor of each library should provide a reasonable test suite for that library.

The test suite should be a program that uses the library and checks the result against known results, or invokes the library several times and does a statistical analysis on the results (for example in the case of random number generators).

Ideally the one test program per directory should aim for 100% path coverage of the code. Obviously it would be a lot of work to really achieve this, so prioritize testing on the critical parts and use inspection for the rest. Test all the error conditions by explicitly provoking them, because we consider it a serious defect if the function does not return an error for an invalid parameter. N.B. Don't bother to test for null pointers -- it's sufficient for the library to segfault if the user provides an invalid pointer.

The tests should be deterministic. Use the gsl_test functions provided to perform separate tests for each feature with a separate output PASS/FAIL line, so that any failure can be uniquely identified.


Go to the first, previous, next, last section, table of contents.