Description

The EvalCaseSentenceCSVGen Generator emulates multiple if-then-else cases by returning the first true value and loads the Subject, Predicates, and Clause from a CSV file to make sentences. 


Parameters

The following parameters may be configured for the EvalCaseSentenceCSVGen Generator. Parameters with an asterisk* are required.

  • filePath* - Defines the path where the Sentence CSV file is located.
  • subDir - Defines the sub-directory where the Sentence CSV files can be found.
  • delimiter* - Defines what delimiter is used to separate column data within the CSV file. 
  • seed - Defines an optional seed for randomization. Using the seed will ensure that the same random sentence is generated each time sentence is generated. 
  • simValue - Stored value to be shown only for simulation mode; when running a true Scenario, the data will be loaded from the specified source. 
  • setLoop* - setLoop gives you the ability to OVERRIDE the loop count at the Scenario level and produce the number of rows by applying permutation on the Subject, Predicates, and Clause.


  • var1 - The first variable to use in the equation.
  • var2 - The second variable to use in the equation.
  • var3 - The third variable to use in the equation.
  • var4 - The fourth variable to use in the equation.
  • var5 - The fifth variable to use in the equation. 
  • default* - Defines the file name that is selected if no cases are met. 


  • caseList - Defines a list of cases whose values should be Boolean.
  • actionList - Defines the list of actions with each action matching one case where each action represents the CSV file name.
  • inMemory - Defines whether to use H2 database or save in memory to maintain the uniqueness of Sentences when setLoop is true.


Sample CSV File Data

The following is a visual example of how the delimited file should be laid out for use with the EA valCaseSentenceCSVGen Generator:



Sample Story

In this example, the EvalCaseSentenceCSVGen Generator uses a status as the evaluation criteria for determining what CSV file will be used to generate a description. The description is based on the one of three statuses (active, pending, inactive) and will be generated from one of three CSV files.

Actors

  • Tester -  The QA Tester that wants to generate the test data.
  • Status - A value used as the evaluation criteria for the generated sentence.
  • Sentence- The object of data needed to be synthetically generated.


Key Components

  • CSV File - A delimited file consisting of the subject, predicate, and clause values necessary for generating sentences.

  • EvalCaseSentenceCSVGen Generator - Generates sentences or phrases from delimited files based on an if-then-else statement.


Plot

  • A Tester needs to populate a field with status descriptions consisting of a few keywords and then populate this information into a specific location (i.e. field, database, etc.).

  • Three delimited files must be created with the desired subject, predicate, and clause values for each status.

  • The ListGen Generator is used by a status Attribute to generate the three possible statuses used as evaluation criteria by the EvalCaseSentenceCSVGen Generator.

  • The EvalCaseSentenceCSVGen Generator can then be configured to create descriptions based on this information.


Setup Information

For this example, we will be using a Domain with 2 Attributes to generate a description based on a specific status. 

  • status = This generates a random status value that will be used by the EvalCaseSentenceCSVGen Generator.
  • description = This is derived from one of 3 CSV files. Each file has its own Subject, Predicate, and Clause values.


CSV Files

This example uses three CSV files, one for each status type: 



active.csv


inactive.csv


pending.csv


Status Attribute Configuration

The status Attribute uses the ListGen Generator to generate 1 of 3 status values for each record: 

  • Active
  • Pending
  • Inactive

This value determines what CSV file will be used to put together a sentence for the description Attribute. 



Description Attribute Configuration

The description Attribute uses the EvalCaseSentenceCSVGen to evaluate the status value and generate a description from a CSV file.

  • filePath - References the the user's resource output directory in the application. This tells the generator where to locate the CSV files on their local computer.
  • delimiter - Defines delimiter used within the CSV files. A comma has been entered.
  • simValue - This populates the preview window for the Generator and is for viewing purposes only. 
  • var1 - References the status Attribute to determine the status value of the data record.



  • default - If the status is not active or pending, then the description will be created from inactive.csv.

  • caseList- Two cases have been set up. 
    • case 1: 'var1' == 'active'
    • case 2: 'var1' == 'pending'

  • actionList- Defines what file will be used when a case is met. 
    • action 1: If the status is active, then the description will be created from active.csv
    • action 2: If the status is pending, then the description will be created from pending.csv.


Sample Output