Find your content:

Search form

You are here

Code Coverage on Triggers - color coding


This is probably overly obvious, but I do not wish to assume, and I am finding no reference anywhere:

What does the COLOR CODING when viewing percentage coverage on a Trigger mean? Some code is plain black on white, some is backgrounded with either blue or red.

Since some of the blue refs AND some of the red refs have mention of things that are NOT just my own defined variables, I'm confused as to the implication of the red and blue (my belief ius BLUE is eligible for code coverage/testing, and red is not, or vice versa).

Thanks for any insights.

Screenshot of coloring

Attribution to: AMM

Possible Suggestion/Solution #1

The blue highlight marks lines of code that have been covered (executed) as a result of our test method. The red highlight marks lines that have not been executed.

White lines are excluded from calculations (comments, closing braces etc "unimportant" things Salesforce skips when calculating code coverage).

Attribution to: eyescream
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content