On Jun 30, 2008, at 11:14 PM, Adam Heath wrote:
David E Jones wrote:
Do you really need a code coverage tool in order to do tests? I
guess I'm not quite sure what you're getting at with this question...
So that you know every branch, every test, every exception block,
every method, is actually being executed.
If you have some if statement, who's true block is never executed,
then how can you be certain whether the condition is specified
correctly?
Since most of ofbiz is loaded thru a custom classloader, it makes it
simple to deal with; For each class in each jar loaded, add the
instrumentation(by use of a temp file). I've got experience with
cobertura, but that's GPL, so not compatible with apache software.
Was this another joke? I'm not getting the punch line...
Thank you for assuming I'm an idiot and don't know what a code
coverage tool is or does. That wasn't my question... my question was:
why do you need one in order to write the tests that were mentioned?
In fact, what does it have to do with it at all?
BTW, just to take this opportunity to slip in my personal opinion:
code coverage tools are of very limited usefulness. They are what
people use when they don't have real requirements or designs to test
against. In essence you toss out all of that and have one requirement
"run every line of code". Even that is a silly one, because running
the same code and going through the same path in the code with
different data can do very different things, and meet (or fail to
meet!) different requirements.
There are quite a few potential tools for testing these things, but
a JUnit class or a Service Engine service run as a test are nice
options.
The version I sent earlier was completely broken. I've since fixed
it, but will run with it a bit more before opening this up thru jira.
Was that a response to what I wrote? I guess not, sounds good though.
-David