| || |
Code coverage tool for Webapplication
For an typical web application how do we go about doing a code coverage.
do we require to see what part of the code in the HTML layer is been covered in case we need to do this which tool will help us in doing this .
Or is it only the code coverage for the servlets and other code on the server
Re: Code coverage tool for Webapplication
It is always a good idea to get good test coverage of the servlets etc ..
However ,in a web application this is just the start.
There is a higher risk in web applications than other applications that navigation links will not work as they should.
Assuming that the navigation through the web front end is well documented ,you should be able to abstract the design as a node/arc graph (pages map to nodes ,arcs map to links).
Your test plan should then be designed to include positive tests that cover each node and each arc.
This can result in a large plan ,so judgement is needed to decide what level of coverage to aim for in a particular test run.
Writing negative tests for web front end navigation is more difficult.
Off the top of my head ,typical examples might include testing that pages that should only be shown to certain classes of users are not visible to other classes of users.
However ,that sort of risk is not unique to a web application and is probably in your test plan already.
One of my favourite references for testing is Robert Binder's huge book on OO Testing. Amongst a lot of other good stuff there are sections in that book about writing test plans to cover node/arc graphs. The node arc graphs in the reference are models of the states of an object in a unit test. However ,the technique for covering a node/arc graph in the test plan is what you are after ,and that is the same in any context.
Hope that this helps as a start.
I'd like to here any ideas/opinions from others ,so I hope that this thread continues.