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.
Start practicing
Testing Debugging And Deployment — choose a session length
Free · No account required
Domain overview
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.
Exam objectives
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.
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.
Click any question to see the full explanation and answer options, or start a focused practice session above.
A developer wants to test an asynchronous future method. Where must the developer place the asynchronous code execution so that it runs synchronously and within the test context?
2A developer is analyzing a debug log and notices that it is truncated because it exceeded the maximum file size limit. Which action should the developer take to capture only the relevant Apex code execution details without exceeding the limit?
3A developer receives a System.LimitException: Too many SOQL queries: 101 when running a complex unit test. The test class inserts a large volume of test records that inadvertently cause a trigger to execute multiple queries inside a loop. What is the most effective way to reset the governor limits specifically for the code being tested?
4A developer is writing a unit test that executes under a specific user context to verify sharing rules. Which method should the developer use to specify the user for the subsequent test operations?
5A developer is writing a test method that performs a callout to an external REST service. Which interface must the developer implement to provide mock responses during the unit test execution?
6A developer is using Salesforce CLI to create a temporary environment for feature development and testing that includes all source code and shape settings. Which CLI command should the developer use to create this temporary environment?
7A developer is deploying a profile and custom fields using an Unmanaged Change Set. Upon deployment, some custom field permissions fail to apply correctly in production. What is the most likely cause of this behavior?
8A developer has written a Lightning Web Component and Apex controller, and wants to deploy only these specific metadata components to a production org using Salesforce CLI without relying on change sets. Which command is appropriate?
9A developer needs to verify code coverage across an entire Apex organization before deploying code to production. What is the minimum overall Apex code coverage required by Salesforce for production deployment?
10A developer wants to inspect the code coverage of individual classes directly within the Salesforce Developer Console. Under which tab can the developer view this breakdown?
11Which TWO actions occur automatically when Test.stopTest() is called in an Apex unit test? (Choose two.)
12Which TWO practices are considered best practices when writing Apex unit tests in Salesforce? (Choose two.)
13Which THREE items are best practices when setting up test data using @TestSetup methods? (Choose three.)
14Which TWO conditions must be met for an Apex test method to successfully execute and contribute to code coverage? (Choose two.)
15Which TWO tools or APIs can a developer use to deploy metadata between Salesforce organizations? (Choose two.)
16A developer is writing an Apex test class and needs to reset governor limits before executing a block of asynchronous code testing. Which method should the developer use?
17Where should a developer look in the Salesforce user interface to inspect detailed system debug logs generated during a specific transaction?
18An Apex trigger performs a callout to an external web service and a developer is writing a unit test for this trigger. How should the developer handle the callout during the test execution?
19An asynchronous @future method is called from within an Apex test method. When are the statements inside the @future method actually executed during the test run?
20When calling Test.startTest() and Test.stopTest(), what happens to the governor limits?
21What is the primary purpose of the Salesforce CLI in a CI/CD pipeline?
22A developer is troubleshooting a complex set of triggers and wants to restrict the amount of debug log data captured for a specific integration user. Which THREE actions can the developer take to manage debug logs effectively? (Choose three.)
23A developer needs to verify that a trigger correctly handles bulk data, specifically 250 records. What is the most effective approach?
24A developer wants to ensure that specific test data is available to all test methods in a class without recreating it. Which method should be used?
25A developer is debugging a process that involves asynchronous Apex. Which Debug Log setting is required to see the output of the @future method?
26Which tool is best suited for migrating metadata between two related Salesforce Orgs using a UI-based approach?
27Which THREE items are included in a debug log?
28If a developer uses 'SeeAllData=true' in a test class, what are the primary risks?
29A developer needs to see how much memory a specific Apex method is consuming. Which log category should be adjusted?
30What is the primary function of a scratch org?
31When testing a trigger, why should you avoid hard-coding IDs?
32What is the primary benefit of using a Sandbox for development?
33Which TWO features of @isTest(SeeAllData=true) should a developer be aware of?
34Which log level displays the most information?
35A developer needs to check the status of a long-running batch job that was triggered by an Apex class. Where should they look?
36A developer is writing a test for a method that performs a callout. How must the callout be handled?
37Which THREE actions are best practices when deploying Apex classes to production?
38How can a developer inspect the state of a private variable within a class during unit testing?
39When using the Salesforce CLI to deploy, what is the 'check-only' flag used for?
40Which approach is recommended to ensure test data is cleaned up?
41A developer is receiving 'Too many SOQL queries' errors in a trigger. What is the most likely cause?
42Which TWO of the following are valid ways to trigger an Apex test run?
43What happens if a test class has a method annotated with @testSetup that fails to insert data?
44Which THREE pieces of information are displayed in the Apex Test Execution page?
45What is the primary function of the 'Developer Console'?
46A developer wants to log information specifically when a condition is met. Which method is most appropriate?
47What happens if a developer creates a test method that does not contain any assertions?
48Why should a developer ensure that test classes have at least 75% coverage for production deployment?
49Which of the following describes the behavior of Test.stopTest()?
50Which THREE things can a developer do with the Salesforce CLI?
51When debugging a trigger, how can you view the flow of execution including entry and exit points of methods?
52What is a 'Change Set' used for?
53How can a developer identify the most time-consuming SOQL query in a transaction?
54Which TWO of the following are valid deployment tools?
55What is the result of a compilation error in an Apex class during deployment?
56Which log level is best for finding logic flow issues without cluttering the log?
57Why does a test fail if it tries to perform a callout without Test.setMock()?
58Which THREE factors influence deployment success?
59When is an Apex test run automatically executed?
60What is the purpose of the 'Debug Log' Filter in the Developer Console?
61Which of these is NOT a valid testing best practice?
62A developer needs to write a test class for an Apex class that performs DML operations. Which annotation must be used to define the class as a test class?
63You are debugging a performance issue in an Apex trigger. You want to see the database resource usage. Which debug log level should you set for the Database category?
64When deploying metadata from a sandbox to production using Change Sets, what is the first requirement?
65You are using the Salesforce CLI to deploy code. Which command is used to deploy source code from a local project to an org?
66A developer needs to access private methods in an Apex class for unit testing without making them public. Which annotation is the most appropriate?
67What is the primary purpose of the 'System.debug()' statement?
68What must be true for a developer to deploy Apex code to a production environment?
69When testing asynchronous Apex, how do you ensure that the scheduled job has finished before asserting results?
70When using the Metadata API to deploy components, which XML file must be present to define the components included in the package?
71Which THREE of the following are true about Apex test data setup?
72A developer is using 'Test.isRunningTest()' in their production code. Why is this generally considered a poor practice?
73You need to inspect the heap size during the execution of a long-running batch job. Which debug log category should you monitor?
74Which THREE of the following items can be viewed in a debug log?
75Which THREE of the following are benefits of using the Salesforce CLI for 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.
The Courseiva SALESFORCE-PD1 question bank contains 75 questions in the Testing Debugging And Deployment domain. Click any question to see the full explanation and answer breakdown.
Start with a 10-question focused session to identify your baseline accuracy in this domain. Read every explanation — even for questions you answer correctly — to understand the reasoning. Once you score consistently above 80%, move to a 20–30 question session to confirm depth before moving to the next domain.
Yes — the session launcher on this page draws questions exclusively from the Testing Debugging And Deployment domain. Choose 10, 20, 30, or 50 questions for a focused session, or click individual questions to review them one by one.
Save your results, see per-domain analytics, and get readiness scores — free, for every certification.
Sign Up FreeFree forever · Every certification included