PDI · Question #30
Which two events need to happen when deploying to a production org? Choose 2 answers
The correct answer is A. All triggers must have at least 1% test coverage. B. All Apex code must have at least 75% test coverage. Deployment to a production Salesforce organization requires all Apex code to collectively achieve at least 75% test coverage, and every individual Apex trigger must have at least 1% coverage.
Question
Which two events need to happen when deploying to a production org? Choose 2 answers
Options
- AAll triggers must have at least 1% test coverage.
- BAll Apex code must have at least 75% test coverage.
- CAll triggers must have at least 75% test coverage.
- DAll test and triggers must have at least 75% test coverage combined
How the community answered
(40 responses)- A85% (34)
- C5% (2)
- D10% (4)
Why each option
Deployment to a production Salesforce organization requires all Apex code to collectively achieve at least 75% test coverage, and every individual Apex trigger must have at least 1% coverage.
Every individual Apex trigger must achieve at least 1% test coverage to be successfully deployed to a production environment, ensuring some level of testing for all triggers.
All Apex code (classes and triggers combined) must collectively achieve a minimum of 75% test coverage to be deployed to a production organization, demonstrating sufficient testing of the overall codebase.
While overall code coverage must be 75%, there is no requirement for *each individual trigger* to reach 75% coverage; the specific minimum for individual triggers is 1%.
The requirement is that all *Apex code* (classes and triggers) must have at least 75% test coverage combined, and additionally, each trigger must have 1% coverage, so this option is partially correct but incomplete and slightly ambiguously worded.
Concept tested: Apex Code Deployment Test Coverage Requirements
Source: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_code_test_methods_coverage.htm
Topics
Community Discussion
No community discussion yet for this question.