Salesforce Platform Developer I (legacy) — Question 34

A developer wants multiple test classes to use the same set of test data.
How should the developer create the test data?

Answer options

Correct answer: A

Explanation

The correct answer is A because referencing a test utility class allows multiple test classes to access the same set of data efficiently, promoting reusability. Options B and C do not allow for shared data across classes, as defining variables or creating setup methods would require duplication. Option D is not ideal for maintaining data isolation and can lead to unintended consequences in tests.