468,469 Members | 1,962 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,469 developers. It's quick & easy.

Code coverage tool

ev
Hello,
We are looking for any testing tool that is capable of checking code
coverage for C,C ++ and Java code. Or at least for C and C++. We want
to know how much (percentage) of our code written on C/C++ is covered
in terms of function calls and line calls. We tried Rational
PureCoverage. It's excellent but has some limitations in our case.
Any idea would be greatly appreciated.
Feb 4 '08 #1
5 4036
On 4 Feb, 03:17, ev <evold...@gmail.comwrote:
Hello,
We are looking for any testing tool that is capable of checking code
coverage for C,C ++ and Java code. Or at least for C and C++. We want
to know how much (percentage) of our code written on C/C++ is covered
in terms of function calls and line calls. We tried Rational
PureCoverage. It's excellent but has some limitations in our case.
Any idea would be greatly appreciated.
I have tried the following:

Cantata++ (www.ipl.com/products)
DevPartner (http://www.compuware.com/products/de...enterprise.htm)

Both worked for me. If you specify, in some more detail, what the
limitations of your case is, I could perhaps provide some more detail
on how well they would work for you.
Feb 4 '08 #2
ev wrote:
Hello,
We are looking for any testing tool that is capable of checking code
coverage for C,C ++ and Java code. Or at least for C and C++. We want
to know how much (percentage) of our code written on C/C++ is covered
in terms of function calls and line calls. We tried Rational
PureCoverage. It's excellent but has some limitations in our case.
Any idea would be greatly appreciated.
Write the tests first, that way nothing gets written that isn't tested.

--
Ian Collins.
Feb 4 '08 #3
On 2008-02-04 06:55:35, Ian Collins wrote:
ev wrote:
>We are looking for any testing tool that is capable of checking code
coverage for C,C ++ and Java code. Or at least for C and C++. We want
to know how much (percentage) of our code written on C/C++ is covered
in terms of function calls and line calls. We tried Rational
PureCoverage. It's excellent but has some limitations in our case. Any
idea would be greatly appreciated.

Write the tests first, that way nothing gets written that isn't tested.
How do you know whether every branch/condition in a function gets executed
when you run the tests that you wrote (independently of whether you wrote
them before or after you wrote the function)?

Gerhard
Feb 4 '08 #4
REH
On Feb 6, 5:21 am, James Kanze <james.ka...@gmail.comwrote:
100% full path coverage probably isn't always possible. But if
a tool reports path coverage, it should be as a per cent of path
coverage.
If you are only look for statement coverage (or even MCDC),
you tool is correct.

And what use is statement coverage? What does knowing that your
tests have exercised 95% of the statements in the code buy you?
Where I work any code that has never been executed is considered a
bomb, and unreachable code is not allowed. What use is it? I'm not
arguing its merits. My customer requires it in safety critical code,
so I do it.

REH
Feb 6 '08 #5
On Feb 6, 3:20 pm, REH <spamj...@stny.rr.comwrote:
On Feb 6, 5:21 am, James Kanze <james.ka...@gmail.comwrote:
100% full path coverage probably isn't always possible. But if
a tool reports path coverage, it should be as a per cent of path
coverage.
If you are only look for statement coverage (or even MCDC),
you tool is correct.
And what use is statement coverage? What does knowing that your
tests have exercised 95% of the statements in the code buy you?
Where I work any code that has never been executed is considered a
bomb, and unreachable code is not allowed. What use is it? I'm not
arguing its merits. My customer requires it in safety critical code,
so I do it.
Any code which has never been executed is a bomb; I'm not
arguing about that. But code which has only been executed with
one set of pre-conditions, but is reachable with a different
set, is also a bomb. 100% statement coverage is a necessary
condition, but it is far from sufficient.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Feb 7 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by John J. Lee | last post: by
6 posts views Thread by tjm | last post: by
4 posts views Thread by O. Zimmermann | last post: by
1 post views Thread by Vinay | last post: by
5 posts views Thread by Nikhil | last post: by
1 post views Thread by =?UTF-8?B?TWFydGluIFDDtnBwaW5n?= | last post: by
7 posts views Thread by Kai Zhu | last post: by
1 post views Thread by Steven W. Orr | last post: by
24 posts views Thread by David | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.