Skip to content

Unit Test Notes

Akhil Kumar edited this page Sep 20, 2022 · 1 revision
  1. During development run tests with --random flag so that we can easily catch resource outage or ordering issues in tests e.g. aprapipesut.exe -t h264encodernvcodec_tests --random. Many many times one test fails because another test leaves a garbage and we do not come to know until they are run in sequence. However even after running them in sequence many issues remain hidden so a good practice is to run tests in random order. Ideally we should run CI build with random test order after we gain some more confidence.

  2. Put deliberate effort to refacotr test code to follow DRY principle. else test code becomes too much and too repetitive to follow or understand.

  3. Also split tests into "setup" "run" and "teardown". The tests with same/similar setup should be lumped togather and reuse the setup and tear down.