PDI · Question #154
What should a developer do to check the code coverage of a class after running all tests?
The correct answer is A. View the code coverage percentage or the class using the Overalll code Coverage panel in the. After running all tests, a developer can check the code coverage of a specific class or the overall coverage by viewing the 'Overall Code Coverage' panel within the Developer Console.
Question
What should a developer do to check the code coverage of a class after running all tests?
Options
- AView the code coverage percentage or the class using the Overalll code Coverage panel in the
- BView the Code Coverage column in the list on the Apex Classes page.
- CSelect and run the class on the Apex est Execution page in the Developer Console.
- DView the Class test Percentage tab on the Apex Class list view in Salesforce Setup.
How the community answered
(50 responses)- A94% (47)
- B2% (1)
- D4% (2)
Why each option
After running all tests, a developer can check the code coverage of a specific class or the overall coverage by viewing the 'Overall Code Coverage' panel within the Developer Console.
The Developer Console provides a dedicated 'Overall Code Coverage' panel, which clearly displays the code coverage percentages for all Apex classes and triggers, and allows developers to inspect line-by-line coverage details for individual classes.
While the Apex Classes page in Setup might show some basic information, the detailed code coverage percentage and line-by-line breakdown are primarily viewed in the Developer Console.
Selecting and running a class on the Apex Test Execution page merely executes the tests; it does not directly display the code coverage results in that specific interface.
There is no 'Class test Percentage tab' on the Apex Class list view in Salesforce Setup for viewing detailed code coverage.
Concept tested: Checking Apex code coverage in Developer Console
Source: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dev_console_code_coverage.htm
Topics
Community Discussion
No community discussion yet for this question.