function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AshanAshan 

Estimate your organization's code coverage

Hi All,

 Is the value of code coverage given by "Estimate your organization's code coverage" represents the complete code coverage of the org ? It seems that percentage shown is only for the classes which have at least more than 0% code coverage.

Thanks

Sridhar BonagiriSridhar Bonagiri

Hi,

 

Estimate your organization's code coverage means , Calculates how much of your organization's Apex code is covered by unit tests. This percentage is based on the latest test results. If none exist, code coverage is listed at 0%. Note: This value may differ from Run All Tests because it excludes code coverage of managed package classes.

 

Regards,

Sridhar Bonagiri

If this post is your solution, kindly mark this as the solution and give Kudos.

AshanAshan

Thanks for the reply Sridhar.

Thats what documentation says. But actualy code coverage percentage in not for the all code in the org. it seems that its calculated for the classes which are accessed by test methods.

Sridhar BonagiriSridhar Bonagiri

Yes you are true it is calculated for the classes which are accessed by test methods or test classes, If you run RunAllTests then you will get the correct organization percentage.

 

Regards,

Sridhar Bonagiri

If this post is your solution, kindly mark this as the solution and give Kudos.

Jeff MayJeff May

And remember, the code coverage is the percent of your total unmanaged code covered by all the tests.  It is not the "average percent" of all the tests.  This means that a large class, with low coverage, cannot be balanced by several small classes with 100% coverage.

AshanAshan

Thanks Jeff for replying,

What you said was what i expected. but actualy its not what happens,

 

for a example i have a large class with no test coverage at all and have some small classes with some coverages.

estimations shows the average only for those small classes.