Salesforce Certified Platform Developer II — Question 37

When testing batch classes, what must a developer do? (Choose two.)

Answer options

Correct answer: B, D

Explanation

The correct answers are B and D. Encapsulating code in Test.startTest() and Test.stopTest() is essential to properly simulate the context for batch processing, while limiting the number of records to less than 200 is necessary to avoid governor limits during testing. Options A and C are not required for testing batch classes; using seeAllData=true is generally discouraged, and calling the 'execute' method directly is not a standard practice in unit tests.