New Coverage View in IntelliJ IDEA 11.1
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.
pacm says:
March 30, 2012Will this feature ever make its way to the community edition?
Lance Finney says:
March 30, 2012This is only in the Ultimate Edition, correct?
yole says:
March 30, 2012For now, code coverage is only supported in IntelliJ IDEA Ultimate.
aqapo says:
March 30, 2012Waht about Action Script and FlexCoverage tool?
ksafonov says:
March 30, 2012@aqapo there’s no such functionality at the moment, please submit a feature request at http://youtrack.jetbrains.com/issues/IDEA
Esko Luontola says:
March 31, 2012How 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.
Anna Kozlova says:
March 31, 2012You 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.
nirre says:
July 19, 2012Hi.
I really like the feuture for my spring projects but does it work with Android testing..?
Regards
Niclas
Juan says:
August 21, 2012I 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.
anet says:
August 21, 2012Please 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.
Juan says:
August 22, 2012Thanks! 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.
anet says:
August 22, 2012No, you can choose existing coverage with Analyze|Show Coverage Data
Sabine says:
April 17, 2013Looks 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.
Anna Kozlova says:
April 18, 2013Sabine, 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
Marvin says:
July 17, 2013Hi,
I am currently using the community edition of IntelliJ and using the Spring and Jersey frameworks for a java REST API. My unit tests are in Java. However, my API tests are in ruby since ruby has a lot of good libraries that facilitate navigating a REST API. Long story short, if I upgrade to the Ultimate edition, is there a way to use the code coverage tool for my java code and maintain my REST tests in ruby? Thanks
Andrey Cheptsov says:
July 17, 2013@Marvin, actually IntelliJ IDEA Ultimate provides support for Ruby (via a plugin). At the same time it has Coverage tools for Java. So I think the answer is yes. Let me know if you have other questions.
Anna Kozlova says:
July 18, 2013@Marvin,
if you would start your Ruby tests they won’t trigger coverage instrumentation of your java code -> coverage info for java code won’t be available. On the other hand if your java code works in some J2EE container then with help of IDEA you may get coverage information of your application on server shutdown. So probably some setup would be needed.