Microsoft Test Categories to the rescue

Do you recall the Test List editor (the file in the Test Project .vsmdi) that was constantly causing the team headaches,? In VS2010 Test Categories has come to the rescue. Test Categories allow us to grouping our tests together which then can be run and reported by category.

Test Categories are set up through the Test Viewer in Visual Studio 2010.

1. Open Test View window (Test –> Windows –> Test View)

2. Select a Test and open the test properties (right-click on test and select Properties)

3. Find Test Categories then click the dropdown arrow to the right

4. Test Category window opens where you can:

    • Add new Category
    • See Available Categories
    • Assign Categories


Microsoft recommends using Test Categories instead of the Test List functionality, however if your using the Test Check-in Policy you will still require the test list. You can use both the test list, for your check-in policy and then test categories for all other tasks.

If created a  Build Verification Test list using the Test Editor list no problem, create a Test Category named BVT and instead add this to your Build definition.

Build Definition:

Under the Basic section, in the automated tests section open the Test Assembly then click and select a  Category Filter. The test category filter consists of one or more test category names separated by the logical operators '&', '|', '!', '&!'. For example, TestCategory1&TestCategory2 will run all tests with a test category of TestCategory1 and TestCategory2 . Or you can just select all tests in one category by entering TestCategory3. (The logical operators '&' and '|' cannot be used together to create a test category filter.)

  1. Share your usages of Test Categories by adding comments to this blog, I will publish them.

  2. Test Category for Smoke or Regression tests, a portion of an application …