Changes between Version 2 and Version 3 of UnitTests
- Timestamp:
- Apr 30, 2010 11:23:54 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UnitTests
v2 v3 3 3 === Design philosophy === 4 4 5 The goal is that the unit tests will exercise as much possible code as can be managed. Unit tests are expected to change and expand as code is augmented. 5 The goal is that the unit tests will exercise as much possible code as can be managed. Unit tests are expected to change and expand as code is augmented. Unit tests have several roles: 6 * to insure that module interfaces remain static, so that downstream code is not broken by changes in a module 7 * to validate computations against independently derived values (from other software or reference materials) 8 * to confirm that results are platform independent 9 * to catch software bugs as code is augmented and adapted 10 Where possible, unit tests should be both comprehensive and quick. 6 11 7 12 === Implementation === 8 13 9 Tests are to be included directly in the GSAS-II module with a 14 Tests are to be included directly in the GSAS-II module by defining test functions. The test functions should be named to start with the string "test" and should not require any arguments. The should use assert or raise to report an unexpected result and should not print anything if the test succeeds. If the test requires more input than can comfortably be included in the module itself, the input should be placed in directory {{{testinp\}}}. If routines are used to generate this input, the generating routines can also be placed here. 15