Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

code coverage of a javascript file

47 views
Skip to first unread message

trf

unread,
Mar 15, 2008, 5:14:03 PM3/15/08
to
Hi

We use a server side scripting framework that embeds Rhino for
processing javascript files. One thing that elludes us is a method to
test our code efficiently, partially because the script files have a
lot of server side dependencies, making unit tests hard. As a result
we have functional tests for the resultant output but limited insight
onto the effeciveness of the test.

I'm sure this has been asked of before but how conceptually difficult
would it be to write some kind of code coverage tool around Rhino ? If
we ran a functional test which invoked the server side javascript
components some kind of report as to which paths through the script(s)
were followed (or not) would be immensely useful. Any pointers ?
Should I give up now ? :-)

thanks

Tim

Norris Boyd

unread,
Mar 15, 2008, 5:41:48 PM3/15/08
to

When rhino compiles to class files it can optionally generate line
debugging information in the class file. I've never attempted it, but
it would be worth a try to use a standard Java code coverage tool when
running with those class files.

--N

Ed

unread,
Mar 16, 2008, 12:01:23 PM3/16/08
to

You might want to look at the program I wrote for measuring JavaScript
code coverage:

http://siliconforks.com/jscoverage/

Note that it is designed for measuring coverage in client-side browser
scripts, so you would have to do some tinkering to get it to work with a
server-side Rhino framework.

0 new messages