IP Library Granted Patent US 10,031,936
Granted Patent B2
US 10,031,936 · App. 14/881,187 · Granted Jul 24, 2018

Database table data fabrication

Inventors: Akram Bitar (Kfar Peqiin, IL); Oleg Blinder (Haifa, IL); Ronen Levy (Haifa, IL); Tamer Salman (Haifa, IL)
Assignee: International Business Machines Corporation
G06F17/30371G06F17/30339
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,031,936
App. No.
14/881,187
Granted
Jul 24, 2018
Kind
B2
Abstract

Methods, computing systems and computer program products implement embodiments of the present invention that include receiving a request to fabricate, for a database including multiple tables, a respective target number of data records for each of the tables, and receiving one or more intra-database rules for the multiple tables. Examples of the intra-database rules include cross-record rules and cross-table rules. Upon identifying one or more referential integrity constraints for the multiple tables, the respective target number of data records for each of the multiple tables are fabricated in response to the request. In embodiments of the present invention, the fabricated data records comply with the one or more referential integrity constraints and the one or more intra-database rules.

Claims (62)

1. A method of generating test data for a database, comprising:

receiving, by a processor, a request to fabricate, for a database comprising multiple tables, a respective target number of data records for each of the tables;

receiving one or more intra-database rules for the multiple tables;

identifying one or more referential integrity constraints for the multiple tables; and

fabricating, in response to the request, the respective target number of data records for each of the multiple tables, the fabricated data records complying with the one or more referential integrity constraints and the one or more intra-database rules,

wherein fabricating the data records comprises repeatedly performing:

determining a current count of data records in each of the tables,

calculating, for each of the data tables, a completeness factor based on their respective current and target counts, and

upon the completeness factor of at least one of the tables indicating the multiple data tables not comprising their respective target number of data records:

selecting a given data table having the lowest completion factor,

identifying parent tables from the multiple tables, that are connected in a path of foreign key to primary key paths to the selected given data table;

tagging the given data table with a first tag value;

tagging each of the identified parent tables with either the first tag value or a second tag value, responsive to a relation between the completeness factors of the parent tables and of corresponding child tables;

creating a constraint satisfaction problem for the tagged tables;

solving the constraint satisfaction problem in a manner which generates a new record for the tables tagged with the first tag value and uses existing records of tables tagged with the second tag value; and

writing the generated new records into the corresponding tables.

2. The method according to claim 1 , wherein each of the intra-database rules is selected from a group consisting of a cross-table rule and a cross-record rule.

3. The method according to claim 1 , wherein the tables in the database comprise multiple cardinalities, and wherein the database comprises multiple topologies.

4. The method according to claim 1 , wherein tagging each of the identified parent tables comprises tagging an identified parent table with the first tag value upon detecting that the respective completeness factor of the identified parent table is equal to or within a predefined range of a respective completeness factor of a child table of the identified parent table.

5. The method according to claim 4 , and comprising tagging the identified parent table with the second tag value upon determining that the respective completeness factor for the identified parent table indicates the identified parent table comprising its respective target number of data records or upon detecting that the respective completeness factor of the identified parent table is not in accordance with the respective completeness factor of the child table of the identified parent table.

6. An apparatus for generating test data for a database, comprising:

a storage device configured to store multiple tables in a database; and

a processor configured:

to receive a request to fabricate a respective target number of data records for each of the tables,

to receive one or more intra-database rules for the multiple tables,

to identify one or more referential integrity constraints for the multiple tables, and

to fabricate, in response to the request, the respective target number of data records for each of the multiple tables, the fabricated data records complying with the one or more referential integrity constraints and the one or more intra-database rules,

wherein fabricating the data records comprises repeatedly performing:

determining a current count of data records in each of the tables,

calculating, for each of the data tables, a completeness factor based on their respective current and target counts, and

upon the completeness factor of at least one of the tables indicating the multiple data tables not comprising their respective target number of data records:

selecting a given data table having the lowest completion factor,

identifying parent tables from the multiple tables, that are connected in a path of foreign key to primary key paths to the selected given data table;

tagging the given data table with a first tag value;

tagging each of the identified parent tables with either the first tag value or a second tag value, responsive to a relation between the completeness factors of the parent tables and of corresponding child tables;

creating a constraint satisfaction problem for the tagged tables;

solving the constraint satisfaction problem in a manner which generates a new record for the tables tagged with the first tag value and uses existing records of tables tagged with the second tag value; and

writing the generated new records into the corresponding tables.

7. The apparatus according to claim 6 , wherein each of the intra-database rules is selected from a group consisting of a cross-table rule and a cross-record rule.

8. The apparatus according to claim 6 , wherein the tables in the database comprise multiple cardinalities, and wherein the database comprises multiple topologies.

9. The apparatus according to claim 6 , wherein the processor is configured in tagging each of the identified parent tables to tag an identified parent table with the first tag value upon detecting that the respective completeness factor of the identified parent table is equal to or within a predefined range of a respective completeness factor of a child table of the identified parent table.

10. The apparatus according to claim 9 , wherein the processor is configured to tag the identified parent table with the second tag value upon determining that the respective completeness factor for the identified parent table indicates the identified parent table comprising its respective target number of data records or upon detecting that the respective completeness factor of the identified parent table is not in accordance with the respective completeness factor of the child table of the identified parent table.

11. A computer program product, the computer program product comprising:

a non-transitory computer readable storage medium having computer readable program code embodied therewith, the computer readable program code comprising:

computer readable program code configured to receive a request to fabricate, for a database comprising multiple tables, a respective target number of data records for each of the tables;

computer readable program code configured to receive one or more intra-database rules for the multiple tables;

computer readable program code configured to identify one or more referential integrity constraints for the multiple tables; and

computer readable program code configured to fabricate, in response to the request, the respective target number of data records for each of the multiple tables, the fabricated data records complying with the one or more referential integrity constraints and the one or more intra-database rules,

wherein fabricating the data records comprises repeatedly performing:

determining a current count of data records in each of the tables,

calculating, for each of the data tables, a completeness factor based on their respective current and target counts, and

upon the completeness factor of at least one of the tables indicating the multiple data tables not comprising their respective target number of data records:

selecting a given data table having the lowest completion factor,

identifying parent tables from the multiple tables, that are connected in a path of foreign key to primary key paths to the selected given data table;

tagging the given data table with a first tag value;

tagging each of the identified parent tables with either the first tag value or a second tag value, responsive to a relation between the completeness factors of the parent tables and of corresponding child tables;

creating a constraint satisfaction problem for the tagged tables;

solving the constraint satisfaction problem in a manner which generates a new record for the tables tagged with the first tag value and uses existing records of tables tagged with the second tag value; and

writing the generated new records into the corresponding tables.

12. The computer program product according to claim 11 , wherein each of the intra-database rules is selected from a group consisting of a cross-table rule and a cross-record rule.

13. The computer program product according to claim 11 , and comprising computer readable program code configured to tag an identified parent table with the first tag value upon detecting that the respective completeness factor of the identified parent table is equal to or within a predefined range of a respective completeness factor of a child table of the identified parent table.

14. The method according to claim 1 , wherein creating the constraint satisfaction problem for the tagged tables comprises for each table tagged with the second tag value, fetching a random sample of unique k records from the table and defining for each of the k records, a value-tuple CSP constraint.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 13, 2015
From: BITAR, AKRAM; BLINDER, OLEG; LEVY, RONEN; SALMAN, TAMER
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 036777/0004 →
Continuity (1)
Related Publication 20170103099A1 · Apr 13, 2017