Toad World® Forums

What if we don't know what our program is going to do in advance?


#1

From Marko:

When we make test cases, we know the result of what some procedure will do. But it is easier to just check the results instead of typing it all in your tool. What I meant is that, when we first run test case your program could save result of query used in the part “Data changed by program”. This way we can see what query have return, plus we do not have to write fix result values. If we change the functionality of procedure we need to change manually values of fix results of all test cases. This way we just rerun the test case and check the results. This can be done with autonomous_transaction. I think this would be a big improvement to your test tool. Is there any option that you upgrade your program with this functionality?


#2

Marko,

We call this “baseline execution” and we are working on implementing it right now!

We will definitely support this feature for scalars in our next release (I do not yet have a date).

We are also looking at what it will take to implement same for datasets (it is a lot tougher, but also much more useful).

So…great idea and we will get it to you ASAP!

SF


#3

We allready implemented socalled “baseline execution” on a query. This is not the perfect solution, but it solves our requirements. See also the attachments. This is the way we use it:

/*
we type in declaration, because we dont want to type the same parameter value more than one time. This way we only write it down in database.
*/
pb_id number := qct.set_id(30);-- setting test case id
pb_vpo number := qct.par_n(‘pb_vpo’); – reading the test case value from data base
pb_partija number := qct.par_n(‘pb_partija’);
pb_datum date := qct.par_d(‘pb_datum’);

/*
“data changed by program” query we would like save result of:
/
SELECT qct.zapisi (‘tab_por’, ‘por_zam’, por_zam, ROWNUM),
qct.zapisi (‘tab_por’, ‘por_val’, por_val, ROWNUM),
qct.zapisi (‘tab_por’, ‘por_akc’, por_akc, ROWNUM),
qct.zapisi (‘tab_por’, ‘por_sal’, por_sal, ROWNUM),
qct.zapisi (‘tab_por’, ‘por_zne_b’, por_zne_b, ROWNUM),
qct.zapisi (‘tab_por’, ‘por_zne_b_tval’, por_zne_b_tval, ROWNUM),
qct.zapisi (‘tab_por’, ‘por_zne_b_stval’, por_zne_b_stval, ROWNUM),
qct.zapisi (‘tab_por’, ‘por_zne_d’, por_zne_d, ROWNUM),
qct.zapisi (‘tab_por’, ‘por_zne_d_tval’, por_zne_d_tval, ROWNUM),
qct.zapisi (‘tab_por’, ‘por_zne_d_stval’, por_zne_d_stval, ROWNUM)
FROM tab_por
WHERE por_vpo = pb_vpo AND por_kre = pb_partija
/

expected results
*/
SELECT qct.vrni (tabela, ‘por_zam’, vrstica),
qct.vrni (tabela, ‘por_val’, vrstica),
qct.vrni (tabela, ‘por_akc’, vrstica),
qct.vrni (tabela, ‘por_sal’, vrstica),
qct.vrni (tabela, ‘por_zne_b’, vrstica),
qct.vrni (tabela, ‘por_zne_b_tval’, vrstica),
qct.vrni (tabela, ‘por_zne_b_stval’, vrstica),
qct.vrni (tabela, ‘por_zne_d’, vrstica),
qct.vrni (tabela, ‘por_zne_d_tval’, vrstica),
qct.vrni (tabela, ‘por_zne_d_stval’, vrstica)
FROM v_qct_rezultati
WHERE tabela = ‘tab_por’
qct_polni.pb (7.8 KB)


#4

We allready implemented socalled “baseline execution” on a query. This is not the perfect solution, but it solves our requirements. See also the attachments. This is the way we use it:

/*
we type in declaration, because we dont want to type the same parameter value more than one time. This way we only write it down in database.
*/
pb_id number := qct.set_id(30);-- setting test case id
pb_vpo number := qct.par_n(‘pb_vpo’); – reading the test case value from data base
pb_partija number := qct.par_n(‘pb_partija’);
pb_datum date := qct.par_d(‘pb_datum’);

/*
“data changed by program” query we would like save result of:
/
SELECT qct.zapisi (‘tab_por’, ‘por_zam’, por_zam, ROWNUM),
qct.zapisi (‘tab_por’, ‘por_val’, por_val, ROWNUM),
qct.zapisi (‘tab_por’, ‘por_akc’, por_akc, ROWNUM),
qct.zapisi (‘tab_por’, ‘por_sal’, por_sal, ROWNUM),
qct.zapisi (‘tab_por’, ‘por_zne_b’, por_zne_b, ROWNUM),
qct.zapisi (‘tab_por’, ‘por_zne_b_tval’, por_zne_b_tval, ROWNUM),
qct.zapisi (‘tab_por’, ‘por_zne_b_stval’, por_zne_b_stval, ROWNUM),
qct.zapisi (‘tab_por’, ‘por_zne_d’, por_zne_d, ROWNUM),
qct.zapisi (‘tab_por’, ‘por_zne_d_tval’, por_zne_d_tval, ROWNUM),
qct.zapisi (‘tab_por’, ‘por_zne_d_stval’, por_zne_d_stval, ROWNUM)
FROM tab_por
WHERE por_vpo = pb_vpo AND por_kre = pb_partija
/

expected results
*/
SELECT qct.vrni (tabela, ‘por_zam’, vrstica),
qct.vrni (tabela, ‘por_val’, vrstica),
qct.vrni (tabela, ‘por_akc’, vrstica),
qct.vrni (tabela, ‘por_sal’, vrstica),
qct.vrni (tabela, ‘por_zne_b’, vrstica),
qct.vrni (tabela, ‘por_zne_b_tval’, vrstica),
qct.vrni (tabela, ‘por_zne_b_stval’, vrstica),
qct.vrni (tabela, ‘por_zne_d’, vrstica),
qct.vrni (tabela, ‘por_zne_d_tval’, vrstica),
qct.vrni (tabela, ‘por_zne_d_stval’, vrstica)
FROM v_qct_rezultati
WHERE tabela = ‘tab_por’
qct.sql (9.63 KB)