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.
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.
What must be true for a developer to deploy Apex code to a production environment?
Medium2A 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?
Medium3A developer needs to access private methods in an Apex class for unit testing without making them public. Which annotation is the most appropriate?
Medium4A 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?
Medium5When deploying via Metadata API, what happens if a test class fails during the deployment?
Hard6A 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?
Easy7Why must you use Test.startTest() when testing asynchronous Apex code?
Hard8A 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?
Hard9A 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?
Medium10Which TWO circumstances will cause an Apex unit test method to fail? (Choose two.)
Medium11A 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?
Easy12Which log level is best for finding logic flow issues without cluttering the log?
Medium13What is the primary function of a scratch org?
Medium14When is an Apex test run automatically executed?
Hard15When debugging a trigger, how can you view the flow of execution including entry and exit points of methods?
Medium16A developer is debugging a process that involves asynchronous Apex. Which Debug Log setting is required to see the output of the @future method?
Medium17Which TWO conditions must be met for an Apex test method to successfully execute and contribute to code coverage? (Choose two.)
Medium18Why might a deployment fail due to 'Apex classes do not have sufficient coverage'?
Hard19Which THREE of the following are benefits of using the Salesforce CLI for deployment?
Easy20Which TWO tools or APIs can a developer use to deploy metadata between Salesforce organizations? (Choose two.)
Hard21A developer needs to test a feature that relies on the current time. Which method should be used to simulate time?
Medium22A developer wants to view real-time debug log streaming in their local environment using the Salesforce CLI. Which command should the developer execute?
Hard23Why should a developer ensure that test classes have at least 75% coverage for production deployment?
Medium24A 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?
Medium25A 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?
Hard26When using the Metadata API to deploy components, which XML file must be present to define the components included in the package?
Hard27Where should a developer look in the Salesforce user interface to inspect detailed system debug logs generated during a specific transaction?
Easy28When calling Test.startTest() and Test.stopTest(), what happens to the governor limits?
Hard29Which approach is recommended to ensure test data is cleaned up?
Medium30You need to inspect the heap size during the execution of a long-running batch job. Which debug log category should you monitor?
Medium31Which TWO of the following are true about the 'Debug Log' settings in the Setup menu?
Hard32A developer is writing a test for a method that performs a callout. How must the callout be handled?
Hard33Which TWO of the following are limitations when deploying using the Metadata API?
Hard34A 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?
Easy35When deploying metadata from a sandbox to production using Change Sets, what is the first requirement?
Easy36A 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?
Hard37What happens if a developer creates a test method that does not contain any assertions?
Medium38Which of the following is a limitation of Change Sets?
Easy39A 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?
Medium40A developer needs to see how much memory a specific Apex method is consuming. Which log category should be adjusted?
Medium41A developer wants to log information specifically when a condition is met. Which method is most appropriate?
Medium42A 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?
Easy43An 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?
Hard44A 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.)
Hard45What is the maximum number of debug logs that can be stored per user?
Medium46A developer needs to verify that a trigger correctly handles bulk data, specifically 250 records. What is the most effective approach?
Medium47Where can a developer view the generated debug logs for an Apex execution in the Salesforce UI?
Easy48What is the primary function of the 'Developer Console'?
Easy49A developer is receiving 'Too many SOQL queries' errors in a trigger. What is the most likely cause?
Medium50Which tool is best suited for migrating metadata between two related Salesforce Orgs using a UI-based approach?
Easy51What is the result of a compilation error in an Apex class during deployment?
Easy52If a developer uses 'SeeAllData=true' in a test class, what are the primary risks?
Medium53Which THREE statements are true regarding Salesforce debug logs? (Choose three.)
Medium54A 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?
Hard55How can a developer identify the most time-consuming SOQL query in a transaction?
Medium56What is the purpose of the 'Debug Log' Filter in the Developer Console?
Medium57Which TWO actions occur automatically when Test.stopTest() is called in an Apex unit test? (Choose two.)
Easy58When deploying code using Unmanaged Change Sets between connected Salesforce organizations, which TWO limitations or behaviors apply? (Choose two.)
Medium59When testing a class that depends on Custom Settings, what is the best practice?
Hard60You are using the Salesforce CLI to deploy code. Which command is used to deploy source code from a local project to an org?
Hard61Which THREE items are included in a debug log?
Medium62Which TWO of the following are valid ways to execute Apex unit tests in Salesforce?
Easy63Why does a test fail if it tries to perform a callout without Test.setMock()?
Medium64Which THREE of the following items can be viewed in a debug log?
Medium65A 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?
Easy66A 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?
Medium67What is the primary purpose of the Salesforce CLI in a CI/CD pipeline?
Medium68Which THREE actions are best practices when deploying Apex classes to production?
Hard69A developer needs to check the status of a long-running batch job that was triggered by an Apex class. Where should they look?
Medium70Which TWO practices are considered best practices when writing Apex unit tests in Salesforce? (Choose two.)
Easy71What is a 'Change Set' used for?
Easy72Which THREE features are supported in Salesforce scratch orgs? (Choose three.)
Hard73Which TWO of the following are valid ways to specify which tests to run in the Salesforce CLI?
Medium74A developer needs to measure the performance of a SOQL query. Which log category and level should be used?
Medium75Which TWO of the following are required to successfully use the 'Test.startTest()' and 'Test.stopTest()' pattern for testing batch Apex?
Hard76Which THREE pieces of information are displayed in the Apex Test Execution page?
Medium77Which THREE items are best practices when setting up test data using @TestSetup methods? (Choose three.)
Hard78Which log level displays the most information?
Easy79Which THREE things can a developer do with the Salesforce CLI?
Hard80Which tool is best suited for running all tests in an org and viewing the code coverage percentages?
Easy81Which of these is NOT a valid testing best practice?
Easy82When testing asynchronous Apex, how do you ensure that the scheduled job has finished before asserting results?
Hard83What is the primary benefit of using a Sandbox for development?
Medium84A 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?
Hard85A 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?
Easy86A 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?
Medium87A 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?
Medium88A developer is using 'Test.isRunningTest()' in their production code. Why is this generally considered a poor practice?
Hard89An 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?
Hard90Which of the following describes the behavior of Test.stopTest()?
Medium91Which TWO features of @isTest(SeeAllData=true) should a developer be aware of?
Medium92A 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?
Easy93Which utility class is used to assert that code behaves as expected in Apex tests?
Easy94How can a developer inspect the state of a private variable within a class during unit testing?
Medium95Which TWO of the following are valid ways to trigger an Apex test run?
Medium96What is the primary constraint on using @testSetup?
Hard97You 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?
Medium98What happens if a test class has a method annotated with @testSetup that fails to insert data?
Hard99A 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?
Medium100When testing a trigger, why should you avoid hard-coding IDs?
Hard101Which annotation is required for a method to be recognized by the Apex test runner?
Easy102What is the primary purpose of the 'System.debug()' statement?
Medium103Which THREE of the following are true about Apex test data setup?
Medium104How can you run tests for a specific namespace using the CLI?
Medium105When using the Salesforce CLI to deploy, what is the 'check-only' flag used for?
Hard106Which THREE factors influence deployment success?
Hard107Which TWO of the following are valid deployment tools?
MediumOther domains
All SALESFORCE-PD1 exam domains
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.