Salesforce Platform Developer I (legacy) — Question 185

How should a developer avoid hitting the governor limits in test methods?

Answer options

Correct answer: D

Explanation

The correct answer is D because using Test.startTest() allows the test method to reset the governor limits, providing a fresh context for the test execution. Options A, B, and C do not directly address the reset of governor limits; instead, they focus on managing data visibility or loading, which do not prevent hitting the limits themselves.