nerdexam
SalesforceSalesforce

PDI · Question #103

PDI Question #103: Real Exam Question with Answer & Explanation

The correct answer is A: The deployment fails because the Apr-MgQM has no code coverage.. The deployment will fail because while the overall code coverage is 81%, the Apex trigger itself has 0% coverage, and all triggers require at least 1% coverage for deployment to production.

Submitted by mike_84· Apr 18, 2026Testing, Debugging, and Deployment

Question

A developer created this Apex trigger that calls MyClass,myStartmethod: The developer creates a test method that calls MyClase,myStartmethod directly, resulting in 81% overall code coverage. What happens wtier the developer tries to deploy the ... and two classes to production, assuming no other code exists?

Options

  • AThe deployment fails because the Apr-MgQM has no code coverage.
  • BThe deployment tails because no assertions mett made in the lest method.
  • CThe deployment passes became the Apex code has the requited 75% code coverage.
  • DThe deployment passes because both classes and the trigger were included ki the deployment.

Explanation

The deployment will fail because while the overall code coverage is 81%, the Apex trigger itself has 0% coverage, and all triggers require at least 1% coverage for deployment to production.

Common mistakes.

  • B. While assertions are best practice for robust tests, their absence alone does not necessarily cause deployment failure if the minimum code coverage requirements are met.
  • C. The overall 75% code coverage requirement applies to all deployable Apex code combined, but individual deployable components like triggers also have specific minimum coverage requirements (1%).
  • D. Including classes and triggers in deployment does not bypass the code coverage requirements, which dictate that each trigger must have at least 1% coverage.

Concept tested. Apex code coverage for deployment

Reference. https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_code_test_methods_code_coverage.htm

Topics

#Apex Testing#Code Coverage#Deployment#Apex Triggers

Community Discussion

No community discussion yet for this question.

Full PDI PracticeBrowse All PDI Questions