Download PRISM Program for Integrated Earth System Modelling
Transcript
4. Boundary analysis. Logical statements that refer to threshold states are checked to ensure they are correct. 5. Check for bad input data. 6. Test for scientific validity. By analyzing the code to be tested different test cases can be designed to ensure that all logical statements are exercised in the unit-test. Similarly input can be designed to test logical threshold states (boundary analysis). Testing scientific validity is of course the most difficult. But, sometimes testing states where the answer is known analytically can be useful. And ensuring (or measuring) the degree to which energy, heat, or mass is conserved for conservative processes can also often be done. These types of tests may also be applied for more complex functional and component tests as well. 4.1.2 Functional-tests Functional tests take a given sub-set of the component and test this set for a particular functionality. Scientific functional tests are common. Important functional tests should be maintained in the source code revision system as separate modules that include the directories maintained for the main component and be distributed with the PRISM component. 4.1.3 Component-tests Component-tests need to ensure that the given PRISM component compiles, builds, and runs and that it passes important model requirements. For example, restart capabilities. 4.1.4 PRISM testing requirements and implementation details Unit and Functional tests should meet the following minimum requirements: 1. Maintained in CVS either with the rest of the models source code or as a separate module that can be used. Module and/or directory name should be easily identifiable such as ‘unit test’. 2. Have documentation on how to use it. 3. Have a Makefile associated with it. It may be useful to leverage off the main Makefile so that the compiler options are the same and so that platform dependencies don’t have to be maintained twice. 4. Check error conditions so that an error will print out problems. 5. Interactive test should be avoided, unless a completely automatic test can be set-up using the same mechanism (i.e. redirecting the input). 6. In general unit tests should be run with as many compiler debug options on as possible (bounds checking, signal trapping etc) as well as using optimized options, making sure the results are comparable. Component tests should meet the following minimum requirements: 1. Ensure that the given model will compile, build and run on at least one production platform. 2. Ensure that the given model will work with the PRISM system on at least one production platform. 20