Chapter 10 Generating a Database from a PDM


Generating test data

You can generate test data for all the tables in a PDM, or for selected tables.

You can generate data for either an empty database or for an existing database.

Note   Avoid generating triggers
Do not implement triggers if you generate a new database. It is also recommended that you remove triggers from an existing test database. Triggers can considerably increase the time required to generate the database and can block insertions. In addition, they are not needed for the type of test we are performing.

Steps To generate test data:

  1. Assign data profiles to the columns in each table for which you want to generate test data (see "Assigning a data profile").

    Note   Default values for data profiles
    Test data generation is typically based on user-defined data profiles. If you have no data profile definitions, you are automatically provided with default values. The default number of rows is set to 20 and the value <default> appears in each of the following three default profile boxes.

  2. Select Database→Generate Test Data to open the Test Data Generation dialog box .
  3. Specify a directory and filename for your test data file, and then choose between Script and ODBC generation. For more information about these options, see "Test Data Generation General tab".
  4. [optional] If you want to change the number of rows to be generated for specific tables, then click the Number of Rows tab. For more information about these options, see "Test Data Generation Number of Rows tab".
  5. [optional] If you want to modify the generation options, then click the Options tab. For more information about these options, see "Test Data Generation Options tab".
  6. [optional] If you want to control which tables will have test data generated, then click the Selection tab. For more information about these options, see "Test Data Generation Selection tab".
  7. Click OK to start the generation.

    If you are generating a test data script : then a Result dialog box asks you if you want to Edit or Close the newly generated file.

    If you are generating test data through an ODBC connection , then a Connect to an ODBC Data Source dialog box opens.


    Select a Machine data source or a File data source, and click Connect.

    A message in the Output window indicates that the test data generation is completed.

 


Copyright (C) 2005. Sybase Inc. All rights reserved.