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


in reply to Re: Regression testing with dependencies
in thread Regression testing with dependencies

Skipping the tests completely is a commonly used technique here as well. Unfortunately, that has the unwanted side effect of leaving a lot of code without tests :) (it's the problem I'm trying to solve)

When you're writing a module whose entire existence is intended to connect to some third party's server using a proprietary networking protocol, you can't very well skip every test, because then you're not testing anything at all.

Writing a fake server or dummy module to connect to also doesn't help, because then you're testing against how you think the protocol/server works, not how it actually works. You're making the same assumptions you made when you wrote the module you're testing.

It's roughly equivalent to doing this:

sub protocol_thing1 { return "thing1"; # protocol-dependant Magic String } # And a corresponding test: use Test::More tests => 1; ok protocol_thing1() eq "thing1"; # Gee, that was fun! # The problem is, the server throws an error unless # you use "Thing 1".
As you may have guessed, No, I haven't found an adequate answer to my concerns yet :)

Alan