Help Center > > User Guide> MySQL Database Management> Data Scheme> Generating Test Data

Generating Test Data

Updated at: Mar 20, 2020 GMT+08:00

Scenarios

During the functional testing of a program, a large amount of test data needs to be inserted into the database, and the generated test data should comply with specific rules. DAS allows you to create automated test data generation tasks based on specific rules, making your test data generation efficient.

Prerequisites

You have logged in to the DAS console.

Method 1

  1. On the top menu bar, click Data Plan and choose Generate Test Data.
  2. On the displayed page, click Create Task. In the displayed dialog box, enter the target database name and table name and click OK.
  3. In the displayed Create Test Data Generation Task dialog box, set the rule for generating each column, the number of rows to be generated, and the conflict handling method.

    • Generated rows

      The maximum number of generated rows is 1,000,000.

    • Conflict

      If you select Ignore, the system skips the row that contains the conflicts and continues processing subsequent rows. If you select Replace, the system deletes the rows that are causing the conflicts prior to inserting data. If a conflict occurs when a row with the same primary key value is inserted, the original rule will be replaced.

    • Generation type
    • You can set the rules for randomly generated data based on the column settings. For example, if the column type is time, you can set the start time, end time, and format, or set the value to the current time.

  4. Click Preview to check whether the generated data meets your demand and adjust the generation rule.

    Click Generate.

  5. In the task list, view details about the generated tasks in the table. You can also delete the task as required.

Method 2

  1. In the navigation tree on the left, right-click the target database node and choose Data Scheme > Generate Test Data from the shortcut menu.
  2. On the displayed Create Test Data Generation Task page, set the rules for automatically generating test data.

    • Generated rows

      The maximum number of generated rows is 1,000,000.

    • Conflict

      If you select Ignore, the system skips the row that contains the conflicts and continues processing subsequent rows. If you select Replace, the system deletes the rows that are causing the conflicts prior to inserting data. If a conflict occurs when a row with the same primary key value is inserted, the original rule will be replaced.

    • Generation type
    • You can set the rules for randomly generated data based on the column settings. For example, if the column type is time, you can set the start time, end time, and format, or set the value to the current time.

  3. Click Preview. By default, 100 data records are displayed. You can check whether the generated data meets your demand and adjust the generation rule. Then, click Close.

    Click Generate.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel