abouttutorialspricingterms
Login

  • Quick start
  • Modelling and data generation (part 1)
  • Modelling and data generation (part 2)
  • Integration with Java
  • Integration with C++
  • Integration with C#
  • Integration with Python
  • Integration with Node.js

Documentation

  • General
  • Team work
  • Data modelling
  • Export templates
  • Generator request syntax
  • Generator responses in JSON format

Generator request syntax.

Introduction


Generator accepts requests in JSON format.
Example:
{ "method":"testMethod1", "model":"KVT1-EG52-56D8-O1L7-87E1", "userData":"{ 'dataSource':'genNWise' }" }

Main fields of the request


  • model
    This field defines model UUID (unique model number).

  • method
    This field defines test function taken into account in generation. It may consist of:

    • name of test function, if method name is unique among methods of the class for example: Class1.testMethod1
    • full signature of test method for example: Class1.testMethod1(int, java.lang.String, byte, java.lang.String)

  • template
    This field defines template for export. When user defines this parameter, generator returns test cases formatted with the template. When this parameter is absent, standard generator format is used. Templates have been descibed in documentation section "Export templates".

  • responseFormat
    This field defines generator general response format. If parameter responseFormat is not defined, the standard generator format is used. Possible values of responseFormat are: JSON1, JSON2. These formats have been described in documentation section: "Generator responses in JSON format".

  • sessionId
    This field defines test session. Test sessions are used to descripe chunks of data when test results are written back to ecFeed (feedback).

  • userData
    This field will be described in details in the next section.

.

User data


Field userData defines additional parameters used for data generation. User data has structure similar to JSON syntax, except that double quotation mark is replaced with the single one.

Example: {'dataSource':'genNWise'}
The example above tells the generator to use for generation the N-Wise generator.

User data fields


  • dataSource
    Field data source defines where input data would come from

    • genNWise - generator uses N-Wise algorithm
    • genCartesian - generator uses cartesian algorithm
    • genRandom - generator uses cartesian algorithm
    • static - static (generated earlier) test cases would be used

    For data for generation or static test cases come from method and model defined in main fields.

  • constraints
    This field defines constraints which would be taken into account during geneneration.

    Example: 'constraints':['constraint1', 'constraint2']

    There are also special values: ALL and NONE

    • 'constraints':'ALL' - all constraints would be taken into account
    • 'constraints':'NONE' - constraints would not be taken into account

    If this field is ommited, all constraints would be taken into account.

  • choices
    This field defines parameters and choices which would be taken into account during data generation. If this field is not defined, all choices would be taken into account. The value of choices tag is a map with parameter names as map keys, and arrays of choice names as map values.

    Example: 'choices' : { 'param1':['choice11', 'choice12', 'choice13'], 'param2':['choice21', 'choice22', 'choice23']}

  • testSuites
    This field defines test suites which would be taken into account when test source is static (readout of test cases generated earlier).

    Example: 'dataSource':'static','testSuites':['first','second']

  • ambiguousTestCases
    This field defines how to treat test cases which are ambigous. Ambiguous test cases contain randomized choices and result of their evaluation against constraint is uncertain - can be true or false.

    Field can have the following values:

    • INCLUDE - generator will include ambiguous test cases in the test suite.
    • EXCLUDE - generator will exclude ambiguous test cases from test suite before evaluation of constraints.
    • EVALUATE - generator will evaluate each test case after assigning concrete values to randomized choices. In this case the number of generated test cases may vary with each generator run because of assignment of random values to choices.

    The default value is INCLUDE.

  • feedback
    Field feedback defines a flag denoting whether results from execution of tests should be sent back to the generator. By default, this functionality is switched off.

  • label
    Field label defines additional label associated with feedback.

  • properties
    Field properties defines additional parameters. Format of this field is a map of keys/values: { 'key1':'value1', 'key2':'value2'}

    Example: 'dataSource':'genNWise', 'properties':{'n':'2', 'coverage':'90'}

.

Properties


  • n
    Field n defines tuple size required in the NWise algorithm. The default is 2 (pairwise).

  • coverage
    Field coverage defines the percentage of N-tuples that the generator will try to cover. The default is 100.

  • length
    Field lenght defines number of tests to be generated by random generator. The default value is 1.

  • duplicates
    Field duplicates defines behavior of random generator. If its value is set to true, many identical tests case are allowed to be generated. If set to 'false', the generator will stop after creating all possible combinations. The default value is 'true'.

  • adaptive
    Field duplicates defines behavior of random generator. If set to true, the generator will try to provide tests that are farthest (in the means of the Hamming distance) from the ones already generated. The default value is 'false'.

  • suiteSize
    This field defines maximum test suite size generated by random generator.