Monday, September 5, 2016

Code Coverage Report

To deploy Apex Class to production, you need to have minimal 75% of overall code coverage. You can check code coverage from Developer Console | Test | New Run and select all Test Classes and Run. Tests tab will tell you all Test Classes completed successfully or failed, you also can drill down to Methods for each Test Class.

Look at "Overall Code Coverage" panel for the Classes, including Percent and Lines coverage.

You also can monitor this from Setup | Develop | Apex Test Execution, or to Run Test by click "Select Tests.." button, but this will not tell you the code coverage percentage.

If you are not using any IDE, you will find percentage coverage in Developer Console only, and you cannot copy and paste it to your team or for documentation, except take screenshots, but when you have too many class, this would be hard.

So, there is a free app from appexchange that can help you to extract this information. The app called Code Coverage Report. This app will not run test class for you, but just to report your last code coverage. The app also allowed you to extract into Excel file easily.

Type: AppExchange (Managed Package)

Paid/Free: Free

PublisherAmit Chaudhary


Version: 1.2

Blog last update: 5 September 2016

No comments:

Post a Comment