SALESFORCE-PD1 Testing Debugging And Deployment Practice Question
A developer needs to write a unit test to verify that a trigger correctly inserts related Task records when a custom object record is created. Which annotation should the developer place on the test class method to ensure it runs correctly and can access existing org data if needed?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
@isTest
The @isTest annotation identifies a method or class as containing unit tests. Using @isTest(SeeAllData=true) is sometimes required when legacy data must be accessed, though best practice is to create test data locally.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
@ReadOnly
Why it's wrong here
@ReadOnly is used on web service methods or batch Apex to restrict DML operations and increase query limits.
- ✗
@TestVisible
Why it's wrong here
@TestVisible allows test methods to access private or protected members of another class.
- ✓
@isTest
Why this is correct
The @isTest annotation is required on test classes and test methods to define them for execution.
- ✗
@TestSetup
Why it's wrong here
@TestSetup is used for creating common test data once for multiple test methods in a class, not for marking the test method itself.
About these practice questions
One of 493 original SALESFORCE-PD1 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed August 2026 · checked against the official Salesforce exam blueprint
This SALESFORCE-PD1 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SALESFORCE-PD1 exam.