Courseiva

SF-PD2 Testing, Debugging, and Deployment Practice Question

A developer is attempting to debug a failed deployment in a sandbox. The error message is cryptic, and the debug logs are not capturing the expected execution flow. What should the developer do first?

⚠ Common exam trap

Candidates waste time analyzing code syntax immediately instead of checking debug log levels, assuming logs capture everything by default.

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

✓

Increase the debug log level for the user executing the deployment.

Effective debugging starts with ensuring the logging level is correctly configured. If logs are not capturing the flow, it is likely the log level for 'Apex Code' or 'Apex Profiling' is set to 'None' or 'Error'. Increasing the verbosity to 'Fine' or 'Finest' is the standard procedure to gain visibility into the execution path, allowing for the identification of logic errors or incorrect configuration.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Delete the Apex class and re-deploy it.

    Why it's wrong here

    Deleting and re-deploying is a blind, destructive action that does not address the underlying issue. It is ineffective for debugging logic errors. The developer should focus on gathering information through logging and analysis before attempting to modify or redeploy code in a haphazard manner.

  • ✓

    Increase the debug log level for the user executing the deployment.

    Why this is correct

    Increasing the log level is the most effective first step when execution data is missing. By setting the level to 'Fine' or 'Finest', the developer ensures that the platform records the full execution trace, including method calls and database operations, which is essential for diagnosing the deployment failure.

  • ✗

    Refresh the sandbox to clear any corrupted metadata.

    Why it's wrong here

    Refreshing a sandbox is a drastic step that destroys existing development work and is rarely the correct solution for a failed deployment. Metadata corruption is extremely rare; the issue is almost always a logic error or a configuration discrepancy that needs to be diagnosed with proper logging and analysis.

  • ✗

    Open a Salesforce support ticket immediately.

    Why it's wrong here

    Support tickets should be the last resort after exhaustive local debugging. The developer has internal tools like logging and tracing that should be utilized first. Jumping straight to support is inefficient and usually results in requests to perform the very troubleshooting steps the developer should have done initially.

About these practice questions

Courseiva writes every SF-PD2 question from scratch — 226 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.