Introduction to code coverage
Reasons for using code coverage
The code coverage functionality is useful when you design your test procedure to verify whether all parts of the code have been executed. It also helps you identify parts of your code that are not reachable.
Briefly about code coverage
The Code Coverage window reports the status of the current code coverage analysis for C or C++ code. For every program, module, and function, the analysis shows the percentage of code that has been executed since code coverage was turned on up to the point where the application has stopped. In addition, all statements that have not been executed are listed. The analysis will continue until turned off.
For debug probes that support it, C-SPY can capture full instruction trace in real time, and process the information for the Code Coverage window.
Note
Assembler code is not covered in the Code Coverage window. To view code coverage for assembler code, use the Disassembly window.
Requirements and restrictions for using code coverage
Code coverage is supported by the C-SPY simulator and there are no specific requirements or restrictions.
To use code coverage in a hardware debugger system, you need an I-jet or I-jet Trace debug probe and a device that supports trace. For information about the different types of trace data and their limitations, see Briefly about trace.