code-coverage

What techniques have you actually used successfully to improve code coverage?

I regularly achieve 100% coverage of libraries using TDD, but not always, and there always seem to be parts of applications left over that are untested and uncovered. Then there are the cases when you start with legacy code that has very few tests and very little coverage. Please say what your situation is and what has worked that at ...

Code coverage tools for VS 2008

We're getting our feet wet with unit testing in VS 2008 Professional Edition and have hit what might be a pretty large snag: there appears to be no way to determine code coverage in this particular VS edition. It seems that this is something only available in VS Team System Development Edition. In other words, VS 2008 Professional Editi...

Code Coverage and Blame

Has anyone seen a tool that will integrate code coverage results with SCM/VCS to attribute untested lines of code to developers? For example, is there a tool that will take NCover's Coverage.Xml, combine it with SVN blame, and produce a report that tells me things like developer who commits most untested code? ...

What is the code-coverage percentage on your project?

What is the % code-coverage on your project? I'm curious as to reasons why. Is the dev team happy with it? If not, what stands in the way from increasing it? Stuart Halloway is one whose projects aim for 100% (or else the build breaks!). Is anyone at that level? We are at a painful 25% but aspire to 80-90% for new code. We have leg...

Cobertura refuses to acknowledge code was covered

I am using the Maven (2) Cobertura plug-in to create reports on code coverage, and I have the following stub I am using in a method: try { System.exit(0); } catch (final SecurityException exception) { exception.printStackTrace(); } System.err.println("The program never exited!"); I know that I need to log the exception, etc, b...

How to get Cobertura to fail M2 build for low code coverage

I'm trying to configure my WAR project build to fail if the line or branch coverage is below given thresholds. I've been using the configuration provided on page 455 of the excellent book Java Power Tools, but with no success. Here's the relevant snippet of my project's Maven 2 POM: <build> ... <plugins> <plugin> <groupId>org.code...

Creating test run configurations in VS 2008

I am working with an n-tiered architecture in Visual Studio 2008 (Developer Edition), and I have run into an issue. We are running unit tests on every method of our services layer, and I am attempting to see the code coverage results, to ensure I'm hitting all the main paths through my methods. When I attempt to view the results, I am ...

How can I unit test a GUI?

The calculations in my code are well-tested, but because there is so much GUI code, my overall code coverage is lower than I'd like. Are there any guidelines on unit-testing GUI code? Does it even make sense? For example, there are graphs in my app. I haven't been able to figure out how to automate the testing of the graphs. It takes a ...

Code Coverage on Visual Studio Team System 2008 Developer Edition (on an NUnit application)

Is this possible? I am looking forward to a tutorial which explains the steps to achieve this. ...

What are some code coverage tools for Perl?

Are there any good (and preferably free) code coverage tools out there for Perl? ...

NCover on 64-bit system

What do you suggest to use for code coverage on 64-bit environment. It seems that NCover supports 64-bit only in Enterprise version which seems to be quite expensive. Or isn't it? What are people using on 64-bit systems for .NET code coverage? EDIT: I am aware of the CorFlag workaround. I would like to know what others are doing/using. ...

Is mutation testing useful in practice?

It exists the technology of mutation testing. It checks, if the tests are running even if you change the code. If not all is OK, if the tests are running they don't cover all eventualities. There is some theoretical work about it, but I'm interested in the question, if it is useful in practice? Do you have any examples of real life appli...

Eclipse plugin for TestNG coverage

Does anybody know about a Eclipse plug-in to analyze code coverage for TestNG unit tests? Matthias Zerau ...

VS2008 Code Coverage - can't find "not covered blocks"

I'm running VS2008's Code Coverage against a unit-tested DLL that I'm developing. For some of the functions it claims that 2 blocks are not covered and 50 or so are. When I view the function with the VS2008 highlighting it can't find the uncovered blocks. The highlighting appears to work with some functions though as it correctly shows ...

How far do you take code coverage?

I've recently started using code coverage tools (particularily Emma and EclEmma), and I really like the view that it gives me as to the completeness of my unit tests - and the ability to see what areas of the code my unit tests aren't hitting at all. I currently work in an organization that doesn't do a lot of unit testing, and I plan on...

Getting ClassFormatError with EMMA?

I'm trying to generate code coverage reports with EMMA using tests of which some use JMockit as a mocking framework. For the most part, it works, but a few of my tests crash with a ClassFormatError, like so: java.lang.ClassFormatError at sun.instrument.InstrumentationImpl.redefineClasses0(Native Method) at sun.instrument.Instrum...

EMMA coverage tool not displaying line-by-line coverage

I am using the EMMA tool for code coverage yet despite my best efforts, EMMA is refusing to see the original .java files and generate coverage on a line-by-line basis. We are using ANT to build the code and debug is set to true. I know that EMMA is measuring coverage as the .emma files seem to be generating and merging correctly. The re...

100% Code Coverage with logging code?

After writing new methods and unit tests for them I usually check the code coverage using the Agitar Eclipse plugin. But additionally to business logic there's a lot of logging code like: if(log.isDebugEnabled()) { log.debug("Angela Merkel is REALLY hot!"); } When Agitar checks this code, it (of course) complains about the fact, that...

Code Coverage and Unit Testing of Python Code

I have already visited Preferred Python unit-testing framework. I am not just looking at Python Unit Testing Framework, but also code coverage with respect to unit tests. So far I have only come across coverage.py. Is there any better option? An interesting option for me is to integrate cpython, unit testing of Python code and code cove...

Code Coverage for C#/.net

I wonder what options there are for .net (or C# specifically) Code Coverage, especially in the Lower Priced segment? NCover Seems to be very popular and looks quite good. Supports statement coverage and branch coverage. $299 for the 64-Bit Version. Older Beta-Versions available for free. Visual Studio (2008 Pro) | (2005 Team System (...