Hi, my name is Varun Gupta and I am a member of the MACH-IT program at Microsoft working on my first rotation in SMIT Engineering. Over the past few months I have been focusing on test automation for one of our CRM instances, and along the way, I’ve picked up a few tips and tricks around using Microsoft Test Manager (MTM) that I have found to be significantly helpful with driving efficiency of day-to-day testing tasks.

Test engineering teams are pushing hard to achieve high levels of 100% test automation, and many are successful in doing so. However, there are some hidden nuggets of MTM that folks may not be taking advantage of and so I wanted to share a few of them with you today.   

Microsoft Test Manager provides a command line utility 'tcm.exe', which enables us to execute associated automation from a batch file, the batch file can be scheduled to run each time a new build is executed (see example below):

tcm run /create /title:"Midnight Run" /planid:11 /suiteid:52 /configid:2 /settingsname:"<Name of your automated test settings>" /testenvironment:"<Name of a matching environment>" /collection:<CollectionURL> /teamproject:<Team Project name>

For Reference: How to: Run Automated Tests from the Command Line Using Tcm


Even though we all strive to automate we may not be successful in doing so for a variety of reasons. In those cases we must revert back to manual testing, and this leads to the burden of executing hundreds of build verification tests in a short period of time. To ease regression testing, we can associate builds to the test plan in MTM, MTM will then call out all test cases affected by the latest build, thereby saving regression cycle time by enabling the tester to only focus on those test cases that were
impacted by the code changes:

MTM captures Test Impact Analysis, were user can collect information that can help him to decide which tests to rerun based on changes made to an application for a specific build. Test Impact is collected for test cases during the first test run, and then eventually used to compare with upcoming latest builds to measure rerun required. To enable Test Impact, go to Test Settings -> Data & Diagnostic Page.          

For Reference: How to: Collect Data to Check Which Tests Should be Run After Code Changes

We’ve all encountered the situation where we log a bug but the response from the developers is that that the code was running perfectly on their machine but they’re not sure why it’s not running in the test environment, so they request repro steps to better understand what led to the defect. This is yet another area where MTM can be of tremendous help by logging bugs with repro steps, system information, data values and other useful information.

This detailed logging of repro steps is achieved by enabling IntelliTrace which is found in Test Settings -> Diagnostic Data Adapter. During test case execution, .iTrace is created and gets associated with the bug as soon as the defect is encountered. The file can be shared with other Testers and Developers to debug and resolve the issue. 

For Reference: How to: Collect IntelliTrace Data to Help Debug Difficult Issues

Last but not least, each application has thousands of test cases and with time it grows as more functionality gets implemented. Sometimes new features and changes to user stories may require us to update or override previous test cases, resulting in unwanted work items that unnecessarily occupy space in our TFS Database.

To get rid of those unwanted work items, we can use the witadmin tool to create, delete, export and import work items associated with the team project. To use the witadmin command line tool, you need to have Project Administrator or Team Foundation Server Administrator privileges.

As an example:To delete a work item from TFS, you can use the below command:

witadmin destroywi /collection:CollectionURL /id:id [/noprompt]

This will remove the work item with a specific id, and using different options, you can write a batch file to delete a set of work items.

For Reference: Permanently Removing Work Items [witadmin]

These are just some of the key features of Microsoft Test Manager that can enhance the project’s Test Life Cycle, and thereby lead to enhanced quality metrics for a product. I would encourage all test teams to learn more about the great features of MTM and take advantage of these features to drive efficiency with their testing.