Toad World® Forums

testing procedures in a package


#1

I am beginner in Quest Code Tester. I have a package to test - inside the package there is a procedure called ‘main’ that is an envelope procedure calling other procedures sequentially.
I specified all my test cases under the ‘main’ procedure. I thought the test will run and verify all the test cases after one time run of the ‘main’ procedure, but it seems the test runs many times with each test cases calling ‘main’ procedure. Is it true?
If I specify my test cases under the different procedure (program list) in the package, how do I ensure the procedures run sequentially as called in the ‘main’ procedure?


#2

With Code Tester, you define tests for the specific subprogram of
your package. How else can you specify the inputs for the running of
that program?

In fact, that is not a rhetorical question. If you define a test for
the “main” procedure, how are you providing the values for the IN
arguments of each program that main calls?

So, instead, create distinct tests for each subprogram. Then assemble
all the tests into a single suite. You then run the suite, which
tests all the programs.

You can specify the order of execution of tests within a suite; this
is documented in Help.

Does this clarify matters?

Regards, Steven


#3

Benny,

Mr Feuerstein beat me to the punch here, and said pretty much what I would have.

I can only add that as a newbie, in general, it is wise to “start small and work up”. Cut your teeth on writing and running tests for a simple function or procedure, and use that to familiarise yourself with the GUI etc.

That way, once you can take familiarity with the test tool for granted (which will take some little time) you can then concentrate on the testing process, instead of wrestling with the fundamental mechanics of operating the tool itself.

Also, since packages are intended to group or contain functionally associated items, I am suspicious of a “main” function. It sounds ominously like a translated C program to me, and so I wonder what the business process is here. Database packages are usually invoked by a client program of some sort, they don’t usually just get launched once and run to completion (unlike drop-through C code).

Regards

John H


#4

Hi Steven and John,
thanks for replying. I am able to execute my tests by ordering the execution now.
Hopefully there will be enhancement to make the ordering of execution more visible in the UI.

Btw John, the package I developed is a batch job to be run daily, so the way it gets called is by calling the main procedure in the package.

Best Regards,
Benny


#5

Benny,

In CT2, due out this Fall, you will be able to explicitly order execution through the UI.

Regards, SF


#6

stevenfeuerstein wrote:

With Code Tester, you define tests for the specific subprogram of
your package.
[/quote]

Which means that these subprogram have to be “public”. Most of the (or at least my) subprograms are private and thus not accessable/testable from the outside.
So at least for the testing period you have to make everything public, right?

Regards
Keyan

P.S.: Sorry for putting my text into your quote. I find the forum editor quite “suboptimal”


#7

This is correct, Keyan.

SF