A newbie asking newbie questions here.
Let’s say I write software that (virtually) stores fruit in fruit boxes for customers.
I’ve got a function called the_right_box. In goes the fruit name and out goes the fruit box name. Eg: ‘apple’ goes in and ‘apple box’ goes out. The fruit-fruitbox combinations are hardcoded. Then I could write the following hardcoded test cases:
INPUT VALUE - EXPECTED RETURN VALUE
‘apple’ - ‘apple box’
‘banana’ - ‘banana box’
‘cherry’ - ‘cherry box’
But now, the software has become highly configurable. And conform a specific configuration it could be that apples ought to go into the banana box, bananas into the cherry box and cherries into the apple box. And in every environment (three software versions in the market, all with some development and test environments) the configuration is likely to be totally different. So you have to query the current configuration and use that as your input values and expected outcome values. The query could be looking like this:
SELECT fruit, fruitbox FROM configuration - where ‘fruit’ contains the input values and ‘fruitbox’ the expected outcome values. From my one day evaluation experience I think it’s possible to setup such test cases using Quest Code Tester. So far so good.
Q1:How can I setup such test cases using Quest Code Tester?
With examples 1 and 2 I was just testing fruit and fruitbox types, but not their instances. Let’s say my software consists of a bunch of object instances representing my customers and with each customer I could define some fruit instances and fruit box instances. My the_right_box function has now been changed into a function with a fruit instance sequence going in and a fruitbox instance sequence going out. Whether the apples are going to be stored in an apple box is now not only depending on the general configuration, but also on the current situation with a certain customer. If customer ‘Fruits Ltd’ has 12 apples and 0 apple boxes, 1 banana box and 1 cherry box, then the function can’t possibly return an apple box sequence. In this testcase it should return a minus 1 for an apple sequence, for not being able to find the apple box needed.
Q2:How could I set up test cases for this?
First of all I guess I have to set up a test situation, using some PL/SQL, with modules like create_test_customer(name), create_test_fruit(customer, type_of_fruit, number), create_test_fruit_box(customer, type_of_fruit_box, number). But the number of fruit, the number of fruit boxes, the fruit types and the fruitbox types are all depending on the specific test case.
Secondly, I guess again, the test case has to do a query like the one below to actually get some input and expected output values:
SELECT fruit.id, fruitbox.id
FROM customer, fruit, fruitbox
WHERE customer.id = fruit.fruit2customer
AND customer.id = fruitbox.fruitbox2customer
AND (fruit.fruit_type_id, fruitbox.fruitbox_type_id) =
–The global fruit - fruitbox configuration
SELECT c.fruit_type_id, c.fruitbox_type_id
FROM configuration c
WHERE c.fruit_type_id = fruit.fruit_type_id
AND c.fruitbox_type_id = fruitbox.fruitbox_type_id
Q3:How can this kind of test situation setup be integrated with the actual test cases within Quest Code Tester?
(let me know if you need more fruit)