Interface Selection for Test Case Generation - Run 2: Using Helper-Functions

Selecting the interface and using user defined helper functions

In order to use this helper function, we have to synchronize ATG with the model:

a1

After synchronizing ATG with the model, ATG offers the helper function helper_func_infix_notation_1_2 for selection in the input interface definition dialog. Now, we have to adjust the interface definition of the ATGConfiguration. We no longer want ATG to stiumlate TheTestCalc using the auto generated port relay operations of TC_at_InEventsPt_of_TheTestCalc - we hence de-select them from the input interface definition:

a1

Instead, we want helper_func_infix_notation_1_2 of instance itsTC_at_InEventsPt_of_TheTestCalc of TestComponent TC_at_InEventsPt_of_TheTestCalc to be used as only driven input of the ATGConfiguration:

a1

Now, we have to determine the ranges for the argument values of helper_func_infix_notation_1_2.

Interval notation for argument range specification

We use the interval notations [-32767-32767];#20 instead of -32767-32767.

Notation specifying number of values: [-32767-32767];#20 means: use 20 equidistant values from the interval. If '0' is part of the interval, then '0' is explicitly part of the value enumeration. The same counts for the upper-bound of the interval, regardless of the number of values to which the interval is factorized.(cf. ATG User Guide for detailed information)

Notation specifying step size: Alternatively, the notation e.g. [-32767-32767];5000 could be used. In this case, not only 20 (as in [-32767-32767];#20) equidistant values from within the interval are enumerated, but the sequence -32767,-27767,-22767,-17767,...,0,...,32767 is used (with step size of 5000. 0 and the upper bound of the interval are again part of the enumeration, regardless of the computation of values using a step size of 5000 with starting point -32767.

Note: Be careful, when experimenting with this notation: Enumerating an interval with too many values or a too small step size can result in very long computations.

Defining the interface

Using the interval notation explained above, we now define the interface for the helper function:

a1

  • For operand 1 and operand 2, respectively, we use [-32767-32767];#20, i.e. 20 representative values of the integer domain (starting at '-32767' and including '0' and '32767').
  • Since only operations 1-4 are regularly supported, interval [0-5];1 (="0,1,2,3,4,5") also covers the illegal values 0 and 5 as operation values.

Now, we again generate test cases.