Salesforce
PDII · Question #204
A developer notices the execution of all the test methods in a class takes a long time to run, due to the initial setup of all the test data that is needed to perform the tests. What should the…
The correct answer is A. Define a method that creates test data and annotate with @testSetup. See the full explanation below for the reasoning.
Question
A developer notices the execution of all the test methods in a class takes a long time to run, due to the initial setup of all the test data that is needed to perform the tests. What should the developer do to speed up test execution?
Options
- ADefine a method that creates test data and annotate with @testSetup
- BReduce the amount of test methods in the class
- CEnsure proper usage of test data factory in all test methods
- DDefine a method that creates test data and annotate with @createData
How the community answered
(36 responses)- A75% (27)
- B8% (3)
- C3% (1)
- D14% (5)
Community Discussion
No community discussion yet for this question.