SDXorg / pysd

System Dynamics Modeling in Python
http://pysd.readthedocs.org/
MIT License
367 stars 88 forks source link

Add Extreme Conditions Test / Static Test Matrix #132

Open JamesPHoughton opened 7 years ago

JamesPHoughton commented 7 years ago

Expanding on ideas in Lessons from software testing for developing behavioral tests of dynamic models, create a simple way to specify extreme conditions tests for a model.

The general idea is to have a table where each row specifies a particular parameter and a value for it to take on, and then each column corresponds to the other parameters in the model. When a test condition has implications for the immediate values of one of the other parameters, these are specified in a cell. In the example from the above paper, the test matrix could look like:

Value Infection Recovery
Susceptible 0 0 -
Total Population 0 0 0
Infected 0 0 0
Contact Rate 0 0 -
Recovery Time inf - 0
Infectivity 0 0 -

To make this type of testing easier, we should also have a function which creates a template for this type of matrix, and saves it to a file that the modeler can edit and add their constraints to. The most basic template would just take extreme conditions for each value and make them into rows.

A more advance templating function would also:

JamesPHoughton commented 7 years ago

One of the problems with this method is that if you rename a variable, it won't be automatically renamed in the excel file. If you've done a lot of work filling in values for the tests, this could cause a problem.