Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Shlomi Fish (918)

Shlomi Fish
  shlomif@iglu.org.il
http://www.shlomifish.org/
AOL IM: ShlomiFish (Add Buddy, Send Message)
Yahoo! ID: shlomif2 (Add User, Send Message)
Jabber: ShlomiFish@jabber.org

I'm a hacker of Perl, C, Shell, and occasionally other languages. Perl is my favourite language by far. I'm a member of the Israeli Perl Mongers, and contribute to and advocate open-source technologies. Technorati Profile [technorati.com]

Journal of Shlomi Fish (918)

Saturday January 20, 2007
04:46 AM

XML::RSS Update: Full Test Coverage

[ #32214 ]

Read it and weep: XML::RSS now has full test coverage - in the Subversion trunk at least, but coming to a CPAN mirror near you. On the day after my last update, I spent some time increasing the test coverage, and ran into a few dillemas with which I had to consult Ask. He indeed provided some useful advice.

Yesterday (and a bit before) I spent some time on further increasing the test coverage - this time mainly in the parsing stage. I had to modify the core code slightly to allow for better coverage, and to fix some bugs that were caused by that. Here are some things I discovered in the process that may prove useful:

  • It is actually possible to have an XML element of an undefined XML namespace inside a document with a default defined namespace. To do that one can use the attribute xmlns="" on an element.

    XML::RSS had a check for such a case and I needed to verify that it is actually possible.

  • One can update a Devel::Cover database incrementally by using the following pattern:

    # Run the test script.
    # You can also use prove instead of runprove

    HARNESS_PERL_SWITCHES="-MDevel::Cover" runprove --blib t/0.9-strict.t

    # Update the display.

    cover

    From some reason, however, Devel::Cover sometimes forced me to use "cover -delete" and run all the test scripts through it again, but still this pattern can sometimes be a huge time saver.

The script items-are-0.t which I wrote when I started to bug-fix the "values equal 0" bug, and continued to implement various RSS generation tests there, itself yields a total coverage of 88.5%. And it is larger and has more line than the XML::RSS .pm module itself.

I initially wanted to give some statistics about the code and the tests, but I think it would be a waste of time, and you can always calculate them by checking out the code from the repository. Next on my agenda is to refactor the code, fix rt.cpan.org bugs, and possibly also enhance it a bit. XML::RSS uses a lot of hard-coded maps implemented as hash tables and I'd like to make them more customisable.

Cheers everybody!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.