User manual
UM0036 STice features
Doc ID 7705 Rev 11 277/385
Caution: Code that is not executed because it is not properly covered in the validation test plan can
be mistaken for dead code. Therefore, when you are running coverage tests to detect dead
code, make sure that the lines that are not executed are not due to an oversight in the test
plan before deleting them.
Data occurrence information can be used to:
● Optimize stack usage, see Monitoring stack space usage on page 279
● Detect that a global variable is located in the wrong memory section, see Optimizing
variables on page 280
Code occurrence information is useful for determining the number of occurrences of an
interrupt routine, see Processing interrupts more efficiently on page 280.
Time profiling is the best method for:
● Detecting and investigating bottlenecks, see Detecting and investigating bottlenecks on
page 280
● Assessing the performance of time-critical code, see Assessing the performance of
time-critical code on page 283
● Evaluate the time required to process an interrupt, see Processing interrupts more
efficiently on page 280
Detecting holes in the validation plan
When you run a test suite to validate an application, you must ensure that it covers all areas
of code. In the results displayed in the Coverage and Profiling Analysis window, the
functions that are not called appear in gray, as shown in Figure 209.
Figure 209. Lines not covered by test suite
In this example, EVENT2 is not processed. The possible causes are:
● EVENT2 is not called by the test suite because it was omitted
● EVENT2 did not occur during the lapse of time during which the test suite was
executed.
By looking at the source code for the test suite, shown in Figure 210, it is obvious that
EVENT2 is taken into account in the test suite. Therefore, the test suite has not been
executed long enough for EVENT2 to occur.
Figure 211 shows the data Coverage and Profiling Analysis window after a longer wait.
The EVENT2 function appears in green.