PHP in Action

Paparrazzi testing

dagfinn | 09 October, 2007 02:15

Uncle Bob (Robert C. Martin) has blogged about testing GUIs (web interfaces, that is; JSP and Rails) without having to run a web server. I don't think it answers all the challenges I'm up against currently, but it inspired me to some heavy thinking about the essential issue of complete and not too cumbersome test covrerage

My conclusion so far is that Uncle Bob's articles is an example of what we may call the paparazzi principle.

Paparazzi try get as close as possible to celebrities they prey upon. The fewer walls or windows between the camera and the victim, the better. Pictures should be as revealing as possible; naked is or half-naked is good.

The paparrazzi principle for web testing is this: run the test from “above” as close as possible to the component you want to test. Inject mock objects from “below” as close as possible to the component you want to test. Even in ordinary unit testing, this can be far from trivial. Where the web interface itself is involved, it is much harder.

It follows that you don't want to use a real web browser or web server unless you must. It also follows that a realtively simplistic web client (SimpleTest's web browser is a good example) without a user interface is preferable to a web browser for human use. Unless you absolutely need it, that is. Therefore, Selenium is probably a step in the wrong direction. I want test tools that enable me to test user interaction without having to fire up these voluminous masses of software.

Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
    blogmarks del.icio.us digg NewsVine Reddit
 
Accessible and Valid XHTML 1.0 Strict and CSS
Powered by LifeType - Design by BalearWeb