Home > SQL Developer: Unit Testing > Overview of Unit Testing
The SQL Developer unit testing framework involves a set of sequential steps for each test case. The steps are as follows, including the user input for before the step is run and the framework activities for the step while the test is being run.
Identify the object to be tested.
User Input: Identify the object, such as a specific PL/SQL procedure or function.
Framework Activities: Select the object for processing.
Perform any startup processing.
User Input: Enter the PL/SQL block, or enter NULL for no startup processing.
Framework Activities: Execute the block.
Run the unit test object.
User Input: (None.)
Framework Activities: Execute the unit test.
Check and record the results.
User Input: Identify the expected return (result), plus any validation rules.
Framework Activities: Check the results, including for any validation, and store the results.
Perform any end processing (teardown).
User Input: Enter the PL/SQL block, or enter NULL for no teardown activities.
Framework Activities: Execute the block.
For each test, you enter the information called for in the preceding steps, to create a test case. A unit test is a group of test cases (one or more) on a specific PL/SQL object.
Each test case is an implementation. Each unit test has at least one implementation (named Default by default); however, you can add one or more other implementations. For example, you can have implementations that test various combinations of parameter values, including those that generate exceptions.
When a unit test is run, each implementation is run one after the other. Each implementation runs the startup action (if any) for the test, then the test implementation itself, and then the teardown action (if any). The difference between implementations is in the values of the calling arguments. Any dynamic value query (explained in Using a Dynamic Value Query to Create a Unit Test) is evaluated before the execution of all of the implementations, including before any startup action.
You can group unit tests into a test suite to be run as a grouped item, and the test suite can have its own startup and end processing in addition to any specified for test cases and unit tests.
To learn more about unit testing with SQL Developer, take whichever approach suits your preference:
Go to Example of Unit Testing (Tutorial) and follow the steps, and then return to read the remaining conceptual information under SQL Developer: Unit Testing.
Read the remaining conceptual information under SQL Developer: Unit Testing, finishing with Example of Unit Testing (Tutorial).