Re:Ask HN: How do you test your web applications?
by jrockway on Tuesday March 30, 2010 @07:55PM
(#1230536)
s/Burp Suite Pro/QuickCheck/.
Basically, there are two stages to a web application; understanding the request, and processing the request. The understanding part is a parser, so you are going to have to ensure the correctness of that with test cases -- you can never prove correctness, you can only show that it works on a lot of input.
The rest of your application, however, will be modeled on a finite number of possible states that this data structure represents. This means you can use better tools (things like Catch) to ensure correctness; you can literally prove that there is never a case you don't handle, for example. This gets you reliable code more quickly than random testing does.
Anyway, to answer the OP's questions, web apps should be tested like everything else. A web app is a pure function from Request -> Response, so test it like any other pure function.
Basically, there are two stages to a web application; understanding the request, and processing the request. The understanding part is a parser, so you are going to have to ensure the correctness of that with test cases -- you can never prove correctness, you can only show that it works on a lot of input.
The rest of your application, however, will be modeled on a finite number of possible states that this data structure represents. This means you can use better tools (things like Catch) to ensure correctness; you can literally prove that there is never a case you don't handle, for example. This gets you reliable code more quickly than random testing does.
Anyway, to answer the OP's questions, web apps should be tested like everything else. A web app is a pure function from Request -> Response, so test it like any other pure function.