← All PD1 Flashcard Decks

Testing and Debugging Flashcards

7 cards from real PD1 practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 7 Testing and Debugging flashcards as text
  1. Which System.assert method should you use when you want to verify that two values are equal and display a custom failure message?

    Answer: System.assertEquals()

    System.assertEquals(expected, actual, message) verifies equality and accepts an optional third parameter for a custom failure message.

  2. What is the effect of calling Test.startTest() in an Apex test method?

    Answer: It opens a new governor limit context for the code under test

    Test.startTest() creates a fresh set of governor limits so the code between startTest/stopTest runs with its own independent limits.

  3. A developer needs to test a trigger that sends an outbound HTTP callout. Which class must be implemented to avoid a 'You have uncommitted work pending' error in the test?

    Answer: HttpCalloutMock

    Implementing HttpCalloutMock and registering it with Test.setMock() allows Apex tests to simulate HTTP responses without making real callouts.

  4. In the Apex debugger, what does the SOQL_EXECUTE_BEGIN log line indicate?

    Answer: A SOQL query is about to be executed

    SOQL_EXECUTE_BEGIN marks the start of a SOQL query execution in the debug log, while SOQL_EXECUTE_END marks its completion.

  5. Which debug log level produces the MOST detailed output and is therefore most useful for tracing complex logic, but also consumes the most storage?

    Answer: FINEST

    FINEST is the most verbose log level in Salesforce, capturing granular detail about code execution at the cost of larger log size.

  6. What happens if a test method contains a DML statement outside of Test.startTest()/Test.stopTest() and the DML count has already reached the limit?

    Answer: A LimitException is thrown, failing the test

    Exceeding any governor limit, including DML statements, causes a LimitException that halts and fails the test method.

  7. A developer sets up test data using @testSetup. Which of the following statements about @testSetup data is TRUE?

    Answer: Each test method gets its own rollback of the setup data after it runs

    @testSetup data is inserted once per class and each test method operates on a clean copy via automatic rollback after each method completes.

How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy

Sources & references

Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy

  1. help.salesforce.com — Test delivery, eligibility, fees, exam format, passing score, retake fee, time limit · verified Oct 2026