Apex code coverage indicates how many executable lines of the code in your apex classes and apex triggers have been exercised by test methods. To deploy Apex or package to Salesforce AppExchange, test class code must cover at least 75% of your Apex code, and those tests must pass.
In salesforce user interface we can check the organization code coverage for APEX classes by navigating as follows
Setup ==> search ==> Apex Classes ==> Apex Classes Page TAB.
We can also view the code coverage for Apex code under developer console:
There might be business requirement to note down the code coverage for functionality developed using low code tools. Salesforce low code tools development includes Workflows Rules, Process Builders and Flows .To evaluate code coverage for low code tools we can use below set of steps
- Login to salesforce org
- Open developer console from salesforce UI
- Go to the query editor TAB and enable the option ' Use Tooling API ' . This options will allow us to run SOQL queries for objects we want to .
- Run the below query which retrieve rows from sObject schema
The output of the query will be as follows:
The main columns to focus to calculate code coverage are :
NumElementsCovered
NumElementsNotCovered
For Example the query retuned below values for following columns, the code coverage value would be as follows :
Comments
Post a Comment