Saturday, September 17, 2005

Unit Testing in Perl

I've been using the Test::Unit module for creating unit tests and I like it.

The most common module for creating Unit Tests is probably Test::More. For me, there are two important advantages to Test::Unit

1. In Test::Unit each test is actually a subroutine, so the variables etc. you create for one test are isolated from those created for other tests.

2. Test::Unit automatically runs a method called setup() before each test,a nd teardown() after each test, which is useful for things like populating a test database, etc.

No comments: