Practice SALESFORCE-PD1 Testing Debugging And Deployment questions with full explanations on every answer.
Start practicing
Testing Debugging And Deployment — choose a session length
Free · No account required
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 wants to view real-time debug log streaming in their local environment using the Salesforce CLI. Which command should the developer execute?
6A 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?
7A 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?
8A 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?
9A 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?
10A 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?
11A 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?
12A 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?
13A 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?
14A 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?
15A 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?
16A 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?
17Which TWO actions occur automatically when Test.stopTest() is called in an Apex unit test? (Choose two.)
18Which THREE statements are true regarding Salesforce debug logs? (Choose three.)
19Which THREE features are supported in Salesforce scratch orgs? (Choose three.)
20Which TWO circumstances will cause an Apex unit test method to fail? (Choose two.)
21Which TWO practices are considered best practices when writing Apex unit tests in Salesforce? (Choose two.)
22Which THREE items are best practices when setting up test data using @TestSetup methods? (Choose three.)
23Which TWO conditions must be met for an Apex test method to successfully execute and contribute to code coverage? (Choose two.)
24Which TWO tools or APIs can a developer use to deploy metadata between Salesforce organizations? (Choose two.)
25A 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?
26Where should a developer look in the Salesforce user interface to inspect detailed system debug logs generated during a specific transaction?
27An 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?
28An 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?
29A 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?
30When calling Test.startTest() and Test.stopTest(), what happens to the governor limits?
31What is the primary purpose of the Salesforce CLI in a CI/CD pipeline?
32A 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.)
33A developer needs to verify that a trigger correctly handles bulk data, specifically 250 records. What is the most effective approach?
34When deploying code using Unmanaged Change Sets between connected Salesforce organizations, which TWO limitations or behaviors apply? (Choose two.)
35A 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?
36A developer is debugging a process that involves asynchronous Apex. Which Debug Log setting is required to see the output of the @future method?
37Which tool is best suited for migrating metadata between two related Salesforce Orgs using a UI-based approach?
38Which annotation is required for a method to be recognized by the Apex test runner?
39When deploying via Metadata API, what happens if a test class fails during the deployment?
40Which TWO of the following are valid ways to specify which tests to run in the Salesforce CLI?
41Which THREE items are included in a debug log?
42If a developer uses 'SeeAllData=true' in a test class, what are the primary risks?
43Why must you use Test.startTest() when testing asynchronous Apex code?
44A developer needs to see how much memory a specific Apex method is consuming. Which log category should be adjusted?
45What is the primary function of a scratch org?
46When testing a trigger, why should you avoid hard-coding IDs?
47Which utility class is used to assert that code behaves as expected in Apex tests?
48What is the primary benefit of using a Sandbox for development?
49Which TWO features of @isTest(SeeAllData=true) should a developer be aware of?
50Which log level displays the most information?
51A developer needs to check the status of a long-running batch job that was triggered by an Apex class. Where should they look?
52A developer is writing a test for a method that performs a callout. How must the callout be handled?
53Which THREE actions are best practices when deploying Apex classes to production?
54How can a developer inspect the state of a private variable within a class during unit testing?
55When using the Salesforce CLI to deploy, what is the 'check-only' flag used for?
56Which approach is recommended to ensure test data is cleaned up?
57A developer is receiving 'Too many SOQL queries' errors in a trigger. What is the most likely cause?
58A developer needs to measure the performance of a SOQL query. Which log category and level should be used?
59Which TWO of the following are valid ways to trigger an Apex test run?
60What happens if a test class has a method annotated with @testSetup that fails to insert data?
61Which THREE pieces of information are displayed in the Apex Test Execution page?
62What is the primary function of the 'Developer Console'?
63A developer wants to log information specifically when a condition is met. Which method is most appropriate?
64What happens if a developer creates a test method that does not contain any assertions?
65Why should a developer ensure that test classes have at least 75% coverage for production deployment?
66A developer needs to test a feature that relies on the current time. Which method should be used to simulate time?
67Why might a deployment fail due to 'Apex classes do not have sufficient coverage'?
68Which of the following describes the behavior of Test.stopTest()?
69Which THREE things can a developer do with the Salesforce CLI?
70When debugging a trigger, how can you view the flow of execution including entry and exit points of methods?
71What is a 'Change Set' used for?
72How can a developer identify the most time-consuming SOQL query in a transaction?
73What is the primary constraint on using @testSetup?
74Which TWO of the following are valid deployment tools?
75What is the result of a compilation error in an Apex class during deployment?
76Which log level is best for finding logic flow issues without cluttering the log?
77When testing a class that depends on Custom Settings, what is the best practice?
78Why does a test fail if it tries to perform a callout without Test.setMock()?
79Which THREE factors influence deployment success?
80How can you run tests for a specific namespace using the CLI?
81When is an Apex test run automatically executed?
82What is the maximum number of debug logs that can be stored per user?
83What is the purpose of the 'Debug Log' Filter in the Developer Console?
84Which of these is NOT a valid testing best practice?
85A 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?
86You 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?
87A developer needs to reset the governor limits within a test method to verify functionality that processes large amounts of records. Which method should be used?
88When deploying metadata from a sandbox to production using Change Sets, what is the first requirement?
89You are using the Salesforce CLI to deploy code. Which command is used to deploy source code from a local project to an org?
90A developer needs to access private methods in an Apex class for unit testing without making them public. Which annotation is the most appropriate?
91Where can a developer view the generated debug logs for an Apex execution in the Salesforce UI?
92A developer is writing a test class that requires several custom objects to be populated with data. What is the most efficient way to handle this across multiple test methods?
93What is the primary purpose of the 'System.debug()' statement?
94Which of the following is a limitation of Change Sets?
95What must be true for a developer to deploy Apex code to a production environment?
96When testing asynchronous Apex, how do you ensure that the scheduled job has finished before asserting results?
97When using the Metadata API to deploy components, which XML file must be present to define the components included in the package?
98Which tool is best suited for running all tests in an org and viewing the code coverage percentages?
99Which TWO of the following are valid ways to execute Apex unit tests in Salesforce?
100Which THREE of the following are true about Apex test data setup?
101A developer is using 'Test.isRunningTest()' in their production code. Why is this generally considered a poor practice?
102You need to inspect the heap size during the execution of a long-running batch job. Which debug log category should you monitor?
103Which TWO of the following are limitations when deploying using the Metadata API?
104Which THREE of the following items can be viewed in a debug log?
105Which THREE of the following are benefits of using the Salesforce CLI for deployment?
106Which TWO of the following are required to successfully use the 'Test.startTest()' and 'Test.stopTest()' pattern for testing batch Apex?
107Which TWO of the following are true about the 'Debug Log' settings in the Setup menu?
The Testing Debugging And Deployment domain covers the key concepts tested in this area of the SALESFORCE-PD1 exam blueprint published by Salesforce. Courseiva provides free domain-focused practice, mock exams, missed-question review, and readiness tracking across all SALESFORCE-PD1 domains — no account required.
The Courseiva SALESFORCE-PD1 question bank contains 107 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