ANTS Performance Profiler - 6.3

ANTS Performance Profiler

Profiling tests in MSTest - ANTS Performance Profiler

MSTest is a software unit testing framework developed by Microsoft, which lets you create, manage, and run unit tests from within the Visual Studio IDE, as well as from the command line.

You can profile tests running in MSTest. Profiling your tests ensures that you are quickly alerted to any bottlenecks in your tests.

This topic assumes that you are familiar with MSTest, and have already built an assembly full of tests that you want to profile.

Before you start profiling, you will need a debug build of your test assembly.

Setting up the performance profiler

To profile .NET executables, on the ANTS Performance Profiler Settings dialog box, perform the following steps:

  1. Under Choose application type to profile, click .NET executable.
  2. Set the .NET executable box to the path where MSTest.exe is installed:
    • For .NET 2.0 applications, this is often: %ProgramFiles(x86)%\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe
    • For .NET 4.0 applications, this is often: %ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe
  3. Select the required Profiling mode, SQL and file I/O, and Profile child processes options; see Working with Application Settings.
  4. Specify the command line Arguments that are to be used when running the application.

    Set a /testcontainer argument to tell MSTest the path to the assembly that contains all of the tests. For example:

    /testcontainer:"C:\Documents and Settings\<USER NAME>\My Documents\Visual Studio 2008\Projects\LoginForm\MyTests\bin\Debug\MyTests.dll"

  5. If required, change the performance counters to record; see Setting up Charting Options.
  6. Click startprofilingbutton.

MSTest starts and executes all of the tests contained within the assembly.

During a profiling session you can interact with the profiler while your tests are still being profiled, and obtain results by selecting areas of the timeline.

When you have finished interacting with your application, click the StopProfilingbuttonsmall Stop Profiling button in ANTS Performance Profiler.

Was this article helpful?

Search support
Forums

ANTS Performance Profiler

all products