code-coverage

What's the point of basis path coverage?

The article at onjava seems to imply that basis path coverage is a sufficient substitute for full path coverage, due to some linear-independence/cyclomatic-complexity magic. Using an example similar to the article: public int returnInput(int x, boolean one, boolean two) { int y = x; if(one) { y = x-1; } if(t...

Code coverage for people (manual) tests?

Are there any code coverage tools for manual testing? For example, if I write 30 new lines of code, compile, then run, is there any way to quickly verify that all 30 lines were run? Also, later, after I've checked the code into an official build, is there any way that I can verify that the test department hit on all 30 lines of code ...

MD5 Code Coverage

I'm currently implementing an MD5 hash algorithm based RSA data security code, in the UpdateData method there is a section which reads: mCount[0] += (length << 3); if (mCount[0] < (length << 3)) { mCount[1]++; } I'm trying at the moment to understand how the if statement could ever evaluate to true (the mCount[0] value is initial...

alternatives to NCover?

Having problems with merging multiple ncover reports into one big report, I'm looking for a free alternative to ncover. It should have to possiblity to work with nunit, where nunit is configured to run 2 sets of tests on the same assembly (one set of tests is database independent, the other set requires a configured database). In the en...

Emma Coverage metadata

Hi, I'm trying to understand Emma the code coverage tool and it seems ok till the moment I need the metadata, for example which line exactly is left out or is covered. I need this information for my own application but can't get to it. The xml report doesn't provide it. I would be thankful if anybody can help. ...

Java Code Use Checker

I am working on a library where we want to determine how much of our library is being used. I.E. we want to know how many methods in our library are public, but never being called. Goal: Static Analysis Determine how many lines of code call each public method in package A in the current project. If the number of calls is zero, the metho...

What to test in unit testing, a method or a scenario ?

What to test in unit testing, a method or a scenario? If test each method then minimal test case setup is required. If test a method which calls other methods then setup required for the test case is huge. If unit-tests for the individual methods are already there then why to write for this method which is using them? But then it al...

Why does gcov report 0% coverage on a header file for a well used class?

I'm attempting to measure test coverage for the first time using gcov. Now that I'm past the initial learning curve, things seem to be going well, except for one little snag. I expect that it boils down to a lack of understanding on my part, so I'm hoping someone familiar with gcov can explain what's going on. The issue is that I hav...

Finding which functions are called in a multi-process program without modifying source?

I'm working on a project where I need to find which functions get called in various Linux programs (written in C) given particular inputs. My current approach has been to compile a program with -pg (profiling option), run it, and find which functions get called by processing gprof's output. Only functions that are called at least once ap...

What are some Open Source Java projects with good, fine-grained unit test coverage?

I'm working on a Java decompiler with correctness(*) as a primary design goal. To test it, I'm looking for some Java Open Source projects with fine-grained unit test coverage. These projects can be large or small, but test should exist which cover individual classes or methods. I plan to compile these projects with various compilers/s...

Is there a way to focus lcov code coverage reports to just one or two directories?

I recently started using lcov to visualize my code coverage. It's a great tool. One thing I'm noticing is that it generates code coverage reports for all the files that I'm using - including those that I'm not interested in. For example, it will give me code coverage reports for boost and mysql++ files. Is there an easy way to force ...

Can I restrict nose coverage output to directory (rather than package)?

My SUT looks like: foo.py bar.py tests/__init__.py [empty] tests/foo_tests.py tests/bar_tests.py tests/integration/__init__.py [empty] tests/integration/foo_tests.py tests/integration/bar_tests.py When I run nosetests --with-coverage, I get details for all sorts of modules that I'd rather ignore. But I can't use the --cover-package=P...

Should one test internal implementation, or only test public behaviour?

Given software where ... The system consists of a few subsystems Each subsystem consists of a few components Each component is implemented using many classes ... I like to write automated tests of each subsystem or component. I don't write a test for each internal class of a component (except inasmuch as each class contributes to th...

Compiler generated code in code coverage

I am using Intel code coverage tools on Linux using g++ compiler. For a particular class, the coverage tool shows 2/3 extra functions than those actually present in source code. What are these extra functions? Are they compiler generated functions? I am excluding header files from code coverage. My classes are simple with empty ctor an...

Is there a code covearge tool that works with manual testing?

In php, is there a tool that can generate a code coverage report without using automated unit test cases ? (basically not using phpunit or similar unit testing frameworks which do a good job generating the report but require unit testcases to be written in php!). Exactly what I am looking for, is a tool that would generate me a code co...

I know I may not write production code until I have written a failing unit test, so can I tell my manager I cannot write UIs?

I've been using TDD for server-side development. I'm not really sure if the benefits of having all of my production code surrounded by unit tests outweigh the disadvantage of spending 4x more time than needed on refactoring. But when I'm developing UI code, I simply cannot apply TDD. To all fundamentalists out there, the first law of TD...

Emma doesn't embed source code to html report

Hello, I have a problem with Ant and Emma a code coverage plugin, it makes report, but without source code. I got following code in my build.xml init emma <taskdef resource="emma_ant.properties" /> <path id="run.classpath"> <pathelement location="${instr}" /> <path refid="build.classpath"/> <pat...

NCover on 64 bit - CorFlags fix - corflags : error CF008 : The specified file does not have a valid managed header

I'm trying to apply a fix to allow NCover v1.5.5 to run on Windows Server 2008 X64 via my TeamCity Continuous Integration server as outlined on this blog: http://abdullin.com/journal/2008/6/6/how-to-run-free-ncover-on-a-64-bit-machine.html Here is my log: [09:47:04]: run-unit-tests: [09:47:04]: [echo] Running NCover: tools\ncover\NCov...

Real time code coverage viewer tool for inspecting live Java apps?

I've been looking for a code coverage viewer aimed at inspecting live Java applications, mostly webapps running inside an application container like Tomcat. Sure, there are a number of decent tools for getting automatic reports of unit test coverage, but my aim is more like learning in real time what an unfamiliar Java app does e.g. on a...

Should I Use a Code Coverage Tool?

I'm interested in using a code coverage tool for my next .NET project but was wondering if it is necessary for me? I'm the only developer in the company I work for, so would using NCover be a benefit to me or is it just for large teams using continuous integration? Thanks ...