I think one of the most frustrating outcomes for all parties involved in a software release is when a release breaks something that was previously working.

With the latest release of Toad for Oracle you can quickly and easily add and save tests while you work on your PL/SQL code.

  1. To start, open the object in your Editor and debug it.


  1. Once debugged open the PL/SQL Results tab in the Script Output section and click the Create Unit Test


  1. Specify a Test Definition; this is a collection of tests related to the PL/SQL object.
    Create or select a Test Definition and then give the Test Case a meaningful name.
    Click OK and the test case has been saved into the Code Tester repository


The Code Tester repository is a schema residing on the same Oracle instance as the objects you are testing, so when you backup your database instance the related tests are also backed up. They can also be added to version control system so the correct version of the tests are saved with the corresponding version of the PL/SQL object.

  1. Now you, or anyone on your team, can call the saved Test Cases any time you make a change to the object.
    To do so click on the Execute Code Tester Tests button on the Editor screen.


  1. Select the Test Definition or Test Cases you wish to run and click OK.


  1. And that’s it done! Presuming they have all executed successfully, you have the peace-of-mind that you haven’t broken a test that was previously working.



For more help check out this quick video on how to add regression testing of PL/SQL code:

Related Content