[Development] Adding new network tests

Thiago Macieira thiago.macieira at intel.com
Fri Jun 13 17:28:58 CEST 2014


Em sex 13 jun 2014, às 09:57:19, Mathias Hasselmann escreveu:
> 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.

I'm separating out the MiniHttpServer into a separate header.

The problem is that MiniHttpServer cannot react to weird replies from the 
client. It needs to send exactly what it was told to send.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list