13. Dependencies between Test Cases and Suites

13 Dependencies between Test Cases and Suites

13.1 General

When creating test suites, it is strongly recommended to not create dependencies between test cases, that is, letting test cases depend on the result of previous test cases. There are various reasons for this, such as, the following:

  • It makes it impossible to run test cases individually.
  • It makes it impossible to run test cases in a different order.
  • It makes debugging difficult (as a fault can be the result of a problem in a different test case than the one failing).
  • There are no good and explicit ways to declare dependencies, so it can be difficult to see and understand these in test suite code and in test logs.
  • Extending, restructuring, and maintaining test suites with test case dependencies is difficult.

There are often sufficient means to work around the need for test case dependencies. Generally, the problem is r