Wiki

Clone wiki

OscaR / testsuite

Here are some guidelines when you write unit-tests for OscaR

  • Prefer measuring coverage of your test rather than the runtime of it (a test that runs for 8 hours but tests only 2% of your code is probably not interesting). You can use jacoco:cover in sbt to measure your test coverage.
  • Please make test cases as fast / short as possible: most bugs can be reproduced on small instances. For the comfort of everyone the whole test-suite should be executable in no more than a few minutes. So ideally an individual test case should not take more than a minute. The test suite is not a performance benchmark. OscaR has a
  • Don't generate output test cases should not contain any println statements. Use the ScalaTest / JUnit methods to perform the actual comparisons you wish to test. Console output doesn't serve any purpose other than to clutter the test report, and slow the test suite down.
  • A test must succeed 100% of the time, otherwise you break the build. It doesn't mean you cannot use random number generators and stochasticity.

Updated