Code Coverage Results Browser
The Code Coverage Results Browser enables one or more coverage output files to be loaded and the code coverage results to be displayed, as shown in the following image.
The Entity list box in the top-left panel displays the schema entities for which coverage information has been recorded in the file or files that are loaded. Hierarchical and flat (that is, schema, class or primitive type, and method) views are available by using the commands in the View menu.
If you specify text in the Entity text box above the entity list, the first entry in the list that contains that string is selected (the search is not case-sensitive). Use the Find Next button to find the next entry in the list that contains that text. If the specified string cannot be found, a message is displayed in the status bar at the bottom of the browser.
The table at the top right of the browser displays code coverage information for the entity selected in the Entity list box.
In the hierarchical view, each parent level displays consolidated coverage information for all of its child levels (for example, the top coverage entity displays overall coverage information, each schema entity displays coverage information for all of its child types (that is, classes and primitive types), and each type entity displays coverage information for all of its child methods). In this view, entries and levels are added to and removed from the list box dynamically as you expand and collapse levels in the tree. This enables the list box to handle files with a large number of items; potentially more items than can be displayed in a list box.
In the flat views, each element displays coverage information for itself only (that is, there is no roll-up of information). As flat views load all elements into the list box and table, the flat method view can display a maximum of 32,000 items. If any view exceeds the maximum number of entries, a message box is displayed and the view displays up to the maximum number of entries only.
The columns in the top-right table are listed in the following table.
Column | Description |
---|---|
% of JADE Methods Executed | Percentage of the number of JADE methods defined on the type (class or primitive type) or schema that were executed. The entry is empty if the selected entity list item is not a type or schema. |
You must manually request the percentage value for a schema must be manually requested (by selecting the Calculate Total Methods Executed Percent for Schema command from the File menu). | |
Total Blocks in executed methods |
Total number of blocks that are available for execution by the executed methods for the selected entity. (Each method consists of a number of executable blocks.) For schema, class, and primitive type entries, this does not include the number of blocks for methods that are not yet executed. |
Covered Blocks |
Number of blocks that have been executed at least once. If a single block is executed multiple times, it is still counted as a single covered block. |
Covered Blocks % |
Number of covered blocks as a percentage of the total blocks. Note that for schema, class, and primitive type entries, this does not include the number of blocks for methods that are not yet executed. |
Not Covered Blocks | Number of blocks not executed at all (that is, total blocks minus the number of covered blocks) |
Not Covered Blocks % |
Number of blocks not executed as a percentage of the total blocks. |
Executed Count |
Total number of times a method was executed. |
The information displayed in the pane at the bottom of the Code Coverage Results Browser depends on the selected element in the Entity list box at the top left of the browser.
-
When the selected element is the top-level Coverage item, the pane displays nothing.
-
When the selected element is a schema, the pane displays overall class and primitive type coverage information for the selected schema, as shown in the following image.
The figures for the total number of JADE methods in the schema, the methods included in the coverage, and the methods not included in the coverage are displayed only after you select the Calculate Total Methods Executed Percent for Schema command from the File menu for that schema entity.
-
When the selected element is a class or primitive type, the pane displays overall coverage information for the class or primitive type, including the JADE methods (but excluding any external methods) that do not appear in the code coverage results.
In the following image of an example of code coverage results for a class element, three JADE methods defined in the FormClientApp class do not appear in the code coverage results (that is, they have not been executed at all).
-
When the selected element is a method, the pane displays the method source with a light-red background color, indicating the lines of code that have been covered, as shown in the following image.
A line is highlighted if it contains at least one block that has been executed. There is no indication of partially executed lines; that is, where a line contains multiple blocks but only some of the blocks have been executed. A line of code is highlighted entirely or not at all.
The Code Coverage Results Browser can load coverage output files that have been captured in a different environment from the one in which the Code Coverage Results Browser is running. The browser can display information about schemas, types, and methods that it cannot find because they do not exist in that environment. It can also display entities that are different from the entities for which the output was recorded.
When a file is loaded, the following checks are performed.
-
The browser attempts to find an entity using its fully qualified name; that is, it attempts to find methods using the schema-name::type-name::method-name format.
-
An entity that does not exist in the environment of the Code Coverage Results Browser is displayed in the Entity list box with a red cross icon.
Coverage information for such items is still displayed in the table at the top right of the browser (because it comes entirely from the coverage output file), but no additional information can be displayed in the lower pane. (An appropriate status line message indicates this.) For example, if the Movie schema does not exist in the browser’s environment at all, all of its child items are marked with a cross and the lower pane does not show any source code coverage for the selected displayExpandedTitle method.
-
If an entity is found using the fully qualified name, the object identifier and edition of the entity are compared against the object identifier and edition recorded in the code coverage output file (that is, the entity in the environment of the browser is checked against the object identifier and edition of the entity for which the coverage information was recorded). If they match, everything is in order so all code coverage information for this entity can be displayed.
-
If the object identifier or the edition do not match, the entity is different from the one for which coverage results were recorded. For example, a method may have been changed and recompiled since the coverage information was captured or coverage information obtained in an environment running a later version of a schema could be loaded into a Code Coverage Results Browser running from an environment containing an older version of the schema.
In these cases, entities are displayed in the Entity list box with an exclamation mark icon. All coverage information is still displayed, including the source code information in the lower pane. However, the source code highlighting may be invalid if the method has changed significantly since the code coverage information was recorded. (An appropriate status line message is displayed in these situations.)