Testing13% of the exam

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.

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

~8 min read · 13 practice questions ·

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

Sandbox default level
Detail
NoTestRun
Production default with Apex
Detail
RunLocalTests
RunSpecifiedTests coverage
Detail
75% for each deployed class and trigger, computed individually, not overall
RunRelevantTests
Detail
Beta; tests chosen from payload analysis; 75% per class and trigger
Coverage rule
Detail
At least 75% overall; every trigger some coverage
Excluded from coverage
Detail
Test classes, lone System.debug() lines, comments
Stale coverage
Detail
Not refreshed until tests rerun
Deployment test runs
Detail
Synchronous and serial; UI runs are parallel
Daily test classes
Detail
Greater of 500 or 10x classes; sandbox 20x
Per-method coverage
Detail
ApexCodeCoverage (Tooling API)
--ignore-errors
Detail
Never against production
Sources for this section (6)
  • 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?

The questions are free to read. Answers with their sources and self-grading are included with the pack.

Keep reading with the Platform Development Lifecycle and Deployment Architect pack

  • Core concepts
  • Exam traps
  • Worked scenario

The pack includes:

  • All 26 lessons of the Platform Development Lifecycle and Deployment Architect guide, with reading progress
  • Interactive decision walks and step-by-step sequence steppers
  • Inline practice questions and one-click topic practice (13 questions for this lesson)
  • An official source cited for every claim
  • An AI tutor that answers from the guide
  • Unlimited timed practice exams

Practice for the Platform Development Lifecycle and Deployment Architect exam