Courseiva
Testing Debugging And DeploymenthardMultiple SelectObjective-mapped

SALESFORCE-PD1 Testing Debugging And Deployment Practice Question

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

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Assertions must be placed after the Test.stopTest() call

This pattern is required to force the batch to execute within the test context and ensure it completes before assertions.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The batch class must be implemented in a separate file

    Why it's wrong here

    This is standard for all Apex, not specific to this testing pattern.

  • The test must be annotated with @isTest(SeeAllData=true)

    Why it's wrong here

    SeeAllData is not required for batch testing.

  • The batch class must have a global access modifier

    Why it's wrong here

    Global is not required for standard batches.

  • Assertions must be placed after the Test.stopTest() call

    Why this is correct

    Assertions must wait until the asynchronous work is processed by stopTest.

  • Database.executeBatch must be called between the start and stop methods

    Why this is correct

    This triggers the asynchronous process to be captured by the test framework.

About these practice questions

This SALESFORCE-PD1 question is part of Courseiva's 488-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed August 2026 · checked against the official Salesforce exam blueprint

This SALESFORCE-PD1 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SALESFORCE-PD1 exam.