PDI · Question #158
What should a developer do to check the code coverage of a class after running all tests?
The correct answer is B. View the Class Test Percentage tab on the Apex Class fist view m Salesforce Setup. After running all tests, a developer can check the code coverage of an Apex class by viewing the 'Percent Covered' column in the Apex Classes list view within Salesforce Setup.
Question
What should a developer do to check the code coverage of a class after running all tests?
Options
- AView the Code Coverage column in the list view on the Apex Classes page.
- BView the Class Test Percentage tab on the Apex Class fist view m Salesforce Setup.
- CView Use cede coverage percentage for the class using the Overall Code Coverage panel in the
- DSelect and run the class on the Apex Test Execution page in the Developer Console.
How the community answered
(32 responses)- A3% (1)
- B88% (28)
- C6% (2)
- D3% (1)
Why each option
After running all tests, a developer can check the code coverage of an Apex class by viewing the 'Percent Covered' column in the Apex Classes list view within Salesforce Setup.
While a code coverage column might exist, the specific 'Percent Covered' column on the Apex Classes page in Setup is the most common and direct method for checking individual class coverage.
The Apex Classes page in Salesforce Setup provides a list view where the 'Percent Covered' column displays the code coverage percentage for each individual Apex class once tests have been executed, offering a direct overview of test coverage.
The phrasing 'View Use cede coverage percentage for the class using the Overall Code Coverage panel in the' is garbled; while the Developer Console does show coverage, choice B describes a more specific and accessible method in Setup.
Selecting and running a class on the Apex Test Execution page executes tests but does not directly display the code coverage; coverage results are viewed separately in the Developer Console's Tests tab or Salesforce Setup.
Concept tested: Checking Apex class code coverage.
Source: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_code_coverage.htm
Topics
Community Discussion
No community discussion yet for this question.