A little known feature of VSTS Team Developer is the ability to use the run-time analysis of the Profiler specifically targetting the code in a Unit Test. There are a two key scenarios this integration feature targets:
- Collect Performance Data on Specific Code
Normally you'd have to kick-off your entire application with profiling turned on and collect a potentially tremendous amount of data, just to analyses one small part of code. With this, you can profile just a small specific section of code.
- Performance Regression Testing
It is common to have a large number of unit tests. One day you find one test takes notably longer than it used to in a test run. How do you debug the performance degradation? Use the profiler to target the slow unit test.
How do you do this? See this short <2 min video clip of Profiling a Unit Test to see it in action.
- Create a new Unit Test
- Run the Unit Test
- In the Test Results tool window, right click the test run and choose Performance Test
- You can now run the new performance session from Performance Explorer.
Today profiling is limited to just unit tests (that do not target web services). One of the features we're currently working on is the ability to profile web tests or load tests.