The Apex coverage results for unit tests in the Force.com IDE and the developer console are very different. I just ran 2 tests in both and got:

test 1
IDE: 75 lines not tests, 68% covered
Developer Console: 52% covered

test 2
IDE: 57 lines not tests, 76% covered
Developer Console: 57% covered

I'm wondering if this is because the developer console is counting blank lines differently (they show up highlighted in red). The IDE seems to have the correct number and I'm also wondering how to get the correct number from the developer console, which is much faster than the IDE for running my tests.

  • See salesforce.stackexchange.com/questions/3689/faster-unit-tests for some good ideas. Dev Console and Apex Test Runner are known to be unreliable. If I need to rely on running tests from UI I make sure to clean old test results (it seems some kind of caching/stalling is at play).
    – eyescream
    Nov 7, 2012 at 23:03
  • Thanks, that's my question also :) They generate the same log, but seem to calculate the percentages differently and would like to find out what that difference is.
    – paul
    Nov 7, 2012 at 23:36
  • I've generally found the only reliable measure of test coverage is the one generated when building a package. All others come up differently. Nov 8, 2012 at 1:26
  • Because life is more fun when things behave differently for unknown reasons? Why else would we be doing Enterprise Dev :) Nov 8, 2012 at 3:47

1 Answer 1


This is a known problem and MVPs like Jeff and Wes have good posts about the same. Here are links for reference:



I think one way is to clear the Test execution history from "Setup > Develop > Apex test execution", and try again. Running all tests might help getting more accurate coverage after cleaning the stale results.

You must log in to answer this question.

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