[Development] Adding new network tests

Mathias Hasselmann mathias at taschenorakel.de
Fri Jun 13 09:57:19 CEST 2014


Am 12.06.2014 08:16, schrieb Mandeep Sandhu:
>> Whenever possible, use the mini-http server, as it is less likely to cause
>> network timeouts.
> Ok. Although since I'm testing out a lot of redirection scenario's, it
> might be better to use a real webserver for generating different types
> of redirect responses (permanent/temporary, redirect to HTTPS,
> with/without auth etc).

While it makes sense to have automated compatibility tests, it is not 
needed to use a real web server for plain regression testing: Real 
servers are complex pieces of software which add another layer of 
complexity to your test, but adding complexity to automated tests is 
exactly what you should avoid. Automated tests _must_ be as _trivial_ as 
possible: Complexity introduces bugs and regressions, and who is going 
to find them? It wouldn't make much sense write unit tests for your unit 
tests, would it? So really: Keep complexity of automated tests at a 
minimum. Actually, even Qt's own mini-http server might be too complex 
for your testing needs. In not just in my opinion, the perfect 
_regression_, not interoperability test for a network code is run 
against a trivial server that just tests incoming requests against 
simple regular expressions, or even against fixed text and then replies 
with a fixed reponse. Similiar to what you do when using Mock objects.

Ciao,
Mathias



More information about the Development mailing list