Re: Code coverage tool
On 2008-02-04 12:39:08 -0500, Erik Wikstr?m <Erik-wikstrom@telia.com> said:
On 2008-02-04 13:32, Gerhard Fiedler wrote:
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)?
Because you write the tests so that all branches will be taken. If you
can not do that it means you are not testing at a low enough level.
Or you changed some code and didn't update the tests, or the tests
missed some subtle condition that the code handles. That's why you do
coverage analysis.
--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)