Courseiva

SALESFORCE-PD1 · domain

Testing Debugging And Deployment

Practise Salesforce Certified Platform Developer I (SALESFORCE-PD1) Testing Debugging And Deployment practice questions — original exam-style scenarios with answer choices, explanations, and analysis of common mistakes.

107 questions24 easy50 medium33 hard

Focused practice

Practice Testing Debugging And Deployment questions

Scored sessions drawing only from this domain — pick a length below.

Start 20-question practice test →

What this domain covers

What to know about Testing Debugging And Deployment

Testing Debugging And Deployment questions test whether you can apply the concept in context, not just recognise a definition.

How the topic appears in realistic exam-style scenarios.

Which detail in the question changes the correct answer.

How to eliminate plausible but wrong options.

How to connect the question back to the wider exam objective.

Watch out for

Common Testing Debugging And Deployment exam traps

  • Answering from memory before reading the full scenario.
  • Missing a constraint such as cost, availability, security, scope or command context.
  • Choosing a broad answer when the question asks for the most specific fix.
  • Ignoring why the wrong options are tempting.

Question index

All Testing Debugging And Deployment questions (107)

Click any question to see the full explanation, or start a practice session above.

1

What must be true for a developer to deploy Apex code to a production environment?

Medium
2

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?

Medium
3

A developer needs to access private methods in an Apex class for unit testing without making them public. Which annotation is the most appropriate?

Medium
4

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?

Medium
5

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

Hard
6

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?

Easy
7

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

Hard
8

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?

Hard
9

A 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?

Medium
10

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

Medium
11

A 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?

Easy
12

Which log level is best for finding logic flow issues without cluttering the log?

Medium
13

What is the primary function of a scratch org?

Medium
14

When is an Apex test run automatically executed?

Hard
15

When debugging a trigger, how can you view the flow of execution including entry and exit points of methods?

Medium
16

A developer is debugging a process that involves asynchronous Apex. Which Debug Log setting is required to see the output of the @future method?

Medium
17

Which TWO conditions must be met for an Apex test method to successfully execute and contribute to code coverage? (Choose two.)

Medium
18

Why might a deployment fail due to 'Apex classes do not have sufficient coverage'?

Hard
19

Which THREE of the following are benefits of using the Salesforce CLI for deployment?

Easy
20

Which TWO tools or APIs can a developer use to deploy metadata between Salesforce organizations? (Choose two.)

Hard
21

A developer needs to test a feature that relies on the current time. Which method should be used to simulate time?

Medium
22

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

Hard
23

Why should a developer ensure that test classes have at least 75% coverage for production deployment?

Medium
24

A 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?

Medium
25

A 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?

Hard
26

When using the Metadata API to deploy components, which XML file must be present to define the components included in the package?

Hard
27

Where should a developer look in the Salesforce user interface to inspect detailed system debug logs generated during a specific transaction?

Easy
28

When calling Test.startTest() and Test.stopTest(), what happens to the governor limits?

Hard
29

Which approach is recommended to ensure test data is cleaned up?

Medium
30

You need to inspect the heap size during the execution of a long-running batch job. Which debug log category should you monitor?

Medium
31

Which TWO of the following are true about the 'Debug Log' settings in the Setup menu?

Hard
32

A developer is writing a test for a method that performs a callout. How must the callout be handled?

Hard
33

Which TWO of the following are limitations when deploying using the Metadata API?

Hard
34

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?

Easy
35

When deploying metadata from a sandbox to production using Change Sets, what is the first requirement?

Easy
36

A 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?

Hard
37

What happens if a developer creates a test method that does not contain any assertions?

Medium
38

Which of the following is a limitation of Change Sets?

Easy
39

A 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?

Medium
40

A developer needs to see how much memory a specific Apex method is consuming. Which log category should be adjusted?

Medium
41

A developer wants to log information specifically when a condition is met. Which method is most appropriate?

Medium
42

A 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?

Easy
43

An 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?

Hard
44

A 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.)

Hard
45

What is the maximum number of debug logs that can be stored per user?

Medium
46

A developer needs to verify that a trigger correctly handles bulk data, specifically 250 records. What is the most effective approach?

Medium
47

Where can a developer view the generated debug logs for an Apex execution in the Salesforce UI?

Easy
48

What is the primary function of the 'Developer Console'?

Easy
49

A developer is receiving 'Too many SOQL queries' errors in a trigger. What is the most likely cause?

Medium
50

Which tool is best suited for migrating metadata between two related Salesforce Orgs using a UI-based approach?

Easy
51

What is the result of a compilation error in an Apex class during deployment?

Easy
52

If a developer uses 'SeeAllData=true' in a test class, what are the primary risks?

Medium
53

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

Medium
54

A 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?

Hard
55

How can a developer identify the most time-consuming SOQL query in a transaction?

Medium
56

What is the purpose of the 'Debug Log' Filter in the Developer Console?

Medium
57

Which TWO actions occur automatically when Test.stopTest() is called in an Apex unit test? (Choose two.)

Easy
58

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

Medium
59

When testing a class that depends on Custom Settings, what is the best practice?

Hard
60

You are using the Salesforce CLI to deploy code. Which command is used to deploy source code from a local project to an org?

Hard
61

Which THREE items are included in a debug log?

Medium
62

Which TWO of the following are valid ways to execute Apex unit tests in Salesforce?

Easy
63

Why does a test fail if it tries to perform a callout without Test.setMock()?

Medium
64

Which THREE of the following items can be viewed in a debug log?

Medium
65

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?

Easy
66

A 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?

Medium
67

What is the primary purpose of the Salesforce CLI in a CI/CD pipeline?

Medium
68

Which THREE actions are best practices when deploying Apex classes to production?

Hard
69

A developer needs to check the status of a long-running batch job that was triggered by an Apex class. Where should they look?

Medium
70

Which TWO practices are considered best practices when writing Apex unit tests in Salesforce? (Choose two.)

Easy
71

What is a 'Change Set' used for?

Easy
72

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

Hard
73

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

Medium
74

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

Medium
75

Which TWO of the following are required to successfully use the 'Test.startTest()' and 'Test.stopTest()' pattern for testing batch Apex?

Hard
76

Which THREE pieces of information are displayed in the Apex Test Execution page?

Medium
77

Which THREE items are best practices when setting up test data using @TestSetup methods? (Choose three.)

Hard
78

Which log level displays the most information?

Easy
79

Which THREE things can a developer do with the Salesforce CLI?

Hard
80

Which tool is best suited for running all tests in an org and viewing the code coverage percentages?

Easy
81

Which of these is NOT a valid testing best practice?

Easy
82

When testing asynchronous Apex, how do you ensure that the scheduled job has finished before asserting results?

Hard
83

What is the primary benefit of using a Sandbox for development?

Medium
84

A 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?

Hard
85

A 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?

Easy
86

A 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?

Medium
87

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?

Medium
88

A developer is using 'Test.isRunningTest()' in their production code. Why is this generally considered a poor practice?

Hard
89

An 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?

Hard
90

Which of the following describes the behavior of Test.stopTest()?

Medium
91

Which TWO features of @isTest(SeeAllData=true) should a developer be aware of?

Medium
92

A 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?

Easy
93

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

Easy
94

How can a developer inspect the state of a private variable within a class during unit testing?

Medium
95

Which TWO of the following are valid ways to trigger an Apex test run?

Medium
96

What is the primary constraint on using @testSetup?

Hard
97

You 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?

Medium
98

What happens if a test class has a method annotated with @testSetup that fails to insert data?

Hard
99

A 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?

Medium
100

When testing a trigger, why should you avoid hard-coding IDs?

Hard
101

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

Easy
102

What is the primary purpose of the 'System.debug()' statement?

Medium
103

Which THREE of the following are true about Apex test data setup?

Medium
104

How can you run tests for a specific namespace using the CLI?

Medium
105

When using the Salesforce CLI to deploy, what is the 'check-only' flag used for?

Hard
106

Which THREE factors influence deployment success?

Hard
107

Which TWO of the following are valid deployment tools?

Medium

Frequently asked questions

What does the Testing Debugging And Deployment domain cover on the SALESFORCE-PD1 exam?
Testing Debugging And Deployment questions test whether you can apply the concept in context, not just recognise a definition.
How many questions are in this domain?
This page lists all 107 Testing Debugging And Deployment questions in the SALESFORCE-PD1 question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
What is the best way to practise this domain?
Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
Can I practise only Testing Debugging And Deployment questions?
Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.
Salesforce Certified Platform Developer I (SALESFORCE-PD1) Testing Debugging And Deployment Practice Questions