Terrasoft ProfilerJTerrasoft ProfilerJ
Home | Features | Screenshots | Documentation | Download | Evaluate | Buy | Contact | About
ProfilerJ
Agent
Snapshot file format
ProfilerJ Console
Command line reference
Installation
Content of distribution
Installation
Tutorial
Step 1 - Download files
Step 2 - Deploy agent
Step 3 - Run ProfilerJ Console
Step 4 - Get a license key
Step 5 - Run ProfilerJ Viewer
Step 6 - Sampling
Step 7 - Byte Code Instrumentation
Step 8 - Code Coverage
ProfilerJ Viewer

Step 8 - Code Coverage

Configure Code Coverage

First, activate Code Coverage either from the Overview panel or by selecting the menu "Settings / Sampling and instrumentation rules":

 

The "Sampling and instrumentation rules" dialog appears:

Please perform the following steps:

  • Select the "Enabled" checkbox,
  • add class "com.terrasoft.profilerj.*" to the included classes,
  • add "c:/profilerj/src" to the "Source Folders" table
  • download examples-src.zip from here and extract the content of the zip file to c:/profilerj/src.

 

Apply Code Coverage

Next, send the instrumentation rules to the remote VM. Click the toolbar item highlighted below or select the menu "remote VM / apply rules":

 

Resume Process

Next, resume Example01 by clicking " Resume Process". Wait until Example01 is suspended again. Simply  "Synchronize status" until the menu item "Resume process" becomes activated again or watch the console output of Example01.

 

Create a snapshot

To create a snapshot, select menu item " Create snapshot". The snapshot will be automatically displayed. Select panel "Coverage" and you should see something like this:

90% of the lines containing code have been reached. Since constructor Example01(String) hasn't been invoked, only five out of six methods have been called (i.e. 83%).

Open source file

Now click button "open source file". A file viewer pops up, where green areas indicate reached code. Analogously, red areas stand for non-reached lines which do contain executable code.

 

«previous

Copyright © 2006 Terrasoft Software GmbH. All rights reserved.