[agileDatabases] Test-Driving SQL Server
Have you taken a look at DBUnit? -- http://dbunit.sourceforge.net
It might be a useful tool in a few areas -- loading the test data,
testing insert/update/delete, etc.
I haven't used it myself, it's just been on my "bookmark" list for a
"Kay A. Pentecost" <tranzpupy@...>
08/31/2004 09:52 AM
Please respond to agileDatabases
Subject: [agileDatabases] Test-Driving SQL Server
I'm still thinking about how to test/ and test-drive the database.
I'm wondering what needs to be tested in a database, and I've come up
with a few things that have bitten me in the last few weeks.
Seems to me, there's two main areas to test: structure and actions.
Under structure, I need to know
* Tables exist
* Fields exist
* Primary Keys Exist
* Foreign Keys Exist
* Triggers, etc Exist
* Fields are set to NULL or NOT NULL
As Richard posted, we also need to test
* Schema changes
* That test data is loaded...??
Under Actions, we need to test stored procedures.
* they are working as expected
Richard also wanted to:
Delete the test data and return to a known previous schema
Test the inbuilt propagation of key changes to related tables
(UPDATE, DELETE, RESTRICT)
Test restoring the transaction log
Test my maintenance SPs (verifying that statistics have been
updated and sproc caches cleared)
Now, seems to me that an internal stored procedure would be best for
testing structural status...
And it also seems to me that calling stored procedures from the
application test framework (xUnit) would be best.
So my two -uh... three questions are:
* What else needs to be tested in an ongoing way in the database?
* In regard to testing internally (Stored Procedures) or
externally (xUnit) which seems to you to be best, and why?
* What are the advantages and disadvantages of each?
And I guess, a fourth question... I'm an application developer, who
needs to work with databases, not a dba... am I missing something
- Hi, Tim,
--- In agileDatabases@yahoogroups.com, "tpbrown2001" <tim_brown@a...>
>Hadn't seen this yet, and it's led to some interesting reading.
> Have you taken a look at DBUnit? -- http://dbunit.sourceforge.net
Google dbUnit for more info.
I'm working in a Microsoft environment... and some of my favorite
tools (Eclipse, JUnit) are missing... wonder if anyone is porting
this to dot net.
Also made me realiza I was looking for "database" unit testing, and
not db unit testing or even db testing, so that presents more options.
Very cool, Tim.