Squish Coco

Code Coverage Measurement for C/C++

Part III
CoverageBrowser Reference Manual

Chapter 5  Introduction

CoverageBrowser is a graphical user interface program which enables the user to analyze test coverage.



The way that CoverageBrowser is typically used is as follows:

  1. Load an instrumentation database (a .csmes file), that was generated by CoverageScanner.
  2. Load a corresponding execution report (a .csexe file). There may be several reports to choose from: CoverageBrowser displays them in a tree view where they can be individually selected or deselected for coverage analysis.
  3. Search for untested code segments.
  4. Mark dead code or code which cannot be tested, as “manually validated”.
  5. Add comments to the instrumented code.

CoverageBrowser saves all data (execution reports, comments, etc.) to the instrumentation database.

Chapter 6  Black box and white box testing

CoverageBrowser can be used for both white box testing and for black box testing: if no source code information is available in the instrumentation database (i.e., in the .csmes file), CoverageBrowser will switch into black box testing mode. In this mode CoverageBrowser has a simpler user interface that doesn’t provide access to the functionality that is possible when the program has access to the source code. Nonetheless, even with the reduced functionality, it is still possible to import and manage executions.


A black box instrumentation database can by generated by clicking on "File->Generate Black Box Configuration". It is possible to merge such a database into a white box configuration at a later stage if desired.

pictures/coveragebrowser_blackbox.png pictures/manual.tmp007.png
CoverageBrowser’s simplified user interface for black box tests
CoverageBrowser’s simplified user interface for black box tests

Chapter 7  The Execution Management Window

This window is present for both black box and white box testing. It is used to show all the application executions that have been done, including details of their code coverage.

7.1  Principles

Executions of the instrumented application are displayed in a tree view in the "Executions" window. CoverageBrowser uses a slash ‘/’ as a separator for grouping measurements together.
For example, the tests viewed in Figure fig:coveragebrowser_executions_fig have the following names:

  • SubTest/test1
  • SubTest/test2 (12)
  • SubTest/test2 (2)
pictures/coveragebrowser_executions_fig.png pictures/manual.tmp008.png
The Executions View
The Executions View

The checkbox next to each item can be used to select executions. The input field pictures/filter.png makes it possible to filter the output using regular expressions (see chap. sec:coveragebrowser-filter). Click the pictures/select.png button to select all the visible executions (i.e., all those that have not been filtered out). Or click the pictures/deselect.png button to unselect all the executions.

For a more finely controlled filter, click the "..." button: this will pop up a dialog through which it is possible to set filtering depending on the execution state and the comments.

Note that the text which is filtered is a test execution’s full name—for example, SubTest/test1.

The "Sources", "Methods" and the "Source Viewer" windows only display the code coverage status of the selected executions.

Click the pictures/testPerformance.png button to switch into the execution comparison analysis mode (see chap. test-benefit).
The user can set the state of the executed test, which can be any of the following:

"Unknown"
Default state.
"Passed"
This state is used to mark the test as passed (background colour is green)
"Failed"
This state is used to mark the test as failed (background colour is red)
"Need manual check"
This state is used to indicate that the test must be done manually (background colour is orange)

It is possible to add comments to, rename, delete, or merge executions through the use of CoverageBrowser’s context menus and dock windows1. It is possible to use regular expressions to identify the executions to which these modifications can be applied. (The regular expression syntax is described in Chapter sec:coveragebrowser-filter.) Before regular expression-driven actions are carried out CoverageBrowser shows a before and after preview of what effects the change would have.
Here some examples of deleting executions:

  • To delete all execution using the wildcard syntax:
    Execution Name*
  • To delete all executions in TESTS using the wildcard syntax:
    Execution NameTESTS/*
  • To delete all executions in TESTS using the regular expression syntax:
    Execution Name=TESTS/.*

Here some examples of renaming execution:

  • To put all executions in the directory TESTS set:
    Actual Execution Name=.*
    New Execution NameTESTS/&
  • To move all executions in the directory TESTS in the directory OLD set:
    Actual Execution Name=TESTS/(.*)
    New Execution NameOLD/\1
  • To rename all executions in all directories in testname [directory] set:
    Actual Execution Name=([^/]*)/([^/]*)
    New Execution Name\2 [\1]
pictures/coveragebrowser_rename_regex_fig.png pictures/manual.tmp009.png
Renaming using Regular Expressions
Renaming using Regular Expressions
The name of the test item and also its state can be defined by an external test suite.(see chap. test-suite-adaptation)

7.2  Loading an Execution Report

The execution report is produced upon application exit. Its name is defined by the initialization function __coveragescanner_install of the CoverageScanner library (see chap. coveragescanner_install). Its extension is followed by ".csexe". It contains the list of all executed code segments for each application run. The execution report is never overwritten but execution contents are appended.

To load an execution report click on "File->Load Execution Report" or the icon pictures/csexeopen.png on the toolbar. The dialog as shown in fig:coveragebrowser_loadexec_fig will appear.

pictures/coveragebrowser_loadexec_fig.png pictures/manual.tmp010.png
Loading Execution Report Dialog
Loading Execution Report Dialog

The file can be loaded directly or using a script. To load directly, click on "file", enter the path of the ".csexe" file to load to the free form input box or use the browse button.
If the option "Delete after transferring" is selected, the execution report file will be deleted after transfer. The option "When file becomes modified" permits to reopen this dialog automatically when the execution report is modified.

The "Name" field allows the user to specify the name of the imported instrumentation if this is not specified in the execution report (see chap. executionreportname). Also, it is possible to set the execution status (passed, failed or to be checked manually) of all imported executions.
If more than one instrumentation is imported an index is appended to this default name.
The option "Import Preprocessing" permits to select the behaviour in the case of conflicts or redundant executions:

"Ignore Duplicate Executions"
Executions which have executed the same code than an execution which are already imported are ignored.
"Import Duplicate Executions"
Executions are imported if at least one instrumented source code line is executed.
"Import Duplicate And Empty Executions"
All executions are imported.
"Merge all executions with the same name together"
All executions with the same name are merged (i.e. the execution count of each instrumentation is added).

Invalid executions are not imported and a summary shows when the operation is completed (see figure fig:coveragebrowser_loadreport) when "Display import summary" option is selected.

pictures/coveragebrowser_loadreport.png pictures/manual.tmp011.png
Loading Executions - Summary
Loading Executions - Summary

If the execution report is not accessible through the file system, a script can be used. The script has only to print the contain of the execution report to the standard output (stdout). The standard error output (stderr) is displayed on the screen and can be used for debugging purpose. On success, the script must exit with the value 0.

7.3  Execution Comparison Analysis Mode

The execution comparison analysis mode if activated by clicking on the button pictures/testPerformance.png. In this mode, CoverageBrowser does not display the coverage of a set of tests but the lines covered by an execution which are not covered by a set of reference executions. In other words, CoverageBrowser shows what an execution is covering more than a set of other executions.
The list of reference executions are the executions checked in the execution list. Double-clicking on the name of the execution permits to select the test to analyse. Only the instrumented lines which are executed by this execution are shown, the other are in the state "hidden". Also the coverage statistics displayed in the source list are only containing the percentage of instrumented statements which are only executed by this the selected execution.

If the execution to analyse is present in the list of reference executions, this one if implicitly remove from the list. (In other words, if execution A is compared to execution A and B, CoverageBrowser make a comparison of execution A with B only.) Comparing the benefit of an execution with itself will in fact not give usefully information.
pictures/coveragebrowserbenefit_fig.png pictures/manual.tmp012.png
Execution Comparison Analysis Mode
Execution Comparison Analysis Mode

Chapter 8  Source Browser Window

This feature is not available for black box testing.

The "Sources" window can be displayed by clicking on "View->Sources".

pictures/coveragebrowser_srclst_fig.png pictures/manual.tmp013.png
Source Browser Window
Source Browser Window

Each item is a C and C++ source file and the sub-entries are the list of included headers which have been instrumented. When an item the "Source Window" will be displayed.

The "Sources" window displays rudimentary code coverage statistics for each source code file. The color of each item is selected according to code coverage statistics for each file and the watermarks.(see chap. watermarks)
The input field pictures/filter.png permits to filter the output using regular expressions (see chap. sec:coveragebrowser-filter). The item text which can be filtered is the full path of the source file. (example: c:\directory\file.cpp)

IconShortcutDescription
pictures/previousModule.pngCtrl+Shift+FPrevious source file
pictures/nextModule.pngCtrl+FNext source file
Source Browser - Shortcuts
This feature is not available for black box testing.

Chapter 9  Method Browser Window

The "Methods" window can be opened by clicking on "View->Methods".

pictures/coveragebrowser_method_list.png pictures/manual.tmp014.png
Method Browser Window
Method Browser Window

The "Methods" window displays a the code coverage statistics of each C and C++ functions, classes and namespaces. Clicking on a function permits to show all instrumented lines of it in the "Source Viewer".
The input field pictures/filter.png permits to filter the output using regular expressions (see chap. sec:coveragebrowser-filter). The item text which can be filtered is the symbol name including the class name and the namespace. (example: MyNamespace::MyClass::MyProc)

This feature is not available for black box testing.

Chapter 10  Source Viewer Window

10.1  Source Display

The "Source Viewer" window can be displayed by clicking on "View->New Source Window".

pictures/coveragebrowser_source_desc.png pictures/manual.tmp015.png
Source Window
Source Window

The "Source Viewer" window displays the source file or its C or C++ preprocessed view. Clicking on pictures/preprocessorview.png enables the user to toggle between the 2 different views.


The source code is colored with code coverage instrumentations. The colors used are described in section sec:color_convension.


By selecting an area with the mouse, corresponding instrumentations are highlighted and a detailed description of them is displayed in the "Explanation" window (see chap. code-coverage-explanation). It is possible to navigate between instrumentations using the navigation buttons pictures/nextInstrumentation.png and pictures/previousInstrumentation.png. Navigation buttons in yellow, blue, red and green permit to jump to the next or previous comments, manually validated instrumentations, non-executed code parts or executed code parts. Clicking on the source code selects the nearest instrumentation.


If a comment is entered for an instrumentation, the icon pictures/comments.png is displayed in the margin.
On the right side, CoverageBrowser displays the test coverage count1 or the code coverage count2 for each line. If a source code line contains more than one instrumentation, CoverageBrowser display the range of their counts.

Mouse WheelDescription
WheelScroll up/down
Ctrl+WheelZoom in/out
Shift+WheelNext/previous instrumentation
Source Display - Mouse Wheel
IconShortcutDescription
pictures/previousInstrumentationComment.pngCtrl+Shift+BPrevious comment
pictures/nextInstrumentationComment.pngCtrl+BNext comment
pictures/previousInstrumentationUnTested.pngCtrl+Shift+UPrevious unexecuted code
pictures/nextInstrumentationUnTested.pngCtrl+UNext unexecuted code
pictures/previousInstrumentationTested.pngCtrl+Shift+TPrevious executed code
pictures/nextInstrumentationTested.pngCtrl+TNext executed code
pictures/previousInstrumentationManuallyValidated.pngCtrl+Shift+VPrevious manually validated instrumentation
pictures/nextInstrumentationManuallyValidated.pngCtrl+VNext manually validated instrumentation
pictures/previousInstrumentation.pngCtrl+Shift+IPrevious instrumentation
pictures/nextInstrumentation.pngCtrl+INext instrumentation
pictures/previousModule.pngCtrl+Shift+FPrevious source file
pictures/nextModule.pngCtrl+FNext source file
pictures/newview.pngCtrl+JOpen a new source window
pictures/preprocessorview.pngCtrl+Shift+JSwitch between the preprocessor view and the original source
pictures/comments.pngCtrl+KAdd/Edit Comments
pictures/no_comments.pngCtrl+Shift+KRemove Comments
pictures/validation.pngCtrl+WMark as Validated
pictures/no_validation.pngCtrl+Shift+WClear Validation Flag
pictures/commentundo.pngCtrl+ZUndo
pictures/commentredo.pngCtrl+Shift+ZRedo
Source Display - Shortcuts
This feature is not available for black box testing.

10.2  Color Convention

Instrumentations are displayed in a source window using different colors:

Green - "Executed"
An instrumentation is displayed in green when the code has been executed.
Orange - "Partially Executed"
An instrumentation is marked as "Partially Executed" when it is not completely executed. This occurs when a Boolean expression was only true or false for example. In the case of a source code line which contains more than one instrumentation, the line is marked as "Partially Executed" when one of its instrumentations has not been "Executed". A detailed information is displayed in the "Explanation" window (see chap. code-coverage-explanation).
Red - "Never Executed" or "Execution count too low"
An instrumentation is displayed in red when the code is never executed or when the execution count is lower that than the execution count requested.
Magenta - "Dead-Code"
An instrumentation is displayed in magenta when the code cannot be executed.
Blue - "Manually Set To Be Executed"
The user has the possibility to mark an instrumentation as ’Manually Validated’. This is usually to exclude dead code or code which cannot be tested for code coverage statistics. This state is only relevant if executions are in a "Never Executed" or "Partially Executed" state.
Gray - "Unknown" or "Hidden"
Gray is used when no information about instrumentation is available. This occurs when no executions are selected or when comparing executions of tests (see chap. test-benefit).

10.3  Comments

10.3.1  Editing Comments

It is possible to add a comment by selecting an instrumentation and clicking on the context menu entry "Add/Edit Comment", the main menu entry "instrumentation->Add/Edit Comment" or the icon pictures/comments.png on the toolbar.

The "Comment" Window fig:coveragebrowser_comment_edt appears and allows a comment to be edited. The most recently entered comments can be retrieved by clicking on the "Last Comments" selection field. Basic text formatting is possible using the integrated toolbar buttons (see comments_shortcut).

pictures/coveragebrowser_comment_edt.png pictures/manual.tmp016.png
Comment Editing
Comment Editing
If a minimal length for a comment is set, the comment can only be entered if this is reached (see chap. minimum_comment_size).

The comment is printed in the explanation in a yellow box and the icon (pictures/comments.png) is displayed in the source window near the line number.

IconShortcutDescription
pictures/commentstrikethrough.pngCtrl+SStrikeout
pictures/commentbold.pngCtrl+BBold
pictures/commentitalic.pngCtrl+IItalic
pictures/commentunderline.pngCtrl+UUnderline
pictures/commentjustify.pngCtrl+JJustify
pictures/commentright.pngCtrl+RAlign Right
pictures/commentleft.pngCtrl+LAlign Left
pictures/commentcenter.pngCtrl+MCenter
pictures/commentundo.pngCtrl+ZUndo
pictures/commentredo.pngCtrl+Shift+ZRedo
Comments - Shortcuts
This feature is not available for black box testing.

10.3.2  Removing Comments

It is possible to remove a comment by selecting an instrumentation and clicking on the context menu entry "Remove Comment", the main menu entry "instrumentation->Remove Comment" or the icon pictures/no_comments.png on the toolbar.

This feature is not available for black box testing.

Chapter 11  Code Coverage Explanation Window

The "Explanation" Window fig:coveragebrowser_expl_fig is a docking window which is automatically updated with a detailed description of the selected instrumentations of the source window.


For each instrumentation, the following information is displayed:

  1. A short description of the instrumentation state (see chap. sec:color_convension).
  2. The preprocessed source code which is concerned by the instrumentation.
  3. For Boolean expressions, the truth-table which shows executed and unexecuted states.
  4. The list of executions which are executing the portion of code.
  5. User comments.
pictures/coveragebrowser_expl_fig.png pictures/manual.tmp017.png
Explanation Window
Explanation Window

CoverageBrowser displays the truth-table in the case of a Boolean expression which is partially executed. The truth-table indicates which value the expression has or has not reached during execution.


Example: the truth-table truth_table indicates that the expression was false but not true.

TRUEFALSE
noyes
Truth-Table Example
This feature is not available for black box testing.

Chapter 12  Statistic Window

The "Statistic" Window fig:coveragebrowser_statistic is a docking window which is automatically updated with the code coverage statistic for the whole project.


If the coverage level is greater than one, the "Statistic" Window displays the statistics of the current level and the level one.

pictures/coveragebrowser_statistic.png pictures/manual.tmp018.png
Statistic Window
Statistic Window

Chapter 13  Filter using wildcard expression or regular expressions

CoverageBrowser provides a generic filtering mechanism of rows using wildcard or regular expressions. Wildcard expressions are activated per default and regular expressions are selected when the expression starts with an equal sign (’=’). Clicking on the filter icon converts the expression from wildcard into regular form as far as this is possible and vice versa.

IconDescription
pictures/filterregexp.pngThe filter uses regular expression syntax.
pictures/filterwildcard.pngThe filter uses wildcard syntax.
pictures/filterinvalid.pngSyntax error. More information are displayed in the status bar.
Filter States

13.1  Wildcard Expression

ElementMeaning
*any characters (0 or more)
?any character
[...]set of character

Examplefoo*bar match any tests containing the string foo followed by bar.

13.2  Regular Expression

The first character must be ’=’ to activate the regular expressions.

13.2.1  Pattern matching

ElementMeaning
cAny character represents itself unless it has a special regexp meaning. Thus c matches the character c.
\cA character that follows a backslash matches the character itself except where mentioned below. For example if you wished to match a literal caret at the beginning of a string you would write \^.
\aThis matches the ASCII bell character (BEL, 0x07).
\fThis matches the ASCII form feed character (FF, 0x0C).
\nThis matches the ASCII line feed character (LF, 0x0A, Unix newline).
\rThis matches the ASCII carriage return character (CR, 0x0D).
\tThis matches the ASCII horizontal tab character (HT, 0x09).
\vThis matches the ASCII vertical tab character (VT, 0x0B).
\xhhhhThis matches the Unicode character corresponding to the hexadecimal number hhhh (between 0x0000 and 0xFFFF).
\0ooo (i.e., zero ooo)matches the ASCII/Latin1 character corresponding to the octal number ooo (between 0 and 0377).
. (dot)This matches any character (including newline).
\dThis matches a digit.
\DThis matches a non-digit.
\sThis matches a whitespace.
\SThis matches a non-whitespace.
\wThis matches a word character.
\WThis matches a non-word character.
^The caret negates the character set if it occurs as the first character, i.e. immediately after the opening square bracket. For example, [abc] matches 'a' or 'b' or 'c', but [^abc] matches anything except 'a' or 'b' or 'c'.
-The dash is used to indicate a range of characters, for example [W-Z] matches 'W' or 'X' or 'Y' or 'Z'.
E?Matches zero or one occurrence of E. This quantifier means "the previous expression is optional" since it will match whether or not the expression occurs in the string. It is the same as E{0,1}. For example dents? will match 'dent' and 'dents'.
E+Matches one or more occurrences of E. This is the same as E{1,}. For example, 0+ will match '0', '00', '000', etc…
E*Matches zero or more occurrences of E. This is the same as E{0,}. The * quantifier is often used by a mistake. Since it matches zero or more occurrences it will match no occurrences at all. For example if we want to match strings that end in whitespace and use the regexp \s*$ we would get a match on every string. This is because we have said find zero or more whitespace followed by the end of string, so even strings that don’t end in whitespace will match. The regexp we want in this case is \s+$ to match strings that have at least one whitespace at the end.
E{n}Matches exactly n occurrences of the expression. This is the same as repeating the expression n times. For example, x{5} is the same as xxxxx. It is also the same as E{n,n}, e.g. x{5,5}.
E{n,}Matches at least n occurrences of the expression.
E{,m}Matches at most m occurrences of the expression. This is the same as E{0,m}.
E{n,m}Matches at least n occurrences of the expression and at most m occurrences of the expression.
()Permits to group expressions into sub-expressions.
|Alternative. Example: "aaa|bbb" matches the string "aaa" or "bbb".

13.2.2  String substitution

ElementMeaning
&Matched expression
\nsub-expression number n. Example: the regular expression is "(.*):([0-9]*)" matches the string "joe:18". The replacement string "\1 is \2" will produce the result: "joe is 18"

Chapter 14  Code/Test Coverage Level

The menu entry "Instrumentation->Level:x" permits to set the targeted code coverage count or, if the compiled with instrumentation hit support1, the targeted test coverage count.

The level is corresponding of the number of code/test coverage count necessary to consider that an instrumented code is executed.
Example: Setting the level to 10, will made necessary to execute 10 times the each line of the source code if compiled with code coverage count. If compiled with code coverage hit, 10 execution runs need to execute each lines of the source code.


The menu entry "Tools->Test Coverage Count Mode" and the button pictures/testCountMode.png permits to switch between code coverage count and test coverage count analysis. This simulates the behaviour of the compilation with code coverage hit support2 when the project is compiled with code coverage count support3.

Chapter 15  Code Coverage Algorithm

CoverageBrowser displays the code coverage analysis (branch, decision or condition) generated be CoverageScanner. But "Instrumentation->Coverage Method->Branch only" permits to reduce the analysis to the code coverage of branches. This produces the same result as compiling with the --cs-branch of CoverageScanner. "Instrumentation->Coverage Method->Decision, Condition and Branches" permits to show the code coverage analysis at the level defined at the compilation.


Here a short overview of the command line options necessary for each code coverage analysis method:

Coverage analysisCoverageScanner command line option
Branch--cs-branch
Decision with full instrumentation--cs-decision --cs-full-instrumentation
Decision with partial instrumentation--cs-decision
Condition with full instrumentation--cs-full-instrumentation
Condition with partial instrumentation(default)

Chapter 16  Optimized Execution Order

CoverageBrowser is able to calculate an optimized order of the executions (i.e.: the order of tests which permits to maximize the code coverage after each execution). This order is specially adapted to manual testing: following this order permits to execute first the tests which are giving a high code coverage and so detecting rapidly errors in the first test executions.


To calculate the execution order proceed as follows:

  1. Select a set of executions in the "Executions" window.
  2. Click on "Tools->Optimized Execution Order…". The window fig:optimized_execution_order_fig will de display.
pictures/optimized_execution_order_fig.png pictures/manual.tmp019.png
Optimized Execution Order
Optimized Execution Order

Chapter 17  Comparing Code Coverage of Two Software Releases

CoverageBrowser is able to instrumentation database together in order to:

  1. check is the modified/unmodified code is correctly tested.
  2. find which tests are impacted by a source code modification.

This feature is particularly adapted to compare two releases together which contains small modifications (bug fixes only) and to limit the tests of the modified code only.

In this mode CoverageBrowser uses the following typographic rules:

RuleSource WindowMethod ListSource ListExecution List
Normal fontIdentical1 source partIdentical1 methodsIdentical1 filesExecutions available in both releases
Bold Modified methodsModified files 
Bold+UnderlineNew text insertedNew methodsNew filesNew executions
Bold+StrikeDeleted textDeleted methodsDeleted filesMissing executions

CoverageBrowser comparison and difference algorithm is particularly designed for C and C++ source code and ignore white spaces and modifications in comments.

17.1  Reference Database

The reference database is the base instrumentation database which are used for the comparison. To select it click on "Tools->Compare with…" and select a .csmes database. Switching the working database with the reference database can be performed by clicking on "Tools->Switch databases".

Once the reference file loaded, additional filter possibilities are available in the "Executions", the "Sources" and the "Methods" window. This filters permits to show/hide, modified, new, deleted or identical procedures and source files.

The "Executions" window displays a mix between the executions of the reference and the current release:

  • stroked executions are only available in the reference release. The statistic computed is corresponding to the coverage for the reference release. This value can be interpreted as an expected code coverage when this tests get re-executed on the current release.
  • underlined executions are new tests.
  • executions available in both version are not highlighted.

17.2  Coverage analysis of modified/unmodified source code

CoverageBrowser is able to limit the code coverage analysis to the modified (resp. unmodified) functions. When selecting the coverage analysis on the modified (resp. unmodified) functions only, CoverageBrowser treat all unmodified (resp. modified) functions as if they are not instrumented. Limiting the code coverage analysis to modified functions can be a practical way to verify that the new features are tested and to identify the list of tests which have are impacted by a modification.
To limit the code coverage to modified function (resp. unmodified functions) click on "Tools->Analysis of Modified Methods" (resp. "Tools->Analysis on Identical Methods").

Chapter 18  Instrumentation Database

18.1  Merging Instrumentations

Clicking on the menu entry "File->Merge with…" permits to import the executions, the source code and the instrumentations from other .csmes files. Comments and code mark as validated are merged together.

18.2  Importing Unit Tests

Clicking on the menu entry "File->Import Unit Tests…" permits to import the execution report of unit tests into the current application. Only execution reports of source file present into the main application are imported, instrumentation of other source files (for example test code) are ignored.

Chapter 19  Exporting Statistics

This feature is not available for black box testing.

19.1  EMMA-XML Report

Clicking on the menu entry "Reports->Export Statistics in EMMA-XML Format…" permits to export code coverage statistics of in EMMA-XML format. This output format generate only global statistics in a format that is compatible with EMMA. This format allows to use Squish Coco in tools that provide support for EMMA, notably giving an easy way to use Squish Coco with continuous integration servers like Hudson.

EMMA defines only four categories for coverage: classes, methods, blocks, and lines. Due to the fact that blocks does not make sense with Squish Coco, this cathegories have the following meaning:

EMMA categoryMeaning
classesA class is considered executed if one of its method is called. Code which are not in a class are located in the class "" (empty).
methodsA method is covered if it was called.
blocksCode coverage at branch level.
linesLine code coverage. (if compiled with line coverage support)
conditionsDecision/Condition line coverage. (if compiled with Decision/Condition coverage)

19.2  JUnit Report

Clicking on the menu entry "Reports->Export JUnit Report…" permits to export the test result as JUnit report. This report does not contain coverage data and only list the test execution result (passed or failed) for each test item.

19.3  Statistics per Source File

Clicking on the menu entry "Reports->Export Statistics per Source File" permits to export code coverage statistics of each source file in CSV format.

The file contains the coverage of all combination of source files and executions selected and the execution status (see figure fig:statistic_csv_fig). Comma and semi-colon can be selected as separator in the CSV file using the "File Type" input field.

pictures/statistic_csv_fig.png pictures/manual.tmp020.png
Statistics Format - CSV table
Statistics Format - CSV table

19.4  Statistics per Method

Clicking on the menu entry "Reports->Export Statistics per Method" permits to export code coverage statistics of each function and procedure in CSV format.

19.5  HTML/XML Report

Clicking on the menu entry "Reports->Generate Report…" permits to export code coverage statistics (per methods, source files, executions, …) of the selected executions. It permits also to list the manually validated and unexecuted code parts.

19.6  Text Report

Clicking on the menu entry "Reports->Generate Text Report…" permits to generate a small text report in the form of one line per executed/unexecuted item. A distinct line format can be specified for executed or unexecuted lines.

Following keywords are recognized:

%f
Source code file name
%l
Line number
%c
Column number
%m
Explanation

Example: setting the field "Unexecuted Code Fragments" to "%f:%l: %m" will create a text file which contains all unexecuted code parts. Each line will look like as follows:

foo.cpp:55: Unexecuted: 'return;'

Chapter 20  Preferences Dialog

20.1  Save/Load Project

"Save/Restore window position"
If this option is selected, the position of all windows and toolbars will be restored upon application restart.
"Reload automatically the last project"
If this option is selected, the last project opened will automatically be reloaded upon application restart.
"Saves project automatically on exit"
Saves the project file automatically without asking on application exit.

20.2  Comments

"Minimum Comment Size"
The minimum comment size, is the minimum length requested for a comment.
"Do not request a comment when setting an item to the ’manually validated’ state"
This option is used to allow the user to manually modify the state of an instrumentation without entering a comment.
Enabling this option should be avoided because modifying the state of an instrumentation should be performed with a valid reason which should be recorded as a comment.

20.3  Watermarks

Watermarks are trigger values that control the background color of:

  • the instrumented source files in in the "Sources" window.
  • the instrumented classes or namespaces in the "Methods" window.
  • the instrumented functions, methods or procedures in the "Methods" window.


Description:

"Medium/High Coverage Level"
If the statistic is above this value, the background color is set to green. Otherwise, the color is orange.
"Low/Medium Coverage Level"
If the statistic is below this value, the background color is set to red. Otherwise, the color is orange.

20.4  Cache

Description:

"Execution"
Maximum number of executions loaded into the RAM.
"Source"
Maximum number of source files loaded into the RAM.

Chapter 21  Miscellaneous

21.1  Command Line Arguments

Syntax: coveragebrowser -m <csmes_file> -e <csexe_file> ...


Where:

-m <argument> | --csmes=<argument>
Load an instrumentation database.
-e <argument> | --csexe=<argument>
Open the import dialog which permits to load a specified execution report.
This command line argument requires the command line option --csmes.