Points of Authority

Posted on 27th May 2011

Back in February I did a presentation for the Birmingham Perl Mongers, regarding a chunk of code I had been using to test websites. The code was originally based on simple XHTML validation, using the DTD headers found on each page. I then expanded the code to include pattern matching so I could verify key phrases existed in the pages being tested. After the presentation I received several hints and suggestions, which I've now implemented and have set up a GitHub repository.

Since the talk, I have now started to add some WAI compliance testing. I got frustrated with finding online sites that claimed to be able to validate full websites, but either didn't or charged for the service. There are some downloadable applications, but most require you to have Microsoft Windows installed or again charge for the service. As I already had the bulk of the DTD validation code, it seemed a reasonable step to add the WAI compliance code. There is a considerable way to go before I get all the compliance tests that can be automated written into the distribution, but some of the more immediate tests are now there.

As mentioned in my presentation to Birmingham.pm, I still have not decided on a name. Part of the problem being that the front-end wrapper, Test::XHTML, is written using Test::Builder so you can use it within a standard Perl test suite, while the underlying package, Test::XHTML::Valid uses a rather different approach and does provides a wider API than just validating single pages against a DTD specification. Originally, I had considered these two packages should be two separate releases, but now that I've added the WAI test package, I plan to expose more of the functionality of Test::XHTML::Valid within Test::XHTML. If you have namespace suggestions, please let me know, as I'm not sure Test-XHTML is necessarily suitable.

Ultimately I'm hoping this distribution can provide a more complete validation utility for web developers, which will be free to use and will work cross-platform. For those familiar with the Perl test suite structure, they can use it as such, but as it already has a basic stand-alone script to perform the DTD validation checks, it should be usable from the command-line too.

If this sounds interesting to you, please feel free to fork the GitHub repo and try it out. If you have suggestions for fixes and more tests, you are very welcome to send me pull requests. I'd be most interested in anyone who has the time to add more WAI compliance tests and can provide a better reporting structure, particularly when testing complete websites.

File Under: modules / opensource / perl / technology / testing / usability / web

Ultraviolet (Light My Way)

Posted on 28th February 2011

Last week I gave my first technical talk for several months. Despite being a bit rusty, everyone seemed to find the talk interesting. The talk itself was about code I'd written to test XHTML completeness of web pages and further pattern matching of page content. I've been using and developing the testing code over the last few years, having written the initial basic script, xhtml-valid, back in 2008. Over the last 18 months I have revisited the code and rewritten it into a traditional Perl testing structure. The talk looked at the current state of the code and asked for advice on where to take it next.

The code has developed into two packages, Test::XHTML and Test::XHTML::Valid, and as such the talk naturally fell into two parts, looking at each package in more depth. I had originally planned a demo, but unfortunately my laptop wouldn't talk to the projector, so had to rely on slides alone. This didn't seem to matter too much, as the slides conveyed enough of the API to give a decent flavour of what the packages were about.

The final questions I asked originally centred on where I was thinking of heading with the code base, but I also got asked a few questions regarding the technical aspects. My thanks to Colin Newell and Nick Morrott for giving me some ideas and pointers for further expansion of the code. As for my final questions, it was generally agreed that these should appear on CPAN in some form, and as two separate packages, but unfortunately nobody had a suitable name for either.

I plan to work further on the code, both to package them better and to include the suggestions from Colin and Nick, and then I'll see if anyone has some better suggestions for the names. In the meantime, the slides are now online [1] and the 2008 version 1.00 of the code base is also available [2]. I aim to have the current code base online soon, with a GitHub repo to provide ongoing developments for anyone who might be interested.

[1] http://birmingham.pm.org/talks/barbie/text-xhtml
[2] http://barbie.missbarbell.co.uk/page/code

File Under: opensource / perl / testing

Some Heads Are Gonna Roll

Posted on 11th February 2011

Some time ago I wrote Test-YAML-Meta. At the time the name was given as a compliment to Test-YAML-Valid, which validates YAML files in terms of the formatting, rather than the data. Test-YAML-Meta took that a step further and validated the content data for META.yml files included with CPAN distributions against the evolving CPAN META Specification.

With the release of Parse-CPAN-Meta I wrote Test-CPAN-Meta, which dropped the sometimes complex dependency of the more verbose YAML parsers, for the one that was specifically aimed at CPAN META.yml files. With the emergence of JSON, there was a move to encourage authors to release META.json files too. Although considered a subset of the full YAML specification, JSON has a much better defined structure that has more complete parser support. Coinciding with this move was the desire by David Golden to properly define a specification for the CPAN Meta files. It was agreed that v2.0 of the CPAN Meta Specification should use JSON as the default implementation. As a consequence I then released Test-JSON-Meta.

Although the initial naming structure seemed the right the thing at the time, it is becoming clearer that really the names need to be revised. As such I looking to change two of the distributions to better fit the implementations. So in the coming weeks expect to see some updates. The name changes I'm planning are:

Underneath these current namespaces is the Version module that describes the data structures of the various specifications. In the short term these will also move, but will be replaced by a dependency on the main CPAN-Meta distribution in the future. There will be final releases for Test-YAML-Meta and Test-JSON-Meta, which will act as a wrapper distribution to re-point the respective distributions to their new identities.

File Under: modules / perl / qa / testing

<< Page 1

Some Rights Reserved Unless otherwise expressly stated, all original material of whatever nature created by Barbie and included in the Memories Of A Roadie website and any related pages, including the website's archives, is licensed under a Creative Commons by Attribution Non-Commercial License. If you wish to use material for commercial puposes, please contact me for further assistance regarding commercial licensing.