Refresh and Show coloring Code Coverage data

There are three additional options at the top of the Code Coverage panel.

Options of the Code Coverage

  • Refresh — it allows you to refresh the code coverage results — they can be not accurate if you changed the code and made a new test run. Clicking this button is not doing a re-run of all your tests, nor it is doing any static analysis to figure out how much of the code would be covered. It is merely providing a visualization of the coverage based on the most recent runs of each Apex test.
  • Show Coloring — it turns on highlighting within the code: green color marks a covered code, and red color marks an uncovered code. Also, you will see the notification that this coloring can be not actual if you changed the code. The highlighting colors are default but you are able to customize them as you want. Go the Options Menu: Main Menu ⇒ Tools ⇒ Options… ⇒ Fonts and Colors:
    • Code coverage - covered line — it allows you to set the highlighting of the covered lines in the code: foreground, background, font, and size,
    • Code coverage - uncovered line — it allows you to set the highlighting of the uncovered lines in the code.

Code Coverage by Classes

In the message bar, that is located in the upper part of the code editor, you can see a drop-down with the list of unit tests that are covering code in the opened file. Also here you can find the information about code coverage percentage that is provided by each of the unit tests. If you need to see the code coverage coloring by unit test, just select the unit test in the dropdown and the editor will show you appropriate highlighting.

  • Export to CSV — it helps you to export the code coverage data to a .csv file.

In this section:

This also may be useful:

Last modified: 2017/10/23 14:26

footer image