SSZT161 may 2021
As embedded application developers, the last thing you want is for customers to run across latent bugs in your application code – especially when those bugs occur in portions that were not covered by your testing. Measuring code coverage is the only way to proactively prevent this. For developing any application measuring code coverage a good idea. When you start to consider functional safety applications, such as those in industrial and automotive markets, code coverage becomes a requirement.
Dynamic code coverage measures the effectiveness of your code during testing, helping ensure that (ideally) all sections of your code have an associated test. Unexecuted code may be more likely to contain bugs that arise after application deployment.
The TI Arm Clang set of compiler tools for TI Arm® Cortex® microcontrollers includes support for dynamically generated source-based code coverage for embedded applications. TI has implemented this support as a feature of the compiler itself. Unlike what many other vendors offer, these tools provide a level of coverage functionality that is accurate, easy to set up, and free to use. Code coverage can help you ensure the testing of all execution paths within your application, and it can also help you meet functional safety requirements. It is the first free, functional-safety-qualified code coverage tool available.
TI Arm Clang enables you to measure code coverage using the same compiler tools with which you conduct development in five easy steps:
Figure 2 offers a source file view with details about each coverage criterion.
Dynamically generated code coverage can help you produce reliable code by ensuring the sufficient testing of all execution paths throughout your application in order to reduce the chances of lurking defects. You can read more about TI Arm Clang’s support for code coverage in the TI Arm Clang User’s Guide.
While using TI Arm Clang code coverage is straightforward from the command line, the next phase of support is to fully integrate it into the Code Composer Studio integrated development environment (IDE) in order to make the instrumentation, counter retrieval, processing and visualization steps easy to enable and perform.
Start now to see how well your code is covered. Check out this application report to help you leverage TI Arm Clang code coverage within the Code Composer Studio IDE.