Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Creating a co-operative framework for testing

by Anonymous Monk
on Oct 27, 2006 at 20:02 UTC ( [id://581008]=note: print w/replies, xml ) Need Help??


in reply to Creating a co-operative framework for testing

I addressed this a bit in my YAPC talk this year, "The Reluctant Web Tester". I worked1 at Yahoo! Global Search at the time; most of Yahoo!'s web development is in PHP (Rasmus himself works for us), and there's a lot of time pressure to get features in and get bugs fixed fast. Developers tend to not have a lot of spare cycles.

PHP itself has a pretty decent testing package, but it's more like Test::Class than Test::More: you create a class to do the testing, lots of setup, etc. So we didn't get much in the way of buy-in.

My job was to build tools to get the programmers doing tests on the search platform, across a large number of international sites. They key was Keeping It Trivial To Do. I put together a Perl application called simple_scan (available as App::SimpleScan on CPAN) that took a URL, a regex, and a 'Y' or 'N' as its input; it then generated a Test::More-based Perl program that actually did the testing.

This was the first bar: no writing programs to write a test. The second bar was, for instance, running 20 queries against 20+ sites. Obviously cut-n-pasting 20 identical tests was unappealing, and I wanted to stay away from the idea that you were writing a program. So I came up with the idea of doing combinatorial substitution: define a variable that has the servers you want to test, and another one which has the queries you want to run, and simple_scan does all the work of generating the unique combinations. So 3 lines of input can now generate 400+ tests, all of which are monitored via the standard TAP tools.

The lesson of all this is to make sure that you provide testing in a way that is compatible with the goals of the programmer on the ground: if a programmer finds it really easy to write and run tests, he or she will write them. If there's any friction between "I should test this" and "test is running", you'll find that there are no tests.

The other lesson is that you don't have to make them write Perl to take advantage of the Perl testing tools.

1 I'm working on development tools now; simple_scan's worked out so well that I ran out of things to do for Search!

  • Comment on Re: Creating a co-operative framework for testing

Replies are listed 'Best First'.
Re^2: Creating a co-operative framework for testing
by pemungkah (Priest) on Oct 27, 2006 at 20:03 UTC
    Oop, should have logged in first. Oh well.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://581008]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2024-04-18 10:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found