Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Testing a httpd

by BUU (Prior)
on Nov 26, 2004 at 10:18 UTC ( #410541=perlquestion: print w/ replies, xml ) Need Help??
BUU has asked for the wisdom of the Perl Monks concerning the following question:

As the question says I have myself a nice httpd that I wish to write a comprehensive test suite for. I just lack ideas on exactly how to test, but more importantly, what to to test. If you would be so good, I would be quite interested in specific tests as well as broad categories that I should be examining, and or any good ways to test from the perl code it self (I'm mostly thinking lwp::simple and get()).

Comment on Testing a httpd
Re: Testing a httpd
by Jaap (Curate) on Nov 26, 2004 at 10:29 UTC
    I think generally you want to test:
    if the correct content is returned on a request
    you want form input to be handled correctly
    you might want some performance test (use apachebench, /usr/sbin/ab2 on an apache2 box).

    Depending on what kind of webapp you have you might want to test more.
Re: Testing a httpd
by Anonymous Monk on Nov 26, 2004 at 10:36 UTC
    What is a nice httpd and why does it need testing?
      A "httpd" or "http daemon" is a webserver, like for example Apache. Actually, at least some of Apache's configuration files have "httpd" in their name, like the master configuration file is called "httpd.conf".

      So he wrote a little webserver, and he wants to debug/stress test it.

Re: Testing a httpd
by BrowserUk (Pope) on Nov 26, 2004 at 10:36 UTC

    Post a link to it on /. saying "This is the funniest thing I've seen in ages". :)

    Don't expect to get any surfing done for a few days if your running off the same IP though.


    Examine what is said, not who speaks.
    "But you should never overestimate the ingenuity of the sceptics to come up with a counter-argument." -Myles Allen
    "Think for yourself!" - Abigail        "Time is a poor substitute for thought"--theorbtwo         "Efficiency is intelligent laziness." -David Dunham
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
Re: Testing a httpd
by tomhukins (Curate) on Nov 26, 2004 at 10:36 UTC

    As with any code, you should test your objectives. When you wrote your nice httpd what did you set out to achieve? Test these things.

    You should test the features that your httpd provides, as well as those aspects of the HTTP specification that you claim to support. Ideally, you would also test how your httpd responds to requests it can't deal with. The HTTP Implementor's Forum might help you.

    LWP::Simple will allow you to perform simple tests (as its name suggests!), but you won't be able to use HTTP's POST method. I would suggest you investigate Test::WWW::Mechanize.

    Finally, you might want to test your httpd against the behaviour of common browsers using Win32::IE::Mechanize or the WWW::Mechanize::Shell modules.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://410541]
Approved by Happy-the-monk
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2014-12-21 19:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (107 votes), past polls