code-coverage

Coverage not showing executed lines in virtualenv

I have a project and I am trying to run nosetests with coverage. I am running in a virtualenv. When I run $ python setup.py nosetests The tests run fine but coverage is not showing that any code is executed (coverage is all 0%). Name Stmts Exec Cover Missing --------------------------------------...

Is there any way to automatically execute JUnit testcases once with all logging enabled and once with all logging disabled to increase code-coverage and find subtle bugs?

I've found a solution, see my own answer below. Does anyone have a more elegant one? Assume the following class to be tested: public class Foo { private final Logger logger = LoggerFactory.getLogger(Foo.class); public void bar() { String param=[..]; if(logger.isInfoEnabled()) logger.info("A message with paramete...

Exclude code from code coverage with Cobertura

Is there a way to exclude code from inclusion into Cobertura coverage reports? We have some methods that should not be include in the coverage report and therefore not drive down the coverage numbers. I know that Clover has such a functionality, but I have not found anything similar for Cobertura. ...

How do you install and use grails test coverage?

I'm trying to get the grails code coverage plugin to work based on these directions: http://www.grails.org/Test+Code+Coverage+Plugin I did: grails install-plugin code-coverage Then: grails test-app Based on that I expect to see a tests/report/cobertura directory, but I don't see anything inside my project after running "grails test-ap...

Code Coverage Tools for Scala

What are the available code coverage tools for Scala? I have Scala spec tests and a Hudson continuous integration set-up. Is there something I can hook-in to this setup to measure and track code coverage? ...

Code coverage percentage not good

Hello, I have installed on my computer C++Test only with UnitTest license (only Unit Test license) as a Visual Studio 2005 plugin ( cpptest_7.2.11.35_win32_vs2005_plugin.exe ). I have a sample similar to the following: bool MyFunction(... parameters... ) { bool bRet = true; // do something if( some_condition ) { ...

How can I remove/filter/ignore some package from Emma (code coverage)

Hi all... I`m trying to remove some package from my report and having trouble. Could some one give me some help? I'm using EMMA in my ant process. <!-- Generate the emma report both in xml and html --> <emma>   <report     sourcepath="${build.report.src}"     metrics="class:${coverage.classes.min},method:${coverage.methods.min}">  ...

What can be alternative metrics to code coverage?

Code coverage is propably the most controversial code metric. Some say, you have to reach 80% code coverage, other say, it's superficial and does not say anything about your testing quality. (See Jon Limjap's good answer on "What is a reasonable code coverage % for unit tests (and why)?".) People tend to measure everything. They need co...

serverside-javascript code coverage

but most of our javascript code is run serverside and can't be executed in a browser. the ecmascript implementation used is Rhino. i have checked all the javscript coverage tools that where suggested, like the ones here: http://stackoverflow.com/questions/53249/are-there-any-good-javascript-code-coverage-tools the suggested coverage t...

cobertura graph in hudson

is there a way to have the cobertura test coverage graph be shown on the front page of a project, similar to the test trend graph? I'd like to have that displayed next to the coverage graph. Any help would be appreciated. Thanks. ...

Why would I *not* collect code-coverage data in unit tests, in VS2008?

If I'm running a suite of tests, is there a reason I would NOT want to collect code coverage data for the tests? What's the expected cost, in terms of runtime, storage, or anything else? I'm trying to decide if I would ever want to run with code coverage data collection OFF. ...

How to generate an HTML report from PartCover results .xml

How to generate an HTML report from PartCover results .xml ...

How to test a CSS parser?

I'm writing a parser to parse CSS. I started by modifying the CSS reference grammar, to use whichever grammar and lexer syntax are supported by the 3rd-party parser generator tool which I'm using. I think that I've finished coding the grammar: the parser-generator is able now to generate state transition tables for/from my grammar. Th...

How can CruiseControl.Net fail a build based on changing metrics?

I would like CruiseControl.Net to fail a build when some code metrics change in a 'wrong' direction, i.e. code coverage decreases or Gendarme defect count increases. The Gendarme metrics are already tracked in report.xml file (because they are presented on web dashboard graphs), the code coverage is only reported on build status page (an...

How to interpret 'test every scenario you can think of'

I was recently tasked to, "Test every scenario you can think of and try to break the component" What might be sensible in 'everything' when the application is a website? NOTE: This particular site is ASP.NET with MS-SQL, however, I would like to know what would be covered in general as well. Thank you all for the great responses! ...

What is Code Coverage?

Hi there , I have 3 questions : What is CodeCoverage ? What is it good for ? What tools are used for analyzing Code Coverage ? ...

Free Testing / Code Coverage systems for C++

I'd like to start using a Test Driven Development system for a private project since I saw my employer using it and realized it was very useful. My employer's project was in C# but mines are in C and C++. I looked around and saw that several packages exist for both Java and .NET (for example: NCover, NUnit, ...). Unfortunately I found i...

Viewing Code Coverage Results outside of Visual studio

I've got some unit tests, and got some code coverage data. Now, I'd like to be able to view that code coverage data outside of visual studio, say in a web browser. But, when I export the code coverage to an xml file, I can't do anything with it. Are there readers out there for this? Do I have to write an xml parser and then display it ho...

Getting Started with TDD?

We are in the initial phase of trying to implement TDD. I demo'd the Visual Studio Team System code coverage / TDD tools and the team is excited at the possibilities. Currently we use Devpartner for code coverage, but we want to eliminate it because its expensive. We have very limited experience in TDD and want to make sure we don't go a...

Devpartner Instrumentation for Code coverage causing linker errors

So I've got a Visual studio 2005 solution that contains a C# project (test driver - creates exe) and 7 C++ Projects (dll's). This solution builds fine up to this point. I have DevPartner studio 8.2 installed. I am trying to generate test coverage on the entire solution which requires me to instrument native c++ code during builds. when...