Automated testing of database queries?

R

Rhino

I posted this a couple of days ago on comp.lang.java.databases, thinking
that it was the logical place to ask the question but no one has responded
so I'm reposting here.

---

I haven't been involved in testing of database queries in quite some time
and I feel sure there have been many developments and improvements in the
intervening years. Can anyone tell me what today's "preferred" tools are for
database testing?

I'm mostly interested in SELECTs at the moment but I'm curious about tools
to test other types of SQL as well.

To be more specific, if my query is supposed to produce a result set that
contains a specific number of rows with specific values in each column of
each row, what is the best way to verify that my result set matches
expectations precisely?

Clearly, I can't just count the number of rows in the expected result and
compare them to the number I actually got; that will not detect whether I
got the *correct* rows. And I can't just look at keys because I need to
verify that values in non-key columns are also correct. Eyeballing large
results - where large is anything over a handful of rows and columns - is
tedious and error prone at best.

The only reasonable approach I know about - from years gone by - is to
unload the result table into a flat file and compare it to a flat-file
version of the expected result to see if they match. But how do you create
the flat-file version of the expected result quickly and efficiently?

I've got to believe that there are some slick modern tools that make all
this a breeze. Can anyone enlighten me on what they might be?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top