One of the great new features in Team Foundation Server 2010 is hierarchical queries. A hierarchical query allows you to return multiples sets of related data in one query.
The screen shot below shows a typical hierarchical query. In this query I have selected “Work Items and Direct Links” which sets up the hierarchy. Next, I set the top level work items to filter on Test Cases and the secondary work items to filter on Bugs and Resolved. This gives me a query of all my test cases that have associated resolved bugs. Perfect query for a tester to run through resolved bugs.
Another great way to use this type of query is to find missing items. Suppose you want to find all the user stories that have not test cases. The key to this type of query is to select “Only return items that do not have the specified links”. In the query below I have filtered for user stories with no test cases. This is a great way to catch part of your application that does not have test coverage.
