What must be true for a developer to deploy Apex code to a production environment?
Deploying Apex code to a production environment is strictly governed by Salesforce platform constraints designed to maintain baseline software quality. Specifically, the deployment engine enforces a hard requirement that all local unit tests must execute successfully without failure, alongside a mandatory aggregate code coverage threshold of at least 75% across all custom Apex classes and triggers. If either of these validation criteria fails during the deployment request, the entire transaction is automatically rolled back by the metadata service.
Why this answer
Deploying Apex to production requires that all tests in the org pass and that overall Apex code coverage is at least 75%. Salesforce enforces this at deployment time; if any test fails or coverage falls below the threshold, the deployment is rejected. Coverage is calculated across all Apex classes and triggers in the org, not just the newly deployed code.
Exam trap
The trap is the specific number — candidates often confuse the 75% org-wide minimum with a per-class requirement or mistakenly believe 100% coverage is mandated for production deployments.
How to eliminate wrong answers
Option A is wrong because 100% coverage is not required — the platform enforces a 75% minimum, and demanding 100% would be an unrealistic and incorrect standard. Option B is wrong because tests are always run during production deployments regardless of sandbox testing; sandbox results do not carry over. Option C is wrong because coverage is measured org-wide, not just on new classes — existing classes with low coverage can drag the overall percentage below 75% and block deployment.