Syntactic Confectionery Delight | |
PerlMonks |
DBD::DB2 truncates clob values - on the importance testingby andreas1234567 (Vicar) |
on Mar 19, 2009 at 07:18 UTC ( [id://751639]=perlquestion: print w/replies, xml ) | Need Help?? |
andreas1234567 has asked for the wisdom of the Perl Monks concerning the following question:
Executive summary: Do not upgrade DBD::DB2 unless you have verified that your application works as expected with the new version. There is no test suite to help you detect errors or unexpected results.
DBD::DB2 is the database driver for IBM DB2 UDB. The database runs on a variety of platforms, including Unix (AIX), Windows, Linux and z/OS. To my big surprise, DBD::DB2 has no real test suite, and recently there was discovered a bug where newer versions of the module return incorrect results for certain versions of the database for the clob data-type. I claim that this bug could have easily been discovered during development if the module had even the simplest of tests (which in this case would be to insert a value, then retrieve the value, and test for equality), e.g. like this:
The benefit of test driven development is, you *know* your code will work before you ship it.I will turn that around: The benefit of test driven development is, you detect when your code does not work as expected. Let this serve as a reminder of how important it is to have a test suite, and a kind request to the module maintainers to start building one. Update Fri Mar 20 12:21:46 CET 2009: The IBM OPENDEV team has responded to the bug and produced a patch that seems to fix the problem, and they deserve credit for doing so.
Back to
Seekers of Perl Wisdom
|
|