On testing modules

Posted on May 19, 2005

I’ve been getting some good progress on the Flickr-Tools distro, mainly on the lower-level modules (Flickr::API::Photos, Flickr::API::People, etc). At this point I can already rewrite the pet project which got me into writing this group of Perl classes in the first place, using only these classes. Admitedly this is not much to boast about, but it feels nice anyway… :-).

On the way I’ve met some dead-ends and had to track back a few times, but nothing too alarming.

Only now I’ve come across a real stumper.

While developing the modules I’ve taken the “build your tests before writing any code” approach which is all fine and dandy while I’m working on it, but I just don’t know how I’m going to release the modules with the tests as they are now.

The problem is that testing anything useful at all requires not only the usage of a Flickr API key but also some rather precise information on a person’s info, a few test pictures, photosets, and so on.

Of course I’m using my own information for the tests, but I’m not really happy with releasing a module into the wild with all that information on it!

I know I could just capture the result of the original Flickr API response for each instance I needed it, change some values around and test my modules against that result but that is just evading the problem and a whole lot of extra work.

I just don’t know how I’m going to tackle this one…