code-coverage

Code coverage targets for APIs

What number would you give someone who wants a concrete target number for API code coverage? UPDATE: To clarify, statement/line code coverage. I realize concrete numbers don't make much sense, but this is for the situation where you tell people that concrete numbers don't make much sense and they still insist on getting a number from yo...

How to identify which lines of code participated in a specific execution of a Java program?

Suppose that I have a Java program within an IDE (Eclipse in this case). Suppose now that I execute the program and at some point terminate it or it ends naturally. Is there a convenient way to determine which lines executed at least once and which ones did not (e.g., exception handling or conditions that weren't reached?) A manual way...

Does C1 code coverage analysis exist for Ruby?

I'm currently using Rcov to get C0 code coverage analysis for a rails project that I'm working on. However, those results are practically meaningless- I have 100% coverage according to rcov (as it only covers C0 analysis) and I've barely written half the test cases for the functionality that exists thus far. I'm used to the useful resu...

EMMA won't cover one of my projects

Hi, I have an issue with EMMA where it is correctly covering all my various Java projects except one. I am puzzled as to why this occurs as the ANT script appears to be correct. The following expected output is given: [echo] c:\cc_local_home\emmadata\ProjectName [instr] processing instrumentation path ... [instr] instrumentation path ...

Integrating command-line generated python .coverage files with PyDev

My build environment is configured to compile, run and create coverage file at the command line (using Ned Batchelder coverage.py tool). I'm using Eclipse with PyDev as my editor, but for practical reasons, it's not possible/convenient for me to convert my whole build environment to Eclipse (and thus generate the coverage data directly...

Automated Dead code detection in native C++ application on Windows?

Background I have an application written in native C++ over the course of several years that is around 60 KLOC. There are many many functions and classes that are dead (probably 10-15% like the similar Unix based question below asked). We recently began doing unit testing on all new code and applying it to modified code whenever possibl...

Setting a Coverage Threshold using Emma and Ant

I'm using Emma in my ant build to perform coverage reporting. For those that have used Emma, is there a way to get the build to fail if the line coverage (or any type of coverage stat) does not meet a particular threshold? e.g. if the line coverage is not 100% ...

Best strategy to get coding prepared for unit testing

I have a solution that is missing a lot of code coverage. I need to refactor this code to decouple to begin to create unit tests. What is the best strategy? I am first thinking that I should push to decouple business logic from data access from businessobjects to first get some organization and then drill down from there. Since many ...

Does Devel::Cover work under mod_perl2 on Perl 5.10 for Windows?

The mod_perl2 and Perl 5.10 two are playing nicely together, but I can't seem to find any positive information about Devel::Cover working with mod_perl2 under Win32. I'm currently using ActiveState's Perl 5.10, but I would be open to switching to Strawberry Perl if it meant this combination could work. Also, Devel::Cover PPDs don't see...

How can I use Mock Objects in my unit tests and still use Code Coverage?

Presently I'm starting to introduce the concept of Mock objects into my Unit Tests. In particular I'm using the Moq framework. However, one of the things I've noticed is that suddenly the classes I'm testing using this framework are showing code coverage of 0%. Now I understand that since I'm just mocking the class, its not running the ...

Code Coverage tools for PHP

Is there any code coverage tool available for PHP? I wish to check the code coverage of my code and API's written in PHP, but have not been able to lay my hands on any code coverage tool for PHP, as it is more of a server side language and dynamic in nature. Does anyone know of a method by which code coverage for PHP can be executed? ...

Code Coverage generic functions/parameters?

I am working on some code coverage for my applications. Now, I know that code coverage is an activity linked to the type of tests that you create and the language for which you wish to do the code coverage. My question is: Is there any possible way to do some generic code coverage? Like in, can we have a set of features/test cases, whic...

code coverage in C

I'm looking to have code coverage in C. I cannot rely on tools like gcov as I am working on different platforms/compilers. Basically I am looking for a strategy to incorporate code coverage into my(own implementation) unit-test framework. ...

Getting PartCover to work

I want to try PartCover for code coverage. I'm running Visual Studio 2008 Professional with MSTest. The Professional Edition does not include the Team Testing tools, like Code Coverage. So, I'm trying PartCover, but I can't get it to work. In the PartCover.Browser I've selected the MSTest executable, I've pointed the working arguments t...

Can my build stipulate that my code coverage never get worse?

I am using hudson CI to manage a straight java web project, using ant to build. I would like to mandate that the unit test coverage never be worse than the previous build, thereby making sure any new code is always tested, or at least the coverage is continually improving. Is there a hudson plugin that works this way? Edit: I am curre...

Javascript function usage

Duplicate of: Are there any good Javascript code coverage tools? Can I find out how often the available JavaScript functions are executed on a page? I have a quite big file with a lot of JS functions and I am not sure if every one of them is really needed. That's what I'd like to find out. ...

MSTest Code Coverage

Is there a way to test code coverage within visual studio if I'm using MSTest? Or do I have to buy NCover? Is the NCover Enterprise worth the money or are the old betas good enough if Microsoft doesn't provide built in tools to do code coverage? EDIT: Description of VS Products and which ones include code coverage http://www.microsoft...

Finding suitable tests for changeset

Dear All, We are using cobertura as code coverage tool. The tests are done using RFT-Rational Functional Tester (500 odd tests). Running RFT takes quite long time. To encourage developers to run the RFT tests, we are thinking of tool that is capable of listing the tests that cover the 'change set'. Approach is roughly:-> On integra...

How do code coverage tools work in different languages?

Most established languages have solid test coverage tools available for them, but the depth of functionality differs significantly from one to another. Also, all the various VMs and compilers have such heterogeneous structure that writing a code coverage tool must be a very different job in C than in Lisp, for example. Python has sys....

C++ code coverage tool running on command line

I use code coverage tool for writing unit testing cases. I have a code coverage tool but only have to do everything through its GUI interface. Ideally I'd like to get a tool that is able to produce a text output (.diff is the best) on individual .cpp files. Does such a tool exist? ...