You need to sign in to do that
Don't have an account?

Code Coverage varies from one environment to another environment
Why Overall code coverage varies from one environment to another environment?
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Why Overall code coverage varies from one environment to another environment?
A simple reason would be because the 2 orgs are not in sync: some test classes are implemented in sandbox, but were not moved to UAT or Prod yet.
More difficult to find would be if your test class relies on data (for example custom settings), which exists in one org but not another.
Lets say org A has a custom settings with data, and org B has the same custom settings with no data. Let's add that a test class relies on data being present for the test class to validate. The test class will fail in org B, and thus impact the code coverage %.
Hope that helps
Nathalie
Thanks for replying Natha.
But my 2 org are in sync and this happens always when we move code from dev to uat or test,Always overall code coverage varies across environment.
Any other help on this?
The varience of the code coverage might be Configuration data from org to org.
Usually the developer environment the code coverage high and accurate (for ex class have 85%)
when you moved to class to package orgs (approximatly the coverage will down to 80) it is due to configurations and data related on the org.
For example you written one SOQL statement to retreive config item, the package org you don't have the configuration where as the config item have in Developer org.
ex code: list<ConfiguartionSettings> lst =[select id,name from configurationsettings where name='testkey'];
if(lst.size()>0)
{
///execute sample code
}
the 'testkey' is created in Developer org but not in Package org, due to these type of configurations and other areas the Code coverage wil show varaience.
Regards,
Satish Kumar