We're using mod_perl to produce data in XML and later to be converted into HTML via XSLT, and the database is in MySQL. Our OS is Unix.
So I've been reading about how cool and powerful TDD is in .NET, Java with all the available frameworks. I've even tested NUnit before and I kind of like it. You can write the test once and use it pretty much forever.
I was wondering if there is an easy way to implement TDD for our case too with Perl?
What I want to do is to have some automated way to manage my unit test, and to be able to easily run the unit test with just one click or something.
I've found this chapter on TDD to be very useful as well as helping me design the test, and best of all it's free :)
And if you can afford it then get this book too: Perl Testing: a developer's notebook. It's really good in the sense that it break down into all the potential stuff that we need to do and it's in a tutorial based format.
Added a Perl testing reference card here.
So now I'm eager to look for some good resources, .pm, open source Perl projects which I can use to better learn how to write unit tests, etc. Can anyone recommend some here?
These might be helpful...
TDD with Perl - Episode 3 (whenever Lance gets around to writing it)
Testing / Perl 5 Wiki -- especially the bit on mock objects and the further information and other links sections (seems to be defunct)
What frameworks and tools would you recommend for unit-testing and mock objects in Perl?
I have an existing Perl application, that mainly does database access, reading and writing files. The application is basically a batch job type of application, it reads in bunch of stuff from files and database and writes a bunch of new files and some stuff to database.
The application currently does not have any unit-test, but I'd like refactor application to have good unit tests.
Also, are there any good BDD (Behaviour Driven Development) based testing frameworks for Perl?
Do you have any strategies for retrofitting unit tests onto a code base that currently has no unit tests ?
If ever you are trying to add unit tests to old perl code I strongly recommend
Perl Testing: A Developer's Notebook by Ian Langworth and chromatic.
It has some very nice trick on testing legacy and "untestable" code.