Demo Code and Coverage Colors

For the case '\n' statement shown:

Figure 1. Program Memory - Demo Code Example

To see the view, shown in the image above:

In the Program Memory window, you can see the instructions for the else clause and break statement. The compiler has combined the jump back from the function call and the jump out of the case loop into one jump, which associates the break statement with the loop. Therefore it appears yellow since the if statement condition for true was never executed.

As you can see, viewing Program Memory can help you understanding why a line is partially covered (yellow). In general partially-covered lines can be minimized by writing tests to remove red lines (covered by not executed). Then the remaining yellow lines can be examined in assembly in the Program Memory window.