---
schema_version: "1"
id: e063d70c15a9790044e080820ad4335a8335bb8f606f2bbb15f44c519b27bebb
title: Checking Code Coverage
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/code_dev_console_tests_coverage.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.code_dev_console_tests_coverage.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: bb2ffc0f61ff9036d0b9beb6071fa7a724624dad187c3d336a86e1ce1737e292
description: The Developer Console retrieves and displays code coverage information from your organization. Code coverage results come from any tests you’ve run from an API or from a user interface (for example, the Developer Console, the Salesforce Extensions for Visual Studio Code, or the Application Test Execution page).
products:
  - Salesforce Platform
release: "264"
---
# Checking Code Coverage

The Developer Console retrieves and displays code coverage information from your organization. Code coverage results come from any tests you’ve run from an API or from a user interface (for example, the Developer Console, the Salesforce Extensions for Visual Studio Code, or the Application Test Execution page).

To clear the current results, click **Test** | **Clear Test Data**. When you edit a class, the code coverage for that class is cleared until you run the tests again.

You can view code coverage in several places in the Developer Console.

- The **Tests** tab includes an **Overall Code Coverage** panel that displays the code coverage percentage for every Apex class in your organization that has been included in a test run. It also displays the overall percentage.
- Double-click a completed test run to open a Tests Results view that displays the tested class, the tested method, the duration, result (skip, pass, or fail), and an optional error message. If the test failed, a Stack Trace column shows the method and line number at which the test failed.
- To view line-by-line code coverage for an Apex class, open the class. The Code Coverage menu will include one or more of the following options depending on the tests you have implemented:
    
    - **None**
    - **All Tests**: The percentage of code coverage from all test runs.
    - **className.methodName**: The percentage of code coverage from a method executed during a test run.
    
    Lines of code that are covered by tests are blue. Lines of code that aren’t covered are red. Lines of code that don’t require coverage (for example, curly brackets, comments, and `System.debug` calls) are left white.
    
    ![Code coverage in the Developer Console](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/extend_code/images/code_dev_console_code_coverage.png)

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/images/icon_note.png)

Note When you edit a class with code coverage, the blue and red highlighting in the Source Code Editor dims to indicate that the coverage is no longer valid. When you edit and save a class, the coverage is removed for that class. To check coverage for that class, run the tests again.

#### See Also

- [Create a Test Run](https://help.salesforce.com/s/articleView?id=platform.code_dev_console_test_runs_creating.htm&release=264.0.0&type=5 "A test run is a collection of classes that contain test methods. Set up a test run in the Developer Console to execute the test methods in one or more test classes.")
- [Tests Tab](https://help.salesforce.com/s/articleView?id=platform.code_dev_console_tab_tests.htm&release=264.0.0&type=5 "Use the Developer Console to set up test runs, run tests, and check Apex code coverage.")
- [_Apex Developer Guide_: Code Coverage Best Practices](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_code_coverage_best_pract.htm)