memilio icon indicating copy to clipboard operation
memilio copied to clipboard

Improve ABM tests

Open reneSchm opened this issue 1 year ago • 3 comments

Motivation / Current Behaviour

The current ABM coverage is okay, but some of the tests need to be improved. Most importantly, many tests do not have a clear test case.

Enhancement description

The steps might be:

  1. Find out the test case for each test and document it.
  2. Decide whether to keep the test, or remove/extend/split it

Additional context

No response

Checklist

  • [X] Attached labels, especially loc:: or model:: labels.
  • [X] Linked to project

reneSchm avatar Jul 10 '24 11:07 reneSchm

Examples:

  • TestWorld.evolveMigration is huge, and contains several test cases. It should be split up.
  • Several tests in TestMigrationRules use rng without mocking.
  • We could think about adding fuzzing or more test cases to some setter/getter tests like TestPerson.setGetAssignedLocation, as they mostly test only one value.

reneSchm avatar Jul 10 '24 12:07 reneSchm

We also need to add all checks for different VirusVariants in check_constraints() of parameters.h

khoanguyen-dev avatar Oct 18 '24 10:10 khoanguyen-dev

From 1075:

  1. Add tests for draw_infection_course (forward and backward) that check whether all wanted courses can be generated, and no unwanted are. This can be done by fuzzing or if the transation probabilties are parameters by that point, we can deterministically check.
  2. Add a constructor to Infection. This is meant to be used mainly for testing, so we can create infection courses without using rng (through draw_infection_course). This is useful for several tests, e.g. tests around Model::evolve.

reneSchm avatar Dec 17 '24 15:12 reneSchm