Re: code coverage (Clover, Cobertura, that sort of thing)

"Wolfgang Fahl" <[email protected]> Sun, 22 Jun 2008 12:04:59 +0200
Newsgroups gmane.comp.web.httpunit.devel
Organization BITPlan GmbH
Message-ID <[email protected]>
Adam Hardy wrote:
> Sorry, I was not being obvious.
> 
> If Clover or Cobertura tell me how much of my Java code base my JUnit tests 
> cover, what reporting tool tells me how much of my JSP and MVC code base my 
> HttpUnit tests cover?
I don't know of any tool that does this out of the box - 
but it sounds like a graph problem. First you need to 
know what the graph is - what are the nodes (e.g. links) 
reachable from your code. I think this is the harder 
part of the problem since you might want to limit the 
"range" of the graph. In dynamic applications it might 
happen that you have variable parameters and could 
possibly end up with an endless number of nodes - e.g. 
when a customer id is part of a link and in princpiple 
all customer id values lead to pages that are considered 
different by the algorithm.

If you have the graph with all nodes to test things get 
simpler - each HttpUnit test has to mark the node it 
visited. You can then analyze the "code coverage" by 
analyzing how much of the graph has been visited.

So if you are not looking for a general solution but one 
that works for your application things might get 
simpler. The task you are describing could be a nice 
part for the httpunit tutorial showing how test-coverage 
could be followed. We'd  need an example with a not-too 
big graph and then could show how it works.

Yourss
  Wolfgang

BITPlan - smart solutions
Pater-Delp-Str. 1, D-47877 Willich Schiefbahn
Tel. +49 1805 - BITPLAN / +49 1805 248 752, Fax +49 2154 811-481
Web: http://www.bitplan.de
bitplan GmbH, Willich - HRB 6820 Krefeld, VAT-ID: 10258040548, 
Geschäftsführer: Wolfgang Fahl

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

_______________________________________________
Httpunit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/httpunit-develop