[antlr-interest] Rule coverage testing

Micke Hovmöller micke.hovmoller at gmail.com
Thu Sep 24 05:10:26 PDT 2009


On Mon, Sep 21, 2009 at 5:43 PM, Jim Idle <jimi at temporal-wave.com> wrote:

> On 09/21/2009 08:21 AM, Micke Hovmöller wrote:
> >
> > The coverage report says that my tests cover 2338 of 2966 lines.
> > Unfortunately, I can't find out how to break this down by function.
> Sounds like you need to use a different plugin - the coverage tool for
> netbeans says it is from Netbeans beta. There are quite a number of
> tools but Cobertura seems to be most widely used.
>

I looked at Cobertura. The best reference I found was
http://wiki.netbeans.org/CoberturaAnt, but as that page indicates at the
top, there are a few errors in the description, and I don't know what to do
about them, so I have not got Cobertura up and running, unfortunately. I
find ant files to be quite incomprehensible, in most cases.

Any better pointers for integrating Cobertura with NetBeans will be much
appreciated, but I do realize that we have strayed from ANTLR here, so this
probably isn't the forum for it.

> The parser file is color coded per line, but I can't see the
> > difference between lines counted as whitespace and lines that are not
> > covered but really should be.
>
> No options?
>

Not that I found, but they may be there. As you pointed out, the plugin is
in beta, so maybe not.


> > Also, a large amount of the uncovered lines are exception handling,
> > most of which is automatically generated, and I'm not interested in
> > trying to come up with test cases for that, if that is even possible
> > in every case.
>
> Yes, and no. Exceptions for parsing you want to cover right? People
> forget that a good regression test for a parser is also to test what it
> does with incorrect input - good and expected message vs "Null pointer
> exception at...."
>

In this particular case, I'm parsing poker hand histories, i.e. text files
generated by the poker client. They are correct by definition, so exceptions
only happen when I have problems with my handling of the files.

/Micke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090924/e45854d6/attachment.html 


More information about the antlr-interest mailing list