Courseiva

SALESFORCE-PD1 · topic practice

Testing Debugging And Deployment practice questions

This domain covers writing Apex unit tests, controlling test data isolation, mocking callouts, and deploying metadata between orgs. Questions present concrete scenarios about test methods, @isTest annotations, Test.startTest/stopTest, HttpCalloutMock, and deployment tools like Change Sets, Metadata API, and Salesforce CLI, asking you to pick the correct behavior or identify a risk.

Courseiva uses original exam-style practice questions designed for learning and revision. The goal is to understand the concepts, recognise exam patterns, and improve through explanations — not memorise copied exam dumps.

Editorial oversight:Johnson Ajibi· MSc IT Security, IEEE Senior Member
20 questionsDomain: Testing Debugging And Deployment

What the exam tests

What to know about Testing Debugging And Deployment

You must be able to write isolated Apex tests that assert results, mock callouts with HttpCalloutMock, share data via @testSetup, and deploy with adequate coverage. The single most important thing is keeping tests data-independent so they pass reliably in any org, including production deployments.

Writing Apex test methods with System.assert, Test.startTest, and Test.stopTest to verify governor limits and asynchronous behavior.

Implementing HttpCalloutMock and Test.setMock to return mock responses for callouts made during unit test execution.

Using @testSetup methods to create shared test records once per class instead of duplicating data in every test method.

Deploying components with Change Sets, Metadata API, Salesforce CLI, or Ant and understanding test coverage requirements for production.

Watch out for

Common Testing Debugging And Deployment exam traps

  • ▸Assuming a test method without assertions still counts toward code coverage; it executes but provides no verification and can hide broken logic.
  • ▸Forgetting Test.setMock before the callout, causing the test to attempt a real HTTP request and fail with a callout exception.
  • ▸Marking tests SeeAllData=true to reach existing records, which couples tests to org data, slows execution, and causes failures in fresh sandboxes.

Practice set

Testing Debugging And Deployment questions

20 questions · select your answer, then reveal the explanation

A developer wants to view real-time debug log streaming in their local environment using the Salesforce CLI. Which command should the developer execute?

A developer has written a test method that requires a large volume of test data to be set up. To avoid writing duplicate data setup code across multiple test methods in the same class, which annotation should the developer use?

A developer needs to write a unit test to verify that a trigger correctly inserts related Task records when a custom object record is created. Which annotation should the developer place on the test class method to ensure it runs correctly and can access existing org data if needed?

A developer is preparing to deploy metadata changes from a sandbox to a production org using Outbound Change Sets. Where must the administrator or developer establish the connection between the two organizations?

A developer runs unit tests in the Developer Console and notices that one test method fails when run as part of the entire test class, but passes successfully when run in isolation. What is the most likely cause of this issue?

A developer is writing a unit test and needs to assert that a specific custom exception was thrown during invalid input processing. Which pattern should the developer use?

Which THREE statements are true regarding Salesforce debug logs? (Choose three.)

Which THREE features are supported in Salesforce scratch orgs? (Choose three.)

Which TWO circumstances will cause an Apex unit test method to fail? (Choose two.)

A developer wants to ensure that test methods in a managed package upgrade test all triggers and classes, and needs to bypass existing organization test data to use only packaged data. Which annotation parameter should be used?

A developer is deploying metadata from a sandbox to a production org using Salesforce CLI. Which command should the developer use to validate the deployment without actually saving components to the target organization?

A developer needs to write a unit test that verifies user permissions and accessibility before executing business logic. Which TWO methods or classes are valid for simulating different user contexts in Apex tests? (Choose two.)

Which annotation allows a private method in an Apex class to be visible to unit test classes for assertion purposes?

When deploying code using Unmanaged Change Sets between connected Salesforce organizations, which TWO limitations or behaviors apply? (Choose two.)

Which annotation is required for a method to be recognized by the Apex test runner?

When deploying via Metadata API, what happens if a test class fails during the deployment?

Which TWO of the following are valid ways to specify which tests to run in the Salesforce CLI?

Why must you use Test.startTest() when testing asynchronous Apex code?

Which utility class is used to assert that code behaves as expected in Apex tests?

A developer needs to measure the performance of a SOQL query. Which log category and level should be used?

Free account

Track your progress over time

Create a free account to save your results and see which topics improve across sessions.

Focused Testing Debugging And Deployment sessions

Start a Testing Debugging And Deployment only practice session

Every question in these sessions is drawn from the Testing Debugging And Deployment domain — nothing else.

Related practice questions

Related SALESFORCE-PD1 topic practice pages

Move into related areas when this topic feels solid.

Frequently asked questions

What does the SALESFORCE-PD1 exam test about Testing Debugging And Deployment?
You must be able to write isolated Apex tests that assert results, mock callouts with HttpCalloutMock, share data via @testSetup, and deploy with adequate coverage. The single most important thing is keeping tests data-independent so they pass reliably in any org, including production deployments.
How should I use these practice questions?
Select your answer before revealing the explanation. Then read why each option is right or wrong — this active recall approach builds retention far faster than re-reading notes.
Can I practise just Testing Debugging And Deployment questions in a focused session?
Yes — the session launcher on this page draws every question from the Testing Debugging And Deployment domain. Use a 10-question session first to gauge your baseline, then move to 20 or 30 once the weak spots are clear.
Where can I practise other SALESFORCE-PD1 topics?
Use the topic links above to move to related areas, or go back to the SALESFORCE-PD1 question bank to see all topics.
Are these real exam questions or dumps?
These are original practice questions written to test the same concepts the SALESFORCE-PD1 exam covers. They are not copied from any real exam or dump site.