Determining Code Coverage

The Code Coverage command in the Jade User Interrupt submenu enables you to determine dynamically the degree to which the methods in your JADE applications have been executed without having to change application code. Use code coverage to:

When determining code coverage by using the Jade User Interrupt submenu, the application must already be running. Only those methods that are executed after code coverage has started are reported on.

Code coverage shows lines that have been executed to some degree (either fully or partially), or not executed at all.

The Code Coverage command dynamically enables code coverage, so that you do not have to change application code. You can then run the code coverage results application to load a code coverage output file, view the results, and optionally save the code coverage results text file as a comma-separated values (.csv) file that can be displayed in an Excel spreadsheet. (For details, see "Code Coverage", in Chapter 17 of the JADE Developer’s Reference.)

Code coverage data is not recorded for server methods or system methods.

Selecting the Start command starts recording the blocks of code in JADE methods that are executed during the running of the selected application. These statistics continue to be recorded to memory until you terminate the application or you select the Stop command, the Report command, or the View command. The View command stops the code coverage session, automatically initiates the code coverage application, and displays the created code coverage result file.

The code coverage results are output to a file only when you perform one of the following actions.

The results are cleared from memory when you perform one of the following actions.

Code coverage is recorded in the method cache for each method when code coverage is enabled. Methods are not discarded from the cache if code coverage is present for the method unless code coverage is reset or a results file is created. Memory utilization for a process is greater if code coverage is enabled.

In addition, performance of a process is affected if code coverage is enabled.

To access the Code Coverage submenu

The Code Coverage submenu is then displayed, containing the commands listed in the following table that control the recording of your application code coverage results.

Method Description For details, see…
Start Starts the capture of code coverage results for the selected application Starting Recording Code Coverage Results
Stop Stops the capture of code coverage results for the selected application Stopping Recording Code Coverage Results
Reset Clears code coverage results Clearing Code Coverage Results
Report Outputs information about code coverage to a file Reporting Code Coverage Results
View Displays code coverage results in the application Viewing Code Coverage Results

For details, see the following subsections.

In the JADE development environment, you can use system methods provided by the JadeProfiler class to control the recording of code coverage results, if required. For details, see Volume 1 of the JADE Encyclopaedia of Classes or "Code Coverage", in Chapter 17 of the JADE Developer’s Reference.