Code Coverage Summary and Annotations
If you specify a code coverage tool for a SIL or PIL simulation, the software provides summary data and code annotations with coverage information in the Code view. Each code annotation is associated with a code feature and indicates the nature of the feature coverage during code execution. The Code view also allows you to navigate easily between blocks in your model and the corresponding sections in the source code.
LDRA Tool Suite Coverage
The cumulative coverage data in the Code view is derived from instrumented files associated with your latest top-model simulation and coverage data collected from simulations with other top models that share referenced models with your current top model.
The software provides LDRA tool suite annotations in the Code view to help you to review code coverage.
Note
Do not use the Code view alone to verify that you have achieved your coverage goals. You must refer to the LDRA report.
In the Code view, the color of each bar and annotations shows the amount of coverage of the corresponding line of code or code feature. Green indicates full coverage, yellow indicates partial coverage, and red indicates no coverage.
Place your cursor over the annotation ^b to see a tooltip. the tooltip indicates which branch destinations are covered and which are not covered.
This table describes the LDRA code annotations that you might see in the Code view produced by SIL and PIL simulations.
Code feature | Annotation symbol | What happened during simulation |
---|---|---|
Function | Fcn | Function name returned through this
exit point. |
=> | Function name
never returned through this exit
point. | |
Branch/condition | => | Condition not encountered. |
=>t | Condition evaluated true only. | |
=>f | Condition evaluated false only. | |
tf | Condition evaluated both true and false. | |
Branch/decision | => | Branch never encountered. |
=>b | Branch to at least one destination covered and branch to at least one other destination not covered. | |
b | Branch fully exercised. | |
Modified Condition/Decision Coverage (MC/DC) | =>mc | Condition did not independently affect outcome of decision. |
mc | Condition independently affected outcome of decision. | |
Statement | Statements associated with line covered. | |
Not all statements associated with line covered. | ||
Code that is reformatted by LDRA tool suite
and does not match the original source code. For example, source
code with For detailed coverage information, refer to the LDRA report. | =>Σ | Zero coverage — probes within source code line or files included by source code line not exercised. |
=>Σ | Coverage probes within source code line or any included file partially exercised. | |
Σ | Coverage probes within source code line or included files fully exercised. |
BullseyeCoverage Information
The cumulative coverage data in the Code view is derived from instrumented files associated with your latest top-model simulation and coverage data collected from simulations with other top models that share referenced models with your current top model.
The software provides BullseyeCoverage annotations in the Code view to help you to review code coverage.
In the Code view, the color of each bar and annotations shows the amount of coverage of the corresponding line of code or code feature. Green indicates full coverage, yellow indicates partial coverage, and red indicates no coverage.
This table describes the BullseyeCoverage code annotations that you might see in a code generation report produced by a SIL simulation.
Code feature | Annotation symbol | What happened during simulation |
---|---|---|
Decision | => | Decision not executed. |
TF | Decision evaluated both true and false. | |
=>T | Decision evaluated true only. | |
=>F | Decision evaluated false only. | |
Function | => | Function not called. |
Fcn | Function called. | |
Switch label | => | Switch command not used. |
Sw | Switch command used. | |
Constant | k | Decision or condition was constant, which did not allow any variation in coverage. |
Condition | => | Condition not encountered. |
tf | Condition evaluated both true and false. | |
=>t | Condition evaluated true only. | |
=>f | Condition evaluated false only. | |
Try | => | Try block never completed. |
Try | Try block covered. | |
Catch | => | Catch block not covered. |
Cat | Catch block covered. |