Main Content

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.

Code showing LDRA coverage annotations.

Place your cursor over the annotation ^b to see a tooltip. the tooltip indicates which branch destinations are covered and which are not covered.

Code showing LDRA coverage annotations.

This table describes the LDRA code annotations that you might see in the Code view produced by SIL and PIL simulations.

Code featureAnnotation symbolWhat happened during simulation
FunctionFcnFunction name returned through this exit point.
=>Function name never returned through this exit point.
Branch/condition=>Condition not encountered.
=>tCondition evaluated true only.
=>fCondition evaluated false only.
tfCondition evaluated both true and false.
Branch/decision=>Branch never encountered.
=>bBranch to at least one destination covered and branch to at least one other destination not covered.
bBranch fully exercised.
Modified Condition/Decision Coverage (MC/DC)=>mcCondition did not independently affect outcome of decision.
mcCondition 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 #include statements to include other files, and source code with #define statements for macros.

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.

Code showing Bullseye coverage annotations.

This table describes the BullseyeCoverage code annotations that you might see in a code generation report produced by a SIL simulation.

Code featureAnnotation symbolWhat happened during simulation
Decision=>Decision not executed.
TFDecision evaluated both true and false.
=>TDecision evaluated true only.
=>FDecision evaluated false only.
Function=>Function not called.
FcnFunction called.
Switch label=>Switch command not used.
SwSwitch command used.
ConstantkDecision or condition was constant, which did not allow any variation in coverage.
Condition=>Condition not encountered.
tfCondition evaluated both true and false.
=>tCondition evaluated true only.
=>fCondition evaluated false only.
Try=>Try block never completed.
TryTry block covered.
Catch=>Catch block not covered.
CatCatch block covered.

Related Topics