# Apex test levels, coverage and test execution

*Platform Development Lifecycle and Deployment Architect Study Guide · Testing · Last updated October 26, 2026 · https://www.certifyforce.com/study-guide/platform-development-lifecycle-and-deployment-architect/testing/apex-test-levels-coverage-and-test-execution*

Which Apex tests each deployment test level runs, how the 75% coverage rule is calculated and why sandbox and production figures differ, and how to run, schedule and inspect tests with the CLI, the test queue and the Tooling API coverage objects.

- Certification: Salesforce Platform Development Lifecycle and Deployment Architect
- Exam section: Testing
- Study guide: https://www.certifyforce.com/study-guide/platform-development-lifecycle-and-deployment-architect

**Official exam objective:**

> Given a customer testing strategy, describe the appropriate test execution methodology and coverage requirements.

## What the exam expects

- Choose the deployment test level for a sandbox or production deployment, and say which tests each level runs and which coverage check applies.
- Calculate overall coverage after a release, and apply the 75% and every-trigger rules.
- Explain why coverage differs between a sandbox and production, or drops in production over time, and recommend the fix.
- Run and schedule tests at scale: CLI test suites and result formats, the daily test-class limit, Store Only Aggregate Code Coverage, and per-method coverage in the Tooling API.
- Explain why tests stay in the org after go-live and why production deployments never ignore errors.

Key terms: **test level** (which tests a deployment runs), **overall coverage** (covered lines divided by all executable Apex lines in the org), **per-class coverage** (the 75% each deployed class and trigger needs under RunSpecifiedTests), **ApexCodeCoverage** (Tooling API object with covered and uncovered lines per test method), **test suite** (a named set of test classes run together).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Sandbox default level | NoTestRun | [project deploy start](https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_project_deploy_start.html) |
| Production default with Apex | RunLocalTests | [project deploy start](https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_project_deploy_start.html) |
| RunSpecifiedTests coverage | 75% for each deployed class and trigger, computed individually, not overall | [deploy()](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy.htm) |
| RunRelevantTests | Beta; tests chosen from payload analysis; 75% per class and trigger | [deploy()](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy.htm) |
| Coverage rule | At least 75% overall; every trigger some coverage | [Testing in Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_intro.htm) |
| Excluded from coverage | Test classes, lone `System.debug()` lines, comments | [Testing and Code Coverage](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_code_coverage_intro.htm) |
| Stale coverage | Not refreshed until tests rerun | [Coverage Best Practices](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_code_coverage_best_pract.htm) |
| Deployment test runs | Synchronous and serial; UI runs are parallel | [Run Unit Test Methods](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_unit_tests_running.htm) |
| Daily test classes | Greater of 500 or 10x classes; sandbox 20x | [Run Unit Test Methods](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_unit_tests_running.htm) |
| Per-method coverage | ApexCodeCoverage (Tooling API) | [Testing and Code Coverage](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_code_coverage_intro.htm) |
| `--ignore-errors` | Never against production | [project deploy start](https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_project_deploy_start.html) |

## Check yourself

- Why can production coverage drop below 75% months after a successful deployment?
- When do Apex tests run serially rather than in parallel?
- Which test level runs managed package tests?
- Why keep passing tests in production after go-live?

## Sources

- [project deploy start (CLI command reference)](https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_project_deploy_start.html)
- [Code Coverage Best Practices](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_code_coverage_best_pract.htm)
- [Testing and Code Coverage](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_code_coverage_intro.htm)
- [Understanding Testing in Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_intro.htm)
- [Run Unit Test Methods](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_unit_tests_running.htm)
- [Run Apex Tests](https://developer.salesforce.com/docs/platform/sfdx-dev/guide/sfdx-dev-testing.html)
- [apex run test (CLI command reference)](https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_apex_run_test.html)
- [deploy()](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy.htm)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 13 linked practice questions, and unlimited timed mock exams are included with the Platform Development Lifecycle and Deployment Architect pack (USD $19): https://www.certifyforce.com/practice-exams
