Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Testing framework in Perl

by crenz (Priest)
on Mar 17, 2006 at 12:16 UTC ( #537441=perlquestion: print w/replies, xml ) Need Help??
crenz has asked for the wisdom of the Perl Monks concerning the following question:

I currently work on developing a new product that will consist of different components written in several languages. I want to be able to write tests for these components (accessing them as COM servers, DLLs, ...) and use the Perl testing framework to create my own test framework.

I have looked at Test::Unit and Test:Class. Does anybody have any experience with these? What are other people using to create tests for complete software suites (as opposed to tests for just one module)? Are there any solutions for creating HTML reports (overview of failed tests, etc.)? Please share your experiences!

Replies are listed 'Best First'.
Re: Testing framework in Perl
by adrianh (Chancellor) on Mar 17, 2006 at 12:33 UTC
    I have looked at Test::Unit and Test:Class. Does anybody have any experience with these?

    Yes (I wrote the latter :-)

    What are other people using to create tests for complete software suites (as opposed to tests for just one module)?

    Combinations of Module::Build, Test::Class, Test::Builder, Test::Harness::Straps and associated modules.

    Are there any solutions for creating HTML reports (overview of failed tests, etc.)? Please share your experiences!

    Take a look at Test::TAP::HTMLMatrix.

Re: Testing framework in Perl
by davorg (Chancellor) on Mar 17, 2006 at 12:31 UTC

    If you are used to other xUnit testing frameworks (e.g. JUnit) then you will find that Test::Unit is a pretty good port of those frameworks into Perl. The downside, however, is that is doesn't play well with the rest of the Perl testing framework. If you want to make use of the many useful testing modules on CPAN then Test::Class is the way to go.

    And I strongly recommend that you get a copy of Perl Testing: A Developer's Notebook.

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

      If you are used to other xUnit testing frameworks (e.g. JUnit) then you will find that Test::Unit is a pretty good port of those frameworks into Perl.

      Actually with the new version of JUnit and TestNG the gap isn't as wide as it was before... I must rewrite that section of the docs at some point :-)

Re: Testing framework in Perl
by timos (Beadle) on Mar 17, 2006 at 12:32 UTC
    I like Test::More. It is very easy to understand, yet powerfull. Just have a look at http://search.cpan.org/~mschwern/Test-Simple-0.62/lib/Test/More.pm

    Regards,
    Timo
Re: Testing framework in Perl
by lima1 (Curate) on Mar 17, 2006 at 12:36 UTC
    Don't know how modular your project is.

    I think it does not matter if it is just one module or if it consists of many components if you choose a good OO design.

    I write tests for every class/module with the standard tool for the language (Test::More on Perl,JUnit for Java,...) because they are well documented (good for other developers) and mature.

    for example if Java component X does the main calculations and Perl Module Y uses some of this Java libs, then test in X with JUnit that the calculations are correct and in Y with Test::More that the communication is ok.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://537441]
Approved by Corion
help
Chatterbox?
[Lotus1]: perldigious I found out recently that opossums are very good at killing ticks.
Your Mother is lucky to only have to carry a kayak 15 feet to put in.
[perldigious]: If I was given the option to remove either mosquitos or ticks from the world... I think I'd pick ticks, even though I'd guess most would go the other way.
[Lotus1]: when they grooms themselves they eat any ticks they find. and apparently lots of ticks latch onto opossums.
[Your Mother]: There is a nice looking—don’t know first hand—new tool being market for removing ticks.
[Your Mother]: (marketed)
[Lotus1]: at least ticks don't fly
[1nickt]: We have a new tick in cenral New Jersey this year. The Lone Star tick -- no Lyme, but will give you an allergy to red meat!
[Your Mother]: "Tick Twister."
[1nickt]: My sister lives in the Sydney suburbs (carved out of the bush) and they have the Paralysis tick -- leavs you quadriplegic!

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (14)
As of 2017-05-24 13:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?