CRT-450 practice question 16 of 30

Which two events need to happen when deploying to a production org? Choose 2 answers

Full set: 201 questions
Answer options
A: All custom objects must have visibility set to a value other than in Development.
B: All Apex code must have at least 75% test coverage. Correct answer
C: All triggers must have some test coverage Correct answer
D: All Visual flows must have at least 1% test coverage.
Correct Answer:
B. All Apex code must have at least 75% test coverage.; C. All triggers must have some test coverage
Explanation

Salesforce enforces strict testing prerequisites for deploying code to a production environment to maintain system stability and quality. A deployment to a production org will fail if the following conditions are not met:
1. The cumulative Apex code in the org, including the code in the deployment package, must have a minimum of 75% test coverage.
2. Every individual Apex trigger included in the deployment must have some test coverage (i.e., greater than 0%). These are non-negotiable, platform-enforced quality gates for production deployments.

References

1. Salesforce Apex Developer Guide, "Testing and Code Coverage": "To deploy Apex to a production organization... at least 75% of your Apex code must be covered by tests, and all of those tests must pass. In addition, each trigger must have some test coverage." This source directly validates options B and C.

2. Salesforce Help, Article 000384838, "Deploying Apex": This article reiterates the core requirement: "Before you can deploy your code, at least 75% of Apex code must be covered by unit tests, and all of those tests must pass. Also, each trigger must have some test coverage." This confirms B and C as mandatory events.

3. Salesforce Help, Article 000386415, "Test Coverage for Record-Triggered Flows": "To deploy a record-triggered flow that contains a Pause element, the flow must have test coverage." This demonstrates that the test coverage requirement for flows is conditional and not applicable to all flows, thus invalidating option D.

4. Salesforce Metadata API Developer Guide, "deploy() Call", testLevel Enumeration: The documentation for the RunLocalTests value states, "All tests in your org are run, except the ones that originate from installed managed packages... This test level is the default for production deployments that include Apex classes or triggers." This confirms the execution of tests to enforce coverage rules (B and C) during production deployments.

Scroll to Top