For one APEX class there can be multiple test methods. So each test method showing different code coverage using Tooling API.

Is there any way to calculate the code coverage for APEX class including test classes?

  • execute all the test classes from setup->apex test execution->select tests.. and after the completion of all the test execution you can check the code coverage for your class using developer console with red and blue lines. or you can check the total coverage here setup->apex classes-> select you class. you can see the code coverage field with some %
    – Safiya PV
    Apr 12, 2017 at 12:00
  • Thanks @blackPerlSAF , I am using Tooling API object to fetch Apex classes using SOQL in JAVA. Need to develop dynamic program to calculate code coverage for APEX class. Apr 12, 2017 at 13:03

1 Answer 1


Query the ApexCodeCoverageAggregate object to see the aggregated code coverage for your classes and triggers.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .