Cascading Test Sheets
Testing Web pages is a pretty complex task. Very often we settle for too little, checking little more than:
- that our markup validates against the spec
- that a simple link-checker doesn't find dead links
- & that some monkey-testing doesn't turn up any glaring errors
Those are good checks to make, but we need to do a lot better.
I want to make some declarative statements about what is expected of different pages, and have them run routinely. For complicated pages, that depend on user-supplied, database-held or offsite data, I'd like to run the tests on any pages I might ever ship, and give the administrators a decent stab at recreating the error and damn-well fixing it.
Thankfully, the CSS people have done a fine job of allowing you to pick out parts of an HTML document and then apply styles to them. Better yet, we've just about reached the point where smart designers can express what they want in CSS, without needing to write anything terribly complicated.
This is a little idea for how to do that. There's no implementation yet, but I'm looking for feedback on doing it this way. The basic idea is to express some useful, human-level tests in a CSS-like language that make sense to more than code-nerds, and use them to test individual Web pages, or entire sites, and be more confident that they do all that you expect, and nothing that you don't.
Update at 11:03 EDT, 8th April 2009 – Minor tweak to the examples.