Test Advisor Instructions
The Test Case and Test Data Advisors have algorithms to generate test data for different types of fields.
Test Advisor Instructions can be used to modify, or override these algorithms. Test Advisor Instructions are entered by editing a Project and choosing the 'Test Advisor Configuration' tab.
Settings
Overall settings, which will impact all relevant fields, can be specified using the 'Settings' heading.
1Settings:
2 base_date: "2000-01-01"
3 date_increment: 10
4 log_records: 3
The Settings section is optional and each setting within it is optional. The settings are:
base_date: The date from which values for date fields will be calculated. The default is two years before the current date.
date_increment: (Test Data Advisor only). The Test Data Advisor will generate ascending values for a date field. The default is to increment the date by 1 day for each new value. This setting will change the increment to the specified number of days.
log_records: (Test Data Advisor only). The Test Data Advisor will generate the specified number of log records for each log form.
Important
The indentation and spacing of lines in the Instructions is important:
There must be no spaces before the 'Settings' section header
There must be 2 spaces before each line in the Settings section
There must be 1 space after the colon separating the setting name, e.g. 'base_date' and its value
Forms
There can be instructions for specific forms, for example:
1Forms:
2 - form_oid: AE
3 log_records: 5
In the above example:
log_records: (Test Data Advisor only). The Test Data Advisor will generate the specified number of log records for the AE form. This will override the log_records value in the Settings section (if any).
Datapoints
There can be instructions for specific datapoints, for example:
1Datapoints:
2 - field_oid: AETERM
3 values:
4 - Headache
5 - Bleeding
6 - Vomiting
7
8 - field_oid: AESEV
9 values:
10 - Moderate
11 - Severe
12
13 - field_oid: AESER
14 values: [1]
15
16 - field_oid: VISITNUM
17 form_oid: PRE_VISIT
18 values: [0]
19
20 - field_oid: VISITNUM
21 form_oid: VISIT
22 values: [1,2,3,4]
23
24 - field_oid: VISITNUM
25 form_oid: VISIT
26 folder_oid: FOLLOW_UP
27 values: [5]
28
29 - field_oid: VISITDAT
30 values: [-1, 5, 20, 40, 45, 60]
31
32 - field_oid: BIRTHDAT
33 low: "1960-01-01"
34 high: "1980-01-01"
35
36 - field_oid: LAB1
37 low: 1000
38 high: 2000
39 integer: true
40
41 - field_oid: LAB1
42 record_position: 0
43 form_oid: LB2
44 form_repeat_number: 0
45 folder_oid: UNS
46 folder_repeat_number: 0
47 values: [500]
In the above example:
AETERM is a text field for which the Test Advisors would normally create values using alpha characters, like 'ABCDEFGH', because there is no other information in the draft to guide the advisor when it is choosing data for a text field. The above instruction will guide the Test Advisors to use one of the 3 specified values. The Test Data Advisor will use each value in sequence after which it will choose one of the values at random. This instruction applies to the AETERM field on any form and in any folder because only the field_oid is specified.
AESEV is a dictionary field. The values in the instruction can be Coded or User Data entries. If a value does not exist in the dictionary entries it will be ignored and there will be a warning when generating data. The Test Data Advisor will use each value in sequence after which it will choose one of the values at random.
AESER is a checkbox field. This single value will constrain it to be always checked (value 1, use 0 for unchecked).
VISITNUM is an integer numeric field. There are 3 instructions in the Datapoints list for field_oid VISITNUM which have been further qualified with form_oid and folder_oid. When choosing values the Test Advisors will find the best match:
if the data is required for the VISITNUM field on the PRE_VISIT form then the first instruction will be used.
if the data is required for the VISITNUM field on the VISIT form in the FOLLOW_UP folder then the third instruction will be used.
if the data is required for the VISITNUM field on the VISIT form in a folder other than FOLLOW_UP the second instruction will be used.
if the data is required for the VISITNUM field on a form other than PRE_VISIT or VISIT then no instruction will be used.
VISITDAT is a date field. Values will be calculated by adding (or subtracting if the value is negative) the specified number of days to the base date. A decimal value such as 1.5 will add 36 hours to the base date if the field has a datetime format, otherwise it will add 1 day (rounding down the decimal component).
BIRTHDAT is a date field. Values in the range 01 JAN 1960 to 01 JAN 1980 (inclusive) will be used. The values must be specified in ISO format yyyy-mm-dd surrounded by double quotes.
LAB1 is a decimal numeric field. The values will be in the range 1000 to 200 (inclusive) and will be integers (even though the field data format has decimal places), except for datapoint UNS[0].LB2[0].LAB1[0] which will have value 500.
Note
Invalid values will be ignored. For example a high value of '01 JAN 2020' for a date field will be ignored because the value is not in ISO format.
Note
Values will be ignored if they are not relevant for the field. For example low or high values will be ignored for text fields.
List of values can be inline, separated by commas:
1Datapoints:
2 - field_oid: AETERM
3 values: [Headache,Bleeding,Vomiting]
or on separate lines (where the values can include commas):
1Datapoints:
2 - field_oid: AETERM
3 values:
4 - Headache
5 - Bleeding
6 - Vomiting, frequent
7 - Vomiting, infrequent
Matrices
There can be instructions to control which Matrices are excluded when the Test Case Advisor chooses a Folder in an Edit Check which has a wild-carded Folder (see How does the Test Case Advisor work?).
1Settings:
2
3ExcludedMatrices:
4 - UNIQUE
5 - ALLFORMS1
6 - ALLFORMS2