Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between test suite, test case and test category

Tags:

junit

What is the difference between test suite, test case and test category. I found a partial answer here

But what about categories?

like image 328
Oleh Avatar asked Oct 21 '25 10:10

Oleh


1 Answers

Test case is a set of test inputs, execution conditions, and expected results developed to test a particular execution path. Usually, the case is a single method.

Test suite is a list of related test cases. Suite may contain common initialization and cleanup routines specific to the cases included.

Test category/group is a way to tag individual test cases and assign them to categories. With categories, you don't need to maintain a list of test cases.

Testing framework usually provides a way to specify which categories to include or exclude from a given test run. This allows you to mark related test cases across different test suites. This is useful when you need to disable/enable cases that have common dependencies (API, library, system, etc.) or attributes (slow, fast cases).

As far as I can understand, test group and test category are different names for the same concept used in different frameworks:

  • @Category in JUnit
  • @group annotation in PHPUnit
  • TestCategory in MSTest
like image 103
default locale Avatar answered Oct 23 '25 11:10

default locale



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!