Log in

No account? Create an account

Testing functions in Perl

(Nothing particularly profound or my-idea-centric here, and I was tempted to post it to my personal blog instead, but it's worth trying to learn from)

Tonight I went to a NY Perlmongers meeting; there were two talks about modules and techniques for building good testing infrastructure for big software projects, either for unit or integration tests. I was impressed with the effort the speakers had put into for various kinds of comparison operators (are two XML streams or sets the same is not the same as asking if they serialise the same), also with some "explain the difference between these two data structures" functions they called to help explain regressions better.

While Perl is the best programming language and is naturally also the best at writing these things (hehe), very little of the talk was necessarily Perl-specific; building this kind of framework is useful for many languages. Also, I like how one of the simpler test frameworks they presented was carefully designed to make it a no-brainer-of-course-yes choice as to whether to write tests for one's codes, and how now CPAN expects unit tests for new modules.

But I tend to geek out over refactoring techniques/strategies/tools like this. IMO one only rarely gets a lot of milage over editor choice (I still prefer vim), but clean APIs, good testing harnesses, and a well-curated set of functions to ease this stuff goes very far.

Speakers were Jim Keenan and Belden Lyman.