Toad World® Forums

Specify test data values as a query from a table


Beta tester Dan Huston submitted this enhancement request (which I paraphrased and entered into BugMonitor with ID 1152):

For a particular in argument, I want to use the set of values specified in a table or query.

For a set of arguments, I want to use tuples, rows from a table with same structure as parameter list.

I want the option of immediately expanding into a static set of generated test cases or keeping the dynamic definition in a single test case row - just point to a test data group, which could be defined based on a query, etc.

For dynamic sets, every time you generate, you expand the set of values or even create a special body of code that iterates through them (but what about stable guids for the test cases?).


A follow up question:

Suppose we implement your idea of in essence associating a query with a particular IN argument. We do this for two different arguments:

Query1 -> Arg1

Query2 -> Arg2

All very doable. If Query1 brings back 3 values and Query2 brings back 2 values, Code Tester will generate SIX test cases from the permutations of those values.

This is where I tend to get stuck, however: how do we associate an outcome with each of these test cases? Today, if you use the Set of Values feature in the input Properties window, we do all of the above for fixed values (not derived from a query) and we apply whichever outcome you specify to all.

But if we move to supporting dynamic generation of test cases (that is, when you run the test, Code Tester expands the values from the queries into N test cases, how can I then apply outcomes in a practical and useful way?

Your thoughts?


What about if after the query was parsed the user is presented with a dialogue presenting the fields from the query and the user designates which are inputes and which are the outputs? If the result is not stored in the same table as the inputs, a second table could be created (by the user, external from the tool) and the user could create a view which would be queried?


Interesting. So let’s suppose that the arguments are two in strings, one in out number, and a date. The procedure also returns two out numbers. My query might then look like this:

select str_in_value, number_in_value, date_in_value, number1_out_value, number2_out_value, number3_out_value
from …

So we ask you to correlate, and we also have to ask you to provide the operator to apply to each outcome. We can’t assume that it will always be “=”, correct?

I think this is doable, but it sure is complicated. I guess we could lay down some rules to simplify matters, at least in the first pass:

You HAVE to provide a query that correlates to all arguments, in and out (and if there is in / out then you need TWO columns, and we have to figure out how to standardize where you put the the in and the out). You can only do this with a small set of operators (including is null?), and so on.