Using Web APIs to Monitor and Test Groupware Applications

In Chapter 12, we built an access-control mechanism with some fairly complex logic. To read a record in the docbase, a user has to authenticate, pass a group membership test, and finally pass a subscription test—that is, the company that’s the subject of a requested report has to be among the feeds to which the user subscribes. Testing this kind of application is a tedious affair. To do it properly, you have to pretend to be a series of different users—one who fails authentication and one who passes, one who fails group membership and one who passes, one who uses basic authentication and one who accepts cookies. The combinations add up quickly, and it’s time-consuming to run through them all. Once the application is deployed, you can let the users be the canaries in the coal mine, sounding the alarm when things go wrong. That’s standard procedure for many web applications but far from satisfactory. All too often, people who run into problems don’t report them. And really, why should they have to? The systems you build ought to monitor themselves. That sounds like a tall order, but in fact it’s easier than you might think. The reason is that HTML-based software is inherently testable in ways that GUI software is not.

“On the Internet, nobody knows you’re a dog.” So went the caption of an oft-cited cartoon that depicted a dog sitting in front of a browser. More to the point here, an Internet application doesn’t know the ...

Get Practical Internet Groupware now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.