The Apex Code Coverage Report in Metazoa Snapshot runs selected Apex tests and shows coverage for Apex classes and triggers, including covered and uncovered executable lines. Use the report to find test gaps before releases, improve test classes, and schedule coverage alerts.
When To Use This Report
- Find untested classes, triggers, or code paths before deployment.
- Measure coverage for a particular group of tests.
- Monitor coverage after nightly snapshots.
- Generate additional test methods with AI.
Unlike Apex Code Quality, this report measures test execution coverage rather than static code quality.
Open The Report
- Right-click a Metadata Snapshot item on the Snapshot desktop.
- Choose Apex Code Coverage Report.
Select Apex Tests
Select one test to run the test and preview the results. Check multiple tests to include the group in Display Report; use Quick Find Apex Tests to narrow the list.
Choose Check All from the list's context menu to include untested classes and triggers. A partial test selection does not provide that complete inventory.
Display Report
This tab combines results for the checked tests. Test rows appear first, followed by class and trigger rows; the bottom summary covers the selected classes and triggers.
Use Failures Only to focus on failing tests, tests that cover nothing, and class coverage. Manage Levels changes the low and high coverage boundaries used by Color Code and conditional scheduled reports, not the execution outcome of a test.
| Column | Description |
|---|---|
| Type | Distinguishes test, class, and trigger rows. |
| Status | Shows execution outcomes for tests and testing status for classes or triggers. |
| Time | Test execution time in milliseconds. |
| Apex Name | The class or trigger exercised by the test. |
| Total Locations | Executable code lines, rather than all physical source lines. |
| Covered / Not Covered | Counts of executable lines covered or not covered by the selected tests. |
| Covered Lines / Not Covered Lines | Line numbers for the corresponding coverage results. |
| Covered % / Not Covered % | Percentages of executable lines. |
| Finding | A result based on testing status and the configured high coverage threshold. |
Click Dashboards to reveal charts grouped by coverage, version, creator, and last modifier. Click Reports to return to tables.
Code Coverage
Select a class or trigger to inspect line-by-line coverage and identify paths needing tests. Gray assets have not been included in the report; gray does not mean untested.
Schedule Report
Configure a timed run for the selected tests when new snapshots become available, such as after a nightly snapshot. Conditional delivery can send a PDF by Email only when Medium Coverage or Low Coverage appears, using the boundaries from Manage Levels. Other destinations include Slack, Content, Chatter, and the Assistant; the Assistant stores the chosen document format as Org Intelligence and replaces the previous recording on each run.
Apex Editing Palette
On Select Apex Tests, click Editing Palette. A developer can use Manual Editing for the selected test, Coverage Improvement for one test, or Multiple Improvements for multiple checked tests.
Code Coverage
In the single-test improvement dialog, this tab shows the tested classes and triggers with the associated Apex code.
Apex Code
Select a prompt and click Submit to generate proposed test code. Original Code and Improved Code appear side by side. Edit Prompts changes the instructions; the coverage prompt asks for missing test cases and additional test methods.
Multiple Improvements also provides a Coverage Improvement prompt, Submit, and original and improved code panes. OK saves changes; Cancel discards changes. A finished improvement operation does not mean deployment has occurred.
What The Results Tell You
- Success, Failure, and Skipped describe test execution. No Result means no test result was returned for that test class during the run.
- Tested means a class or trigger was linked to a passing test. Test Fails indicates a failure association, which can use a test-class-name prefix when failing tests return no coverage. Untested means no passing or failing association was found.
- No Test is the finding for an untested asset. Test Fails takes precedence over coverage findings. Covered means coverage reaches the configured high threshold; a finding beginning with Below includes the unmet high threshold and a percent sign.
- Low Coverage is red at or below the low boundary. Medium Coverage is yellow between the boundaries. High Coverage is green at or above the high boundary.
Failure classifications include Assertion, DML or Validation, Compile, and Other, based on error text. Use Error Messages and Stack Trace to diagnose failures, correct the test, and rerun.
Salesforce requires at least 75% Apex coverage for production deployment. Coverage from selected tests does not establish deployment readiness, complete regression testing, correct business behavior, or whether untested code is unused.
Before deploying, the admin and developer confirm the intended behavior and compare Original Code, Improved Code, and deployment differences. Check assertions, bulk behavior, SOQL, DML, and governor-limit handling rather than accepting a higher percentage alone.
Try The Report
- In a sandbox, select a passing
Example_ClassTestthat leaves an executable branch ofExample_Classuncovered. - Open Display Report. In Manage Levels, place the low boundary below the measured percentage and the high boundary above the measured percentage. Expect Medium Coverage and a finding beginning with Below.
- Schedule a nightly PDF email for medium or low coverage after new snapshots. Retain the first PDF.
- Use Coverage Improvement to add tests for the remaining paths, then follow the deployment review above.
- After deployment and the next scheduled run, compare the same test selection with the retained PDF. Expect Covered when coverage reaches the high threshold; compare covered and uncovered lines to establish which paths changed.
Export Results And Deploy Changes
Right-click a report table to choose Export As CSV, Export As XLSX, Export As PDF, or Export As HTML. Explain Report Table requests an AI explanation.
After saving test edits, Deploy appears. The button saves edits to the current snapshot and opens a deployment dialog. Coverage improvements are not visible until after deployment; rerun the same tests and inspect execution outcomes and line coverage afterward.
Common Questions
Why Are Untested Classes Missing?
Select all Apex tests on the first tab to include untested classes and triggers.
Does Green Coverage Mean A Test Passed?
No. Green means coverage meets the configured high boundary. Check test execution status separately.
Can Snapshot Email Alerts For Low Apex Coverage?
Yes. Use Schedule Report for conditional PDF email delivery when new snapshots report medium or low coverage.
Does Saving An AI Improvement Change Salesforce?
No. Saved edits still require deployment. A subsequent test run establishes whether the proposed code improved coverage.
Related Articles
- Apex Code Quality Report - inspect static code quality findings.
- Impact Analysis Report - examine metadata dependencies before changes.
- Deploy Metadata - compare and deploy metadata changes.
- Take Snapshot - capture or schedule fresh metadata.
- Event Schedule - inspect and test scheduled events.
Further Reading
- Salesforce Org Monitoring - recurring snapshots and conditional alerts.
- Change and Release Management - release preparation and deployment practices.
- Compliance, Governance, Security - monitoring and governance evidence.