Sifmole has asked for the wisdom of the Perl Monks concerning the following question:

I did a search on CPAN for Unit Testing libraries, and there are a bunch. I noticed one batch from a fellow monk Christian Lemburg (pardon me if I misspelled).

With the sheer number, I was curious if any of you monks had used any of these libraries; and what your experiences were?

Replies are listed 'Best First'.
Re: Unit Test libraries, opinions
by chromatic (Archbishop) on May 11, 2001 at 19:52 UTC
    Test::Unit will be immediately familiar if you've used JUnit. It's highly object oriented and works well if you use it as it's intended to be used.

    Test and Test::Harness have the advantage of being in the core distribution. They require slightly more initialization on your part, but they're not too difficult to use.

    jlp and I discussed this the other day, and he ended up writing 50 lines of code that did all of the testing we needed. It follows clemburg's Test::Unit framework, but it's limited to the bare bones of what we need. If you just want simple tests, it's very easy to use.

Re: Unit Test libraries, opinions
by Tyke (Pilgrim) on May 11, 2001 at 18:11 UTC
    Excellent.

    I'm working on a project where application software is written in Java(ob-sob), and development tools in Perl. Christian's stuff allows us to have exactly the same development methodology between the two parts since it's based on JUnit which we use for unit-testing the Java stuff.

    It's possible to

    • define tests to run in a clean environment that is reinitialised for each test
    • progressively integrate new tests and test suites
    • run either in batch or GUI with meaningful output in both cases (the TK implementation mirrors the JUnit swing implementation very well)
    • make testing easy enough not to skip it!

    Well worth checking out