Example: Order Management System

This article includes an example scenario that helps you achieve the following objectives:
tdm46
This article includes an example scenario that helps you achieve the following objectives:
  • How Test Data Engineers (TDEs) can create test data models and can share them with testers as forms.
  • How testers can access and use the applicable forms that are shared with them to find and reserve the test data.
 The example in this article uses the Northwind sample database that is available for Microsoft SQL Server. Refer to the Microsoft website to download the Northwind sample database.
You can find a more detailed guide to the Find & Reserve Test Data Model creation process here: Create and Edit a Find & Reserve Test Data Model.
The page covers the following topics:
2
2
Scenario
Peter and Joe work at the same company. Peter is a
TDE
, and Joe is a
tester
.
Joe's current assignment is to test an Order Management application. The data for the Order Management application is spread across the following tables in the Microsoft SQL Server database:
  • Orders
  • Shippers
  • Customers
  • Categories
  • Order Details
  • Region
  • Territories
  • Suppliers
  • Products
The Order Management application uses three environments: Staging, UAT, and Pre-Production. Each environment includes a separate instance of the Microsoft SQL Server database, with different data in each instance. The following illustration shows the high-level architecture:
Order Management System Model-Based Tester Self-Service
Order Management System Model-Based Tester Self-Service
Joe (tester) needs on-demand access to the data so that he can find the right test data and reserve it. He wants to have complete control over the filter criteria that he wants to specify to find the data. He also wants to review the data that is retrieved based on his criteria. And, finally, he wants to reserve the data if he is satisfied with the result. For example, Joe wants the fields that give him the flexibility of finding the following type of data:
  • Find all the orders based on the shipping city.
  • Find all the orders based on the shipping postal code.
  • Find all the orders based on the shipping region
  • Find all the orders based on the unit price.
  • Find all the orders based on the discount.
  • Find all the orders based on the quantity.
  • Find the order information based on the order ID.
Peter (TDE) helps Joe perform all these tasks. Peter creates a Find & Reserve Test Data Model named Orders. Peter aggregates the required data elements from the database (for the selected environment) into the Orders Find & Reserve Test Data Model. Peter also ensures that he includes and exposes data elements in the Find & Reserve Test Data Model that are relevant to the business requirement of Joe. Joe can then use the exposed data elements to specify the data criteria, find the relevant test data, and reserve it.
Prerequisites
As a TDE, Peter needs to do the following:
  • Create the appropriate project (Orders) and version (1.0) in the CA TDM Portal. 
    For more information about how to create a project and version, see Create and Edit Projects.
  • Create the connection profile (Order_SQLServer) to connect to the Microsoft SQL Server data source.
    For more information about how to create a connection profile, see Create and edit Connection Profiles.
  • Share the connection profile (Order_SQLServer) with Joe (tester).
High-Level Process
Peter (TDE) performs the following TDE tasks:
  1. Create three environments—Staging, UAT, and Pre-Production.
  2. Create the Orders test data model by following these steps:
    1. Select the Staging environment.
    2. Specify the model key for the test data model.
    3. Add different data elements to the test data model.
    4. Specify associations between entities while adding data elements to the test data model.
    5. Save the Orders test data model.
  3. Enable the Orders test data model for testers.
Joe (tester) performs the following tester tasks:
  1. Access the Self-Service Catalog section.
  2. Identify the Orders form.
  3. Select the environment.
  4. Specify the filter requirements for the data by using the available fields in the form.
  5. Review the retrieved test data.
  6. Reserve the test data if the test data meets the requirements.
Create Environments
Peter (TDE) creates three environments—Staging, UAT, and Pre-Production. Each environment contains a separate instance of the Microsoft SQL Server database. Each instance is available on a different server with different data.
For more information about environments, see Configure Dynamic Test Data Reservation Service.
Follow these steps:
  1. Access the CA TDM Portal as a TDE.
  2. Select the
    Order
    project and version
    1.0
    from the
    Project
    drop-down list.
  3. Expand
    Modeling
    in the left pane.
  4. Click
    Environments
    .
  5. Click
    New Environments
    .
  6. Enter the name and description information as follows:
    • Name:
      Staging
    • Description:
      This is a staging environment.
  7. Map the data source with the corresponding connection profile as follows:
    • Data Source Name:
      SQLServer,
      Connection Profile:
       Order_SQLServer
    The data source names remain the same for the other two environments. That is, once you save the data source name for the first environment, you cannot change it for other environments in the same project version.
  8. Click
    Save
    .
    The Staging environment is added to the
    Environments
    page.
Repeat the same steps to create the UAT and Pre-Production environments. The final list on the
Environments
page looks like the following screen shot:
Environments_For_Test_Data_Model.png
Create the Orders Test Data Model
After Peter (TDE) creates the required environments, he proceeds to create the Orders test data model using the Staging environment. He follows the same steps to create test data models using other environments, as required.
To meet the data requirement of Joe, Peter needs to add specific data elements to the test data model. Peter uses three entities—Orders, Order Details, and Products—from the Microsoft SQL Server database to add the appropriate data elements. From the Orders entity, Peter adds the following items:
  • OrderID as a model key
  • ShipCity
  • ShipPortalCode
  • ShipRegion
From the Order Details entity, Peter adds the following items:
  • Discount
  • Quantity
From the Products entity, Peter adds the following item:
  • UnitPrice
For more information about test data models, see Configure Dynamic Test Data Reservation Service.
Follow these steps:
  1. Access the CA TDM Portal as a TDE.
  2. Select the 
    Order
     project and version 
    1.0
     from the 
    Project
     drop-down list.
  3. Expand 
    Modeling
     in the left pane.
  4. Click
    Find & Reserve
    .
  5. Click
    New Test Data Model
    .
  6. Specify the name and description as follows, and click
    Next
    :
    • Name:
      Orders
    • Description:
      This test data model is for the Order Management application.
  7. Select the environment as Staging from the list.
    The
    Build Test Data Model: Select Model Key
    page opens. 
  8. Add the model key (OrderID) to the Orders test data model as follows:
    1. Expand the Orders entity, select OrderID as your model key for this test data model, and click the forward arrow to add it to the test data model.
      The
      Add Orders 
      dialog opens. This dialog lets you add the parent root entity (Orders) of the OrderID data element, because the parent entity Orders is not already added to the test data model. This dialog does not appear again if you try to add another data element from the already added entity (Orders in this case).
    2. Verify the entity name as Orders and the data source value as SQLServer.
    3. Click
      Next
      .
      The 
      Add Orders.OrderID
      dialog opens. This dialog lets you add the model key.
    4. Verify the model key name as OrderID. 
    5. Verify that the
      Display in Tester Self Service
      option is selected, because you want to display this data element to testers.
    6. Click
      Save
      .
      The Orders entity and OrderID model key are added to the test data model.
    7. Click
      Next
      .
      The
      Build Test Data Model: Select Data Elements
      page opens.
  9. Add other required data elements from the Orders entity to the Orders test data model as follows:
    ShipCity
    1. Select ShipCity and click the forward arrow.
      The
      Add Orders.ShipCity
      dialog opens, because the related parent entity Orders is already added to the test data model.
    2. Enter the name as Ship_City.
    3. Select the display type as Text Box. 
    4. Verify that the display option is selected.
    5. Click
      Save
      .
      The ShipCity data element is added under the Orders entity with the display name as Ship_City.
    ShipPostalCode
    1. Select ShipPostalCode and click the forward arrow.
      The
      Add Orders.ShipPostalCode
      dialog opens, because the related parent entity Orders is already added to the test data model.
    2. Enter the name as Ship_Postal_Code.
    3. Select the display type as Text Box. 
    4. Verify that the display option is selected.
    5. Click
      Save
      .
      The ShipPostalCode data element is added under the Orders entity with the display name as Ship_Postal_Code.
    ShipRegion
    1. Select ShipRegion and click the forward arrow.
      The
      Add Orders.ShipRegion
      dialog opens, because the related parent entity Orders is already added to the test data model.
    2. Enter the name as Ship_Region.
    3. Select the display type as Text Box. 
    4. Verify that the display option is selected.
    5. Click
      Save
      .
      The ShipRegion data element is added under the Orders entity with the display name as Ship_Region.
  10. Add other required data elements from the Order Details entity to the Orders test data model as follows:
    Quantity
    1. Select the Quantity data element from the Order Details entity and click the forward arrow to add. 
      The
      Add Order Details 
      dialog opens in this case, because the parent entity (Order Details) for the Quantity data element is not already added to the test data model.
    2. Verify the entity name as Order Details and the data source value as SQLServer.
    3. Select Orders from the
      Association From
      drop-down list and One_Many from the
      Association Type
      drop-down list.
    4. Select OrderID from the
      Orders 
      drop-down list and OrderID from the
      Order Details
      drop-down list. 
    5. Click Next.
      The
      Add Order Details.Quantity
      dialog opens. 
    6. Verify the data element name as Quantity. 
    7. Verify that the 
      Display in Tester Self Service
       option is selected.
    8. Click
      Save
      .
      The Quantity data element and its related parent entity Order Details are added to the test data model.
    Discount
    1. Select Discount and click the forward arrow.
      The
      Add Order Details.Discount
      dialog opens, because the related parent entity Order Details is already added to the test data model.
    2. Verify the name as Discount.
    3. Verify that the display option is selected.
    4. Click
      Save
      .
      The Discount data element is added under the Order Details entity with the display name as Discount.
  11. Add other required data element from the Products entity to the Orders test data model as follows:
    Unit Price
    1. Select the UnitPrice data element from the Products entity and click the forward arrow. 
      The 
      Add Products 
      dialog opens in this case, because the parent entity (Products) for the Unit Price data element is not already added to the test data model.
    2. Verify the entity name as Products and the data source value as SQLServer.
    3. Select Order Details from the 
      Association From
       drop-down list and One_Many from the 
      Association Type
       drop-down list.
    4. Select ProductID from the 
      Order Details
       drop-down list and ProductID from the
      Products 
      drop-down list. 
    5. Click Next.
      The
       Add Product.UnitPrice
       dialog opens. 
    6. Enter the data element display name as Unit_Price. 
    7. Verify that the 
      Display in Tester Self Service
       option is selected.
    8. Click 
      Save
      .
      The Unitprice data element (with the display name as Unit_Price) and its related parent entity Product are added to the test data model.
  12. Review the final structure of the Orders test data model. The following screen shot shows the Orders test data model that Peter has created:Test_Data_Model.png
  13. Click
    Finish
    .
    The Orders test data model is created and is added to the
    Test Data Model
    page.
Enable the Orders Test Data Model
Peter (TDE) wants to display the Orders test data model to Joe so that Joe can use it and can get started with the process of finding and reserving the data.
Follow these steps:
  1. Access the CA TDM Portal as a TDE.
  2. Select the 
    Order
     project and version 
    1.0
     from the 
    Project
     drop-down list.
  3. Expand 
    Modeling
     in the left pane.
  4. Click 
    Test Data Models
    .
    The
    Test Data Model
    page opens.
  5. Identify the row that includes the Orders test data model.
  6. Locate the
    Display to Tester
    column for the identified row and switch the value to
    Yes
    .
    The Orders test data model now becomes available in the Self-Service Catalog section.
Find and Reserve the Test Data Using Orders 
To access the Orders test data model as a form, Joe (tester) accesses the Self-Service Catalog section of the Portal. Joe then uses the exposed data elements to define the test data requirements, reviews the received data, and reserves the data.
For more information about finding and reserving the test data, see the tester self-service section.
Follow these steps:
  1. Access the CA TDM Portal as a tester.
  2. Select the 
    Order
     project and version 
    1.0
     from the 
    Project
     drop-down list.
  3. Click
    Self Service Catalog
    in the left pane.
    The
    Self Service Catalog
    page opens.
  4. Locate the
    Orders
    catalog.
  5. Click the
    New Request
    button.
    The
    Orders
    page opens.
  6. Select Staging as an environment from the
    Environment
    drop-down list.
  7. Enter the test data filter criteria in the available fields as required. See the find data example screen shots to understand the data filter criteria that Joe has used.
  8. Click the
    Find Data
    button.
    The Portal uses the defined filter criteria, retrieves the data from the applicable data source, and displays the retrieved data.
    Note:
    Currently, only those data elements from the root entity that are added to the test data model are displayed in the Portal. 
  9. Review the displayed data and click the tick mark to select the records that you want to reserve. In this case, Joe reserves the three rows that he has received by specifying the filter criteria as Discount (50), Quantity (2), and Ship_Region (TX). The rows with the OrderID values 182201, 713546, and 728492 are selected
    The
    Add to Reservation 
    button is enabled.
  10. Click the
    Add to Reservation
     button.
    All selected records are added to the cart. The cart icon (basket) at the top of the table is enabled and displays the number of records that are added to it.
  11. Click the
    Complete Reservation
    button or the cart icon.The
    Items added to Reservation
    dialog opens.
  12. Enter Orders_Staging_Reservation in
    Reservation Name
    .
  13. Review the records added to the cart and click
    Reserve
    .A message states that the Orders_Staging_Reservation reservation request is submitted successfully. 
  14. Click the
    Orders_Staging_Reservation
     link in the message.
    The
    My Reservations
    page opens. This page lists all the data reservations. 
  15. Identify and click the
    Orders_Staging_Reservation
     reservation.
    The
    Orders_Staging_Reservation
     page opens. This page displays relevant information about the reservation. For example, environment name, test data model name, project name, version name, number of records reserved, status of the reservation. The page also displays the model keys of the records that have been reserved. The following screen shot shows the 
    Orders_Staging_Reservation
    page:
    Reservation_Staging.png
  16. Review the reservation status as
    Success
    .
  17. (Optional) To download the reserved model keys as a CSV file, click the Download Model Keys as CSV icon (down arrow) next to
    Model Keys
    , specify the required details, and save the file.
  18. Open the file to review that all the reserved model keys are available in the file.
Joe has successfully retrieved, analyzed, and reserved the test data.
Example Screen Shots—Find Data
The screen shots in this section show some examples of the test data that Joe tries to find. Depending on his requirement, he can enter the filter criteria in the available fields and can get the required data.
Find all the test data
In this case, Joe does not provide any criteria to filter the data. He leaves all the fields empty. Joe receives all the test data that is available in the data source for the selected environment.
All_Test_Data_43.png
Find the data based on some conditions
In this case, Joe wants to find orders that include the discount value as 50, quantity as 2, and the shipping region as TX. Joe gets three records that meet the filter criteria:
Discount_Region_Quantity_43.png
The following screen shot shows the data that is retrieved when Joe specifies the unit price value as 444:
Unit_Price_43.png