http://www.perlmonks.org?node_id=350984


in reply to Testing a Client-Server Application

I have had good luck with a record/playback model. That is: A simple example would be to test a web server by taking your real web logs (possibly altered to include more information than would normally be included, like, for example, the POST string), and running them through a script which made an LWP request for each entry in the web log. Then, of course, diffing the HTML.

Of course, the method is generally applicable to anything that allows you to spoof the client or the server (and I've used it for more than just web servers), but web servers make a nice example. A more general method would be simply to trap all the traffic on the socket and write it to a file (tracking what is server talking and what is client talking), and then play the one sides half of that conversation into the other side by, well, basically pasting it into a telnet window :-)

This model is very helpful for situations where you want to make sure that no unexpected changes occured between your control and your test version. Obviously, you'll want to identify differences and decide whether or not they are expected differences. It's often useful to munge the diff (systematically remove approved differences), and/or to munge the input's to the diff (likewise, as a way to systematically remove differences... but actually by making the inputs more similar, rather than by clipping the output of the diff, which can often be more difficult).

------------ :Wq Not an editor command: Wq