Skip to content
jmoeckel edited this page Nov 5, 2015 · 1 revision

Guidelines regarding unit tests. Even if testing is the first thing, that is going to be dropped when faced with deadlines - you (and let us be honest - this is true for most developers) should rethink this strategy. It is quite similar to the point documentation: The small amount of extra time you invest now, will save you much (really much) time in future, when you have to find the source of some new and totally unexpected behaviour of your code.

7.1 Existence of Unit Tests

Implement at least one unit test for every model and every function and run the unit tests. See unit test implementation.

7.2 Using Asserts

Use Annex60.Utilities.Diagnostics.AssertEquality to cause a test to fail if the result is incorrect.

7.3 Avoid Numerical Jacobians in Unit Tests

Ensure that no unit test requires a numerical Jacobian. If a numerical Jacobian is needed, improve the model.