Code Coverage Tool

Code Coverage Tool measures C statement coverage in generated code.
Updated 3 Jun 2009

View License

The Code Coverage Tool (CCT) measures C statement coverage in code built as a Real-Time Workshop S-Function. It operates in conjunction with lcc (the C-Compiler that ships with the standard MATLAB installation). CCT inserts instrumentation code into the assembly source generated by lcc during a normal compile. This additional code logs when a line is executed in memory on the PC. When a simulation completes, the line execution counts are sent to the MATLAB base workspace.

A full description of CCT and installation instructions are included in the download. See the file readme.html.

Cite As

Mark Walker (2024). Code Coverage Tool (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2008b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Verification, Validation, and Test in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

cct_setup so build works when there are spaces in the path.
Added the html files in for a typical build.
cct_setup now forces "Generate Report" on, so there is a file to put the coverage in.

Compatibility updates with R2008b and R2009a (HTML formatting and data communication with MATLAB workspace). I have added a makefile so that the compiler interceptor executables can now be built by lcc from the supplied sources.

Main reason is original submission only worked with R2006a. This version contains an installer to allow CCT to work on R2006a and R2006b.

Pre-built files have been added to improve usability also.