Pat Gunn (dachte) wrote,
Pat Gunn
dachte

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.

Tags: programming
Subscribe

  • Abstract strategies for abstraction

    There are a few purposes of abstraction in programming; one of them is to construct a uniform API that is independent of the backend that can work…

  • Statistical Software Components

    A few months ago I mentioned my big library of useful generic C/Perl functions (libpgunn). There are plenty of other general-purpose libraries out…

  • Lessons from Refactoring

    Recently, I've been going through a number of my programming projects and moved any function that's either generally useful or used in more than one…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments