Tests for Goodness' Sake

Dear PyWPS and TileCache,

You know what would impress more than a 1.0 tag? Tests. If it's worth building, it's worth testing. Testing Python is easy, even fun. Ask me how.

Best regards,

The Test Nut

Update: TileCache's HACKING file does serve as a doctest file.

Comments

Re: Tests for Goodness' Sake

Author: Christopher Schmidt

cd tilecache-1.0 python >>> import doctest >>> doctest.testfile("HACKING") UserWarning() (0,20) >>> TileCache has tests, they're just not obvious. I don't think they need to be (although I believe Schuyler disagrees): So long as I consider it my personal responsibility to maintain the TileCache code, it's my responsibility to make sure it does what it says on the tin, which means the tests are important to me, and not to you. I'd love to hear why you feel otherwise.

Re: Tests for Goodness' Sake

Author: Sean

I simply didn't find your tests. You've got a well-earned reputation for making cool software, but I think you'll find that adding obvious tests will get you even more attention and contributions from savvy users.

Re: Tests for Goodness' Sake

Author: Christopher Schmidt

But you still haven't answered the question: "Why do you need my tests?" OpenLayers has public tests: 905+ of them. They're runnable on the web (http://openlayers.org/dev/tests/run-tests.html), they're using an Open Source testing framework, and they're required for inclusion of new features into the codebase. OpenLayers is an Open Development project. TileCache is an *open source* project, but not an Open Development one. Given a good patch, it would likely be integrated, but (unless I'm sorely mistaken as to the niche this fills), it will never be an Open Development project. There is no public SVN repository. There are no non-MC committers. I can't imagine there ever being a reason for there to be: it's 500 lines of code. There's very little reason to bother committing a patch back, because there's so little to patch that wouldn't mean adding a layer of complexity or four. Tests for open development projects are absolutely essential. Tests for Open Source projects which are not open development don't neccesarily help anyone. If I'm going to check your patch, then it's my responsibility to make sure it doesn't break things, not yours. If I want you to make sure it works, then I've got to think about switching models to be something other than Open Source closed Development. Can you point to some change you might think about making where tests are helpful in TileCache?

Re: Tests for Goodness' Sake

Author: Sean

Why do *I* need your tests? Tests are a sign (to me) that the code could be worth my time to evaluate. That's all. OpenLayers' tests were a very positive sign.

Re: Tests for Goodness' Sake

Author: Schuyler Erle

Christopher, speaking as your collaborator and admirer, I'll reiterate why I insisted we come up with some kind of unit tests for TileCache: They're useful to *me*. If I break something, I want to know about it. ;-)