An integration between Telerik JustCode and JustTrace arose as of 2014 Q1 release. Two new commands were made
in order to help the users find any performance or memory issues in their tests - Profile Tests
and Profile and Debug Tests.
The operation is only available inside Visual Studio and you will need JustTrace and JustCode
along with their VS Extensions installed.
The operation is only available under elevated Visual Studio (ran as Administrator)
In order to profile unit tests, you need to choose a profiler from the
JustTrace extension toolbar or menu.
Otherwise, a configuration window will prompt, asking you to choose between Performance or Memory profiler.
There are several ways to profile an unit test:
Profile Tests from JustCodes Unit Test Window
First, Build your project, in order to populate the Unit Test Window
of the JustCode Test Runner.
Then, from the JUSTCODE menu inside Visual Studio, navigate to Windows
-> Show Unit Test Window.... This will open the Unit Test Window.
From here you can use the
buttons, as shown below. Or, you can right click on a test and execute the commands from the context menu.
Profile Tests from the Solution Explorer Window
- Open the Solution Explorer Window.
From the solution tree select the item that contains the unit tests you would like to profile.
This item can be either a whole solution, project, folder or a single file.
Right-Click the selected item and navigate to JustCode from where you will be able to
choose between Profile Tests or Profile and Debug Tests.
Profile Tests with the JustCode Visual Aid
- Position the caret over the test.
Press Alt + = and from the TEST tab select
Profile Tests or Profile and Debug Tests.
Once executed Profile Tests / Profile and Debug Tests command will run your tests and simultaneously start a profiling session within JustTrace.
After getting a snapshot, JustTrace will open the Unit Tests view. There you will be able to see all profiled unit tests with their times and hitcounts. For more detailed
information about the Unit Test view, check this article.
For memory profiling, you can apply garbage collection (GC.Collect())inside each test in order to tell JustTrace to get snapshot on that state
of the test execution. Further, it will automatically get snapshot at the end of the unit test execution process.