By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,125 Members | 1,562 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,125 IT Pros & Developers. It's quick & easy.

Code coverage tool

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.