Courseiva

SF-PD2 Testing, Debugging, and Deployment Practice Question

A developer is preparing to deploy a complex change set from a sandbox to production. The change set includes Apex classes, Visualforce pages, and a new custom object. The developer runs all tests in the sandbox and achieves 100% coverage, but the deployment to production fails with the error: 'Your organization's code coverage is 68%. You need at least 75% coverage to complete this deployment.' What is the most likely cause of this discrepancy?

⚠ Common exam trap

The trap here is assuming that 100% coverage in the sandbox guarantees successful deployment, when actually production's existing code must also be covered to meet the org-wide 75% threshold.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

The production org has existing Apex classes that are not covered by the tests in the change set, lowering the overall coverage.

The deployment failed because Salesforce requires 75% overall code coverage across the entire organization, not just the new code. Production likely contains legacy Apex classes that are not covered by the tests in the change set. To resolve this, the developer must include tests that cover those existing classes or ensure that the deployed tests exercise them.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    The production org has a higher number of asynchronous Apex jobs that interfere with test execution.

    Why it's wrong here

    Asynchronous Apex jobs do not run during deployment tests; Salesforce executes tests synchronously and in isolation. Background jobs do not consume code coverage or interfere with test execution. The coverage calculation is based solely on the Apex code executed during the test run, not on any running asynchronous processes.

  • ✓

    The production org has existing Apex classes that are not covered by the tests in the change set, lowering the overall coverage.

    Why this is correct

    Salesforce calculates code coverage org-wide for deployments. If production already contains Apex classes that are not fully covered by the tests being deployed, the overall coverage can fall below 75%, even if the new code has 100% coverage. The developer must ensure that tests cover existing code as well, or include additional tests in the change set to raise overall coverage.

  • ✗

    The sandbox and production have different API versions, causing the tests to run differently.

    Why it's wrong here

    API version differences can affect behavior, but they do not directly cause code coverage discrepancies. The error explicitly states a coverage shortfall, which is about which lines of code are executed during tests, not about API version mismatches. API versions might influence test outcomes, but the primary issue here is insufficient coverage of existing production code.

  • ✗

    The change set does not include the test classes, so they are not run in production.

    Why it's wrong here

    Change sets can include test classes, but even if they are not included, Salesforce runs all tests in the organization during deployment if no specific tests are specified. The error indicates that tests ran but coverage was insufficient. The absence of test classes in the change set would not prevent tests from running; it would only mean that the developer cannot select specific tests to run.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

One of 226 original SF-PD2 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Salesforce exam blueprint

This SF-PD2 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SF-PD2 exam.