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

How to keep code coverage information accurate for as much of the time as possible?
I want to have accurate code coverage statistics continually, without degrading deployment times (all my deployments are via ANT, not change set). Based on some reading (see links below) I believe that:
- The most accurate code coverage is via manual apex test execution via GUI - but only if previous values are cleared out first
- Eclipse & Developer Console can't be trusted to accurately calculate and update the coverage statistics
- Deployments with runAllTests=true also accurately calculate the coverage statistics - but don't update them
- "Store Only Aggregated Code Coverage" is suggested to run tests faster - but this has no impact on deployment times because of the previous point
And based on this I believe the following is the best I can do:
- After every major deployment (including those with runAllTests=true), clear the code coverage, clear test history and manually run all tests.
- Don't bother setting Store Only Aggregated Code Coverage for deployments with runAllTests=true as this will make no difference to deployment time.
Is my thinking correct?
Reference info:
http://blogs.developerforce.com/developer-relations/2012/11/how-code-coverage-works.html
http://salesforce.stackexchange.com/questions/3689/faster-unit-tests
http://developer.force.com/codeshare/projectpage?id=a063000000EXDULAA5
Thanks for the reply.
It looks like this code uses the Apex Test Runner? According to one of the posts I referenced, this is not considered reliable?
Also am I correct in thinking that coverage isn't updated in the org itself by this code and is only available in an emailed spreadsheet?