PDI practice question 28 of 30
What are two considerations for deploying from a sandbox to production? Choose 2 answers
Full set: 201 questionsSalesforce enforces strict code coverage requirements for deploying Apex code to a production environment to ensure stability and quality. The platform mandates that a minimum of 75% of the total number of lines of Apex code in the organization (excluding test classes) must be covered by unit tests. Additionally, every Apex trigger in the deployment must have at least some test coverage (greater than 0%). Failure to meet either of these conditions will cause the deployment to fail. These are non-negotiable platform prerequisites for any production deployment containing Apex.
B. While using System.assert methods is a critical best practice to verify code logic, it is not a mandatory platform requirement for deployment. Tests can pass without assertions.
C. This is a business process consideration, not a technical requirement. Best practice is typically to deploy during off-peak hours to minimize disruption to business operations.
1. Salesforce Apex Developer Guide, "Running Unit Test Methods":
"To deploy Apex to a production organization...at least 75% of Apex code must be covered by tests, and all of those tests must pass."
"Every trigger must have some test coverage."
2. Salesforce Apex Developer Guide, "Testing Best Practices":
"Verify the results are correct. Use the System.assertEquals() methods to prove that your code is behaving properly. Although assertions are not required for a test to run or to be deployed, they are critical for verifying the behavior of your code." This confirms that assertions are a best practice, not a deployment requirement.
Keep practicing
Take the free PDI practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other PDI practice questions
- Question 1What can be used to override the Account's standard Edit button for Lightning Experience?
- Question 4Universal Containers (UC) wants to lower its shipping cost while making the shipping proc…
- Question 5A developer has an integer variable called maxAttempts. The developer needs to ensure tha…
- Question 7Universal Containers wants to back up all of the data and attachments in its Salesforce o…
- Question 8Universal Containers hires a developer to build a custom search page to help users find t…
- Question 9As part of new feature development, a developer is asked to build a responsive applicatio…
