Testing, Perl and databases

jplindstrom on 2004-02-25T11:48:25

Found this talk about Perl Testing by Michael Graham.

Useful Test::* modules at the end.

I found the slides when searching for dies_ok, which I was sure I had seen but couldn't find in the man pages for Test::More. And Test::Exception installed without a hitch.

I'm currently writing a test framework for an application server of ours. I'll be using Test::More as the actual framework and perform XML calls to the app server.

The only annoying thing with this is that the app server is only a business logic layer on top of a database, and after/before each run of a test suite, I need to get the database into a consistent state.

The current plan is to keep track of certain tables that actually change and delete from them, then insert default data again.


Testing databases.

Dom2 on 2004-02-25T12:51:59

You might find some useful ideas in Martin Fowlers Evolutionary Database Design.

-Dom

Testing modules

petdance on 2004-02-25T14:52:29

See also this page on qa.perl.org.

Re:Testing modules

jplindstrom on 2004-02-25T20:31:42

Test::DatabaseRow looks very useful.

If there is nothing on CPAN, I think I'll write a simple tableRowCount($table) method to get the number of rows in a table. That should be useful for detecting new lines in a table after a call.

Or maybe a row_inserted_ok($table, $number_of_new_rows, $label). Yes... hmmm... that sounds like something... hmmm...

Re:Testing modules

petdance on 2004-02-25T22:15:54

Mark's been good on the patches. I created the rows_ok() method. It's pretty darn useful.