CRT-450 Exam QuestionsBrowse all questions from this exam

CRT-450 Exam - Question 224


A developer completed modifications to a customized feature that is comprised of two elements:

• Apex trigger

• Trigger handler Apex class

What are two factors that the developer must take into account to properly deploy the modification to the production environment? (Choose two.)

Show Answer
Correct Answer: ABD

When deploying Apex code to production, there are two critical factors to consider: First, Apex classes must have at least 75% code coverage org-wide. This ensures that the logic within the classes has been adequately tested and is functioning as expected. Second, test methods should be declared with the testMethod keyword. This declaration ensures that the methods are recognized as test methods by Salesforce, included in code coverage calculations, and executed during deployment validation processes. These requirements help maintain the stability and reliability of the production environment.

Discussion

1 comment
Sign in to comment
semioOptions: AB
Feb 28, 2023

You must have at least 75% of your Apex covered by unit tests to deploy your code to production environments. All triggers must have at least one line of test coverage. We recommend that you have 100% of your code covered by unit tests, where possible.

JackOld17
Aug 13, 2023

With A, I agree, but I think B might be a trap. The wording in the qustion is "At least one line of code must be executed for the Apex trigger," which sets a rule that the test needs to cover at least one line of the trigger. However, in the question, it is formulated as "executing." Therefore, the correct answer to this question might be A and C. But i not sure for 100%

Slovojed
Feb 22, 2024

Not all methods in test class must use "@isTest". You can have a helper method there that is not test method.

GirishN9
Jun 22, 2024

Test methods must be declared with the testMethod keyword: Test methods in test classes must be declared using the testMethod keyword to ensure they are identified as test methods by Salesforce. This ensures that they are included in the code coverage calculations and can be executed as part of the deployment validation process. So, ensuring that the trigger has at least one line of code executed and that test methods are declared using the testMethod keyword are important factors to consider when deploying modifications involving Apex triggers and trigger handler classes.