New Coverage View in IntelliJ IDEA 11.1

March 30th, 2012 by Anna Kozlova

IntelliJ IDEA 11.1 introduces a new way of browsing the gathered coverage information through a dedicated Coverage View.

This view aggregates the coverage details over a configured scope in one place. It provides ability to sort data by coverage percentage, what can be used for detection of code which is not enough covered by tests.

As always quick navigation, scroll from/to source, flatten packages mode are available in Coverage View for an easy work with the results. It also allows generating HTML report right from the view.

Please note, that the view is also available for Python, Ruby and PHP coverage plugins.

The new feature is already available in IntelliJ IDEA 11.1 released a few days ago. We appreciate any feedback. Please don’t hesitate to submit any found issues to our tracker.

Tags: , , ,

14 Responses to “New Coverage View in IntelliJ IDEA 11.1”

  1. pacm Says:

    Will this feature ever make its way to the community edition?

  2. Lance Finney Says:

    This is only in the Ultimate Edition, correct?

  3. yole Says:

    For now, code coverage is only supported in IntelliJ IDEA Ultimate.

  4. aqapo Says:

    Waht about Action Script and FlexCoverage tool?

  5. ksafonov Says:

    @aqapo there’s no such functionality at the moment, please submit a feature request at http://youtrack.jetbrains.com/issues/IDEA

  6. Esko Luontola Says:

    How can I prevent that tab from showing up? I run my tests many times per minute and always use code coverage, so that tab shows up needlessly to waste screen estate. It also grabs the focus away from the editor, requiring me to press ESC when my tests finish running, interrupting my flow when navigating the code.

  7. Anna Kozlova Says:

    You may disable “Activate coverage view” checkbox in the File|Settings|Coverage settings. It should not grab focus anyway (only if scroll from source mode is enabled), will recheck. Thanks.

  8. nirre Says:

    Hi.

    I really like the feuture for my spring projects but does it work with Android testing..?

    Regards
    Niclas

  9. Juan Says:

    I have the ultimate edition (11.1) and I’m unable to see code coverage results. It does not seem to be working. I looked for the coverage view in View -> Tool windows and it’s not there. I do not see results in the project view either.

  10. anet Says:

    Please ensure that you have Coverage plugin enabled. In order to see coverage you need to “run with coverage”. When you do so, Coverage View would be activated.

  11. Juan Says:

    Thanks! I missed the run with coverage button.

    I still find the UI a bit confusing, if you close the coverage view (using the (X) not the hide ->| button) coverage highlight is hidden from the editor and View -> Tool Windows -> Coverage becomes disabled. You can only re-enable it by re-running all tests.

  12. anet Says:

    No, you can choose existing coverage with Analyze|Show Coverage Data

  13. Sabine Says:

    Looks nice, but how Do actually find those methods which are not covered?
    So far it’s pretty useless, I know I’m missing tests, I want to choose a method and either get a list of tests existing for that function or the option to create a new test method in an existing Test.

    Create Tests only works wants unless you want a mess of Test files.

  14. Anna Kozlova Says:

    Sabine, it’s possible to sort columns by %, so you are able to detect where you have uncovered methods. In order to get information about tests covering current line you need to configure coverage to trace and track coverage per test. Then in the editor gutter you’ll be able to click on the coverage color and get action to list all tests covering current line. There is no action to create a new test in one of the existing test case and frankly saying I don’t see how it should be presented - you may have tousends of tests, what tests to suggest? Ones which cover sibling methods but this won’t work for util classes. If you have an idea how this could work for you, please share your usecases. Thanks

Leave a Reply