Auto-generating tests
Test Organizer module includes a mechanism for autogenerating tests for any object. It allows for automating the process of test creation and reducing time on manual test creation and setting parameter values.
To create a test automatically go to the context menu of the Source tree and select the Auto-generate tests option (Figure 1).
Note: By default, the name of an autogenerated test is <Source object name>$<Abbreviated template name>.
Figure 1. Autogenerating action
The DB Best Migration Platform has a set of templates that you can use to generate tests:
- Call template — is used to auto-generate tests for the Procedure, Function, Package function, and Packaged procedure objects
- Select template — is used to auto-generate tests for the Table and View objects.
- Insert/Update/Delete templates — is used to auto-generate tests for the Table object only.
Note: You can’t use the empty template for autogenerating tests.
Group hierarchy of generated tests
The generated tests are combined into groups according to the following logic:
For the schema level:
- AG_<Schema name>
- AG_<Category name>
- Groups and tests
- AG_<Category name>
- Groups and tests
- AG_<Category name>
For the category level:
- AG_<Category name>_Tests
- <Category name>_<Template name>
- Tests of the category and template
- <Category name>_<Template name>
- Tests of the category and template
- <Category name>_<Template name>
For a package:
- Pckg_<Package name>_Tests
- Pckg_Function_Tests
- Tests
- Pckg_Procedure_Tests
- Tests
- Pckg_Function_Tests
Tests auto-generation settings
Use the settings feature for tests auto-generation to generate tests in 3 different ways:
- sort test groups by object type, test template, object name;
- create tests with user-defined row limit or without the limit;
- generate tests for database code objects using desired strategy and parameter inputs.
Didn’t find the answer?
You can report problems, ask questions or share ideas for improvements on our email [email protected].