Profiling and Tracing

We’ve been working on our profiling and tracing system rather a lot in this release. The main innovation being a system of instrumentation that doesn’t require and C++, or COM, or even a profiler DLL. One of the benefits of this new approach is sheer speed at runtime and the ability to collect some really clever data during the test runs.

The most exciting thing is the Call Trace. When you are running with coverage enabled (TestMatrix | Collect Coverage Data), this call trace is populated along with the line level code coverage.


Think of this as showing you the Call Stack that you see while debugging, but after your tests are finished. This lets you review what was called, which can often be surprising to see just how many methods are involved in a test case.

This also lest you see the time and percentages of time in a method, separating out the actual clock time (Time in Method) from the CPU elapsed time (CPU in Method). Gaps in those two numbers indicate some kind of block or wait, such as I/O, Sleep, or a database call.

One thing to keep in mind, in order to be very fast, and to focus on code you can really do something about, the trace only collects data from your classes and methods, not from the base class library. Very specifically, the times for calls nested ‘under’ another call don’t sum up when you call out to the framework as those methods just aren’t in the call trace shown.


Coming soon on the online updates, we’re planning on enhancing this feature with some additional data:

  • Calls out the framework from your methods, one level deep so it stays fast but so that the times ‘add up’
  • Allocations of your solution’s objects, count and size - but not cluttering up the data with huge numbers of allocations of string, which is the usual problem with memory profiling.
  • File, Network, and Registry I/O similar to procmon/filemon/regmon, but inline in the call trace
  • Exceptional Exits - marking on the call trace when a method exited via a a thrown exception rather than returning normally
  Permalink |  Comments[0]

Recent Entries

 » Build 2687 Posted
 » New Unit Testing Book
 » Build 2293 Update Posted
 » Microsoft Team System NUnit Adapter
 » MS Team System Test Support

You can leave a response, or trackback from your own site.

Leave a Reply


You must read and type the 5 chars within 0..9 and A..F, and submit the form.


Oh no, I cannot read this. Please, generate a