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:
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":
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.