In this section:
The ability to generate safe, realistic data can remove barriers to maintaining or increasing your testing velocity. As your data repositories become heavy with robust test data, it may be prudent to target specific types of data to be used in specific stages of the testing lifecycle.
In this section, we will cover how to subset data in the Test Data module. The subset functionality creates a copy of the repository using only the values specified in the data constraint settings.
You should have completed the previous chapters in this tutorial:
You can alternatively follow this tutorial using an existing data repository.
The constraint describes the boundaries of the data. We can configure the constraints to define the subset of balances that only have negative values, for example.
Click on the Models tab and search for the BALANCE member associated with the customer_id result set.
Searching may be easier if you change the display name to something more meaningful. See Exploring the Model for additional information. |
-1000
and the Maximum value to 0
. This configures the constraints to only allow negative values.Testing the integrity of the data against the constraints is a helpful diagnostic step when fine-tuning your repository. No action is required in this instance because we are aware that there are values outside of the constraint. Click the x button to close the message.
After configuring and verifying the data constraint settings, we can generate the subset repository and review the data.
You can also switch to the ParabankDB_masked_generated_subset repository in your virtual asset configurations and view the records in ParaBank.
You now have a repository that can be used for testing negative values. You can subset the data any number of ways using the data constraints and the Subset Data functionality.
We recommend creating an export of your repository before modifying the data so that you have initialized repository to import if necessary. You can either import to an existing repository, which overwrites the data, or create an empty repository for importing data.
You can use the export functionality to create snapshots of the repository so that you can manipulate the data and safely return to an initial state.