Bỏ qua

DATAMIMIC Model

The DATAMIMIC model is the fundamental component of DATAMIMIC that defines how to generate, process and obfuscate test data. It consists of two primary types of models: the 'Configuration Model' and the 'Data Definition Models'.

Configuration Model

The Configuration Model serves as the foundation for your DATAMIMIC project. It encompasses various settings and configurations that are project-wide and system-specific. Key elements of the 'Configuration Model' include:

  • <setup>: Root element containing project-wide configuration details.
  • <database>: Configuration for relational database environments.
  • <mongodb>: Configuration for MongoDB environments.
  • <include>: Inclusion of external files for system configuration.
  • Other system-level settings and configurations.

The 'Configuration Model' also referred to as 'Base Model' is essential for setting up and configuring the connected systems, including defining system connections, specifying environmental parameters, and including external configuration files.

Data Definition Models

Data Definition Models, often referred to as 'Processing Models', encompass all elements related to data generation, obfuscation, and processing. These models are responsible for specifying how the test data should be generated, transformed, or obfuscated. Key elements within Data Definition Models include:

  • <generate>: Defines data generation tasks, including key fields, variables, and references.
  • <key>: Specifies key fields and their generation methods.
  • <nestedKey>: Specifies nested key fields and their generation methods within a data generation task. Nested keys can further define complex data structures and relationships, such as lists and dictionaries, allowing for the creation of intricate data patterns and structures.
  • <variable>: Defines variables used in data generation.
  • Other elements and configurations for data manipulation.

Data Definition Models allow you to define the rules and logic for generating and processing test data. They are essential for creating realistic and diverse datasets to suit your testing needs.

Combined Models

All elements of 'Data Definition Models' may also be used in the 'Configuration Model' (i. e. 'Base Model'). If your projects increase, we highly recommend to keep the logical separation between these two model types.

Example

Here's a simplified example of a DATAMIMIC model showcasing both the Configuration Model and Data Definition Models:

1
2
3
4
5
6
7
8
<!-- Configuration Model -->
<setup>
    <!-- ... Configuration settings ... -->
    <include uri="conf/base.properties"/>

    <include uri="1_prepare.xml"/>
    <include uri="2_generate.xml"/>
</setup>
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
<!-- Data Definition Model -->
<setup>
    <generate name="datamimic_user_list" count="100" target="CSV">
        <!-- ... Data generation configurations ... -->
        <variable name="person" entity="Person(min_age=16, max_age=90, female_quota=0.5)"/>
        <key name="id" generator="IncrementGenerator"/>
        <key name="first_name" script="person.given_name"/>
        <key name="last_name" script="person.family_name"/>
    </generate>
</setup>