Setting weightage values

You can set weightage values for an item type to determine how often the value of that item type can be displayed in the generated test data.

Before you begin

  • You must have a project and a schema.
  • You must have created a weightage file that can be of CSV or Microsoft Excel Open XML format.
    Note: The weightage file consists of one column for values of item types and another column for weightage values for each item type value. The weightage values must be integers.

About this task

The property of weightage values is set as a restriction on an item type. The probability to get higher accuracy increases in the results of the weightage values in the following scenarios:
  • When HCL® OneTest Data processes a large amount of data.
  • When there is a large difference between the weightage values.
Computation of weightage value

The probability of occurrence of any item type value in the generated test data can be computed by using the following formula:

Probability of occurrence of any item type value = Weight of each item type value / Total weight of all the item type values

The following table shows an example when you have a weightage file with five item type values and its corresponding weightage values:

Item type values Weightage values
Red 50000
Blue 5000
Green 500
Orange 50
Purple 5

The total weightage value of all the item type values = 50000 + 5000 + 500 + 50 + 5 = 55555.

The probability of occurrence of each item type value in the generated test data can be computed as shown in the following table:

Item type values Probability of occurrence Computed values
Red 50000/55555 0.9
Blue 5000/55555 0.09
Green 500/55555 0.009
Orange 50/55555 0.0009
Purple 5/55555 0.00009

From the computed values, Red has a higher probability value than other colors.

When you use this weightage file to set the weightage value for any specific item type and generate the test data, then you can find the generated test data with more occurrences of Red as compared to the other colors.

Procedure

  1. Log in to HCL OneTest Server and open the team space that contains your project.
  2. Open your project.
    The Overview page is displayed.
  3. Click Author > Data Fabrication.
    The Data Fabrication page is displayed.
  4. Click Files and import the weightage file from the local file system into your project.
  5. Open your schema from the Schemas tab.
  6. Select the item type on which you want to apply the weightage value.
  7. Select Restrictions from the Item Properties drop-down list of the Properties dialog.
  8. Enable the Values from file toggle button.
  9. Provide the name of the weightage file in the Values file field.
  10. Enter the column number in Values column number and Weights column number.
  11. Click Save.
  12. Select the group and generate the test data.

Results

You can view more occurrences of the values that are set with higher weightage values as a result of the test data generation.

What to do next

You must prepare the structural view of the schema. See Designing a structural view of the schema.