Automated Testing and Validation with Reactis®

 
 Reactis for C User's Guide   Contents  |  Index
 Chapters:  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17

Chapter 6  The Reactis Harness Editor

Reactis does not modify your C source files. Instead the tool stores project-specific information that it requires in a Reactis Harness Library (.rsh file). The primary way for users to view and edit the data in these files is via the Reactis Harness Editor, as described in this chapter. The key components of a harness are inputs, outputs, an initialization function, and an entry function. To construct a test for a harness, Reactis for C first calls the initialization function. It then repeatedly performs the following steps:

  1. Selects values for each harness input.
  2. Calls the entry function with the selected inputs.
  3. Records the generated outputs.

Each harness library contains one or more harnesses. As shown in Figure 6.1, the harness selector in the toolbar of the Reactis Harness Editor enables the user to select a harness from those defined in the currently loaded .rsh file, to create a new harness, or to delete a harness. The currently selected harness is displayed in parentheses beside the .rsh file name in the title bars of the main window and harness editor.


harnessEditor_web.png
Figure 6.1: The Reactis Harness Editor.

The Reactis Harness Editor contains seven panes used to control different aspects of testing:

General.
Displays the initialization function, entry function, harness name, sample rate, and some additional settings which control simulation. The initialization function is called once per test, and the entry function is called once per step during simulation and testing.
Inputs.
A set of variables used as inputs. A new value is generated for each input prior to taking a step during simulation or test-generation. The user may constrain the set of allowed values for each input.
Outputs.
A set of variables used as outputs. After each step the values of the outputs are recorded.
Configuration Variables
A set of variables which may change prior to the start of a test, but not during a test.
Error Checking
Settings which specify the action to take when an anomalous condition, such as a numeric overflow, occurs.
Coverage Metrics
Settings that specify which coverage metrics will be tracked during simulation and the details of each metric.
Excluded Coverage Targets
A set of coverage targets which are excluded from coverage tracking.

Note that the contents of an .rsh file may only be modified when Simulator is disabled. When Simulator is running, the Reactis Harness Editor operates in read-only mode as indicated by the appearance of [read only] in the editor window’s title bar.

Although not necessary, the default naming convention assumes that the .rsm file and .rsh file of a project share the same base name; for example, if the .rsm file file is named cruise.rsm, then the name of the associated .rsh file is assumed to be cruise.rsh. A .rsh file named differently may be associated with a program by loading the build file in Reactis and selecting File -> Select Harness Library....

6.1  Creating a new harness

To create a new harness, either select Edit -> New Harness... within the main Reactis for C window or select the Create new harness... option in the harness selector drop-down box. This will bring up the dialog shown in Figure 6.2.


rheCreateA_web.png
Figure 6.2: The harness creation dialog

The numbered items in Figure 6.2 let you specify a harness as follows:

  1. Harness name. Specify a name for the harness being created in this entry box.
  2. Initialization function Each harness has an initialization function – a function that Reactis for C will call once per test, before the first step of the test is taken. The initialization function can either be set to None, or the name of a function can be entered into the text entry box.
  3. Entry function This text entry box lets you specify an entry function, which Reactis for C will call for every step in a test. To construct a test for a harness, Reactis for C repeatedly:
    1. Selects values for each harness input.
    2. Calls the entry function with the selected inputs.
    3. Records the generated outputs.
  4. ... Clicking this button opens a dialog that lets you select an entry function from a list of candidate functions.
  5. ... Clicking this button opens a dialog that lets you select an initialization function from a list of candidate functions. Only functions which have no arguments and do not return a value can to be used as initialization functions.
  6. Create separate input/output for each structure member This menu determines how structures in the test harness are handled and has two choices: (1) split the structure into a separate input or output for each member of the structure, or (2) create a single input or output for the entire structure.
  7. Create new harness. Creates a new harness with the minimum set of inputs and outputs, as inferred from the entry function’s parameters and return value type:
    • Each pass-by-value argument to the entry function is added as an input.
    • Each pass-by-reference argument to the entry function is added as an output
    • If the entry function’s return value type is non-void then an output is added for the return value.
  8. Copy existing harness. Copies inputs, outputs and configuration variables from an existing harness in the current harness library. This can be useful when defining harnesses for different entry functions that share some of the inputs, outputs and configuration variables.
  9. When Copy existing harness is selected, this menu lets you specify the harness to copy.
  10. Create harness from .rsi file Copy inputs, outputs, and configuration variables from an .rsi file created with Reactis for Simulink for a Simulink model. This option is useful if test cases for the model have been created with Reactis for Simulink and C code was automatically generated from the model. When a harness is constructed with this option, tests generated from the model can be directly run on the C code with Reactis for C.
  11. RSI file. If copying harness info from an .rsi file, enter the .rsi file name in this text box.
  12. ... Open a file selection dialog to specify an .rsi file from which to copy harness info.
  13. Variable Renaming The names of Simulink inports and outports might not match exactly with the names of corresponding variables in the C code. The Variable Renaming section of the dialog provides a way to map the names to resolve any differences. Using the text boxes in this section, you can specify common prefixes or suffixes for the items in the .rsi file and/or the C code. For each inport/outport/configuration variable in an .rsi file, the following process is used to try to map it to an item in the C code:
    1. itemname1 = the name of the inport/outport/configuration variable as found in the .rsi file.
    2. itemname2 = the result of removing the prefix specified in the RSI File prefix column from the beginning of itemname1.
    3. itemname3 = the result of removing the suffix specified in the RSI File suffix column from the end of itemname2.
    4. itemname4 = the result of adding the prefix specified in the C Code prefix column to the beginning of itemname3.
    5. itemname5 = the result of adding the suffix specified in the C Code suffix column to the end of itemname4.
    6. In the C code, if a global variable or parameter of the entry function is named itemname5 then it will be added as an input/output/configuration to the harness. Its harness name will be itemname1 and it will map to C code item itemname5. If itemname5 does not match any global variable or entry function parameter, then Reactis will produce a warning that a match could not be found.

    Figure 6.3 shows some mapping examples:

    Example A
    Mapping inport/outport names with prefixes or postfixes to C variables:
    • Simulink inports named “SLin_name” will map to “name” in the C code.
    • Simulink outports named “name_SLout” will map to “name” in the C code.
    Example B
    Mapping inport/outport names to C variables with prefixes or postfixes:
    • Simulink inports named “name” will map to “Cin_name” in the C code.
    • Simulink outports named “name” will map to “name_Cout” in the C code.
    Example C
    Mapping with prefixes or postfixes in both inport names and C variables: Simulink inports named “SLPrefix_name_SLSuffix” will map to “CPrefix_name_CSuffix” in the C code.

rheCreateExamplesA_web.png
Figure 6.3: Examples for different mapping configurations

6.2  General


rheGeneralA_web.png
Figure 6.4: The General pane of the Reactis Harness Editor

The General tab of the harness editor is shown in Figure 6.4. The settings controlled by this tab are labeled 1 through 5 in Figure 6.4.

  1. cruise_main. This pulldown menu is used to select the current harness, create a new harness, or delete the current harness. The displayed value is the name of the current harness.
  2. Sample rate. The sample rate is the number of seconds to add to the time (__t__) at the end of each step. When performing back-to-back testing, the test harness sample rate will typically match the sample rate of the model.
  3. Create and use cache files for C code. When checked, Reactis will generate a Reactis object file for each C source file. These files have extension .rso and are stored in the directory containing the C source file from which they were compiled. Subsequently, the C source file will only be recompiled if it is modified or if a new version of Reactis is installed.
  4. Promote ’float’ values to ’double’ to reduce round-off error. When checked, single-precision floating-point values will always be converted to double-precision prior to any calculation, which reduces round-off error in some cases. For strict C99 compliance, this should be disabled (not checked).

6.3  Inputs

The Inputs tab (see Figure 6.5)of the harness editor enables you to define a set of inputs. Inputs are either parameters to the entry function or global variables which are designated as inputs by selecting Edit -> Add... and then choosing from the candidate list. Parameters which are passed by reference can also be designed as inputs via the the same mechanism.


rheInputsA_web.png
Figure 6.5: The Inputs tab of the harness editor defines the set of inputs and limits on the values that the inputs can assume during simulation and test generation.

The Inputs tab contains six columns for each input value. These are numbered 1 through 6 in Figure 6.5. The purpose of each column is as follows:

1. #
The number of the input (1 … N).
2. Name
The name of an input is usually, but not always, the same as the name of the variable which holds the input value. See Section 6.6 for details.
3. Variable
The name of the variable which holds the input value.
4. File
The name of source file in which the variable which holds the input value is defined.
5. Properties
A code which describes how the input is passed through the harness and stored in the program under test. See Section 6.7 for details.
6. Type
This field specifies the set of values that can be assigned to the input. See Section 6.8 for details.

6.4  Outputs

The Outputs tab of the harness editor enables the user to add and remove items to the set of outputs. A value is recorded for each output at the end of each simulation step as tests are constructed. By default all pass-by-reference parameters of the entry function are considered outputs, but they may be removed from the list and global variables may be added. When the Outputs tab is displayed, entries from the Edit menu may be used to add or remove items to/from the list.


rheOutputsA_web.png
Figure 6.6: The Outputs pane of the harness editor.

The Outputs tab contains six columns for each input value. These are numbered 1 through 6 in Figure 6.6. The purpose of each column is as follows:

1. #
The number of the output (1 … N).
2. Name
The name of an output is usually, but not always, the same as the name of the variable which holds the output value. See Section 6.6 for details.
3. Variable
The name of the variable which holds the output value.
4. File
The name of source file in which the variable which holds the output value is defined.
5. Properties
A code which describes how the output is stored in the program under test and passed through the harness. See Section 6.7 for details.
6. Type
This field specifies the set of values that can be assigned to the input. See Section 6.8 for details.

6.5  Configuration Variables

Configuration variable directives allow certain scalar global variables to be treated as “configuration variables” whose values can only change between tests (but not during a test).

A configuration variable is created by clicking on Edit -> Configuration Variables... in the main Reactis window, then selecting Edit -> Add... in the menu bar of the Reactis Harness Editor window that comes up. Reactis will display a list of all candidate configuration variables which users may select from. The types associated with these configuration variables in .rsh files are the same as those that may be assigned to inputs. Note, however, that configuration variables may not be given delta types, since the variables are not allowed to change during a test or simulation run.


rheConfigVarsA_web.png
Figure 6.7: The Configuration Variables tab of the harness editor.

As shown in 6.7, the Configuration Variables tab has five columns, whose meaning is as follows:

1. #
The number of the configuration variables (1 … N).
2. Name
A user-defined name which is usually, but not necessarily then as the name of variable. See Section 6.6 for details.
3. Variable
The name of the configuration variable in the source code.
4. File
The name of source file in which the configuration variable is defined.
5. Type
This field specifies the set of values that can be assigned to the configuration variable. See Section 6.8 for details.

6.6  Names

The Inputs, Outputs and Configuration Variables tabs of the Reactis Harness Editor have columns titled Name and Variable. Both of these columns contain names. The name displayed in the Variable field is the actual name of the variable in the source code. This name cannot be changed and does not have to be unique. The name displayed in the Name field, on the other hand, can be changed and must be unique.

6.7  Properties

The Inputs and Outputs tabs of the Reactis Harness Editor have a column labeled Properties, which contains a code describing how each input and output is passed through the harness and stored in the program under test. There are four property codes, P, P*, R and G, whose meaning is given by the following table:

CodeMeaning
PPass-by-value parameter to entry function.
P*Pass-by-reference parameter to entry function.
RReturn value of entry function.
GGlobal variable.

6.8  Types

The Inputs, Outputs and Configuration Variables tabs of the Reactis Harness Editor have a column labeled Types. The Types column contains type specifications. For inputs and configuration variables, the type specification determines what values may be assigned to the variable during simulation, test generation and validation. The initial type specification for each variable is the equivalent of its C type. This indicates that the full range of values which the variable can hold should be generated during testing. In many cases, the set of desired input values is actually smaller than the full range of the C type. For example, an input may have a type of char, but may actually be used as a Boolean value whose allowed values are 0 or 1. If this is the case, then editing the type specification will significantly improve coverage results during testing.

Note that for outputs, the type specification for an input is permanently fixed to the equivalent to its C type.

Type specifications can be changed from the Inputs and Configuration Variables tabs of the harness editor. A type specification starts with a base type, which is selected from the list: int8, int16, int32, uint8, uint16, uint32, double, single.

A base type can then be extended by notation to specify (1) ranges and subsets within a base type, (2) rate-of-change (or delta) constraints, (3) resolution constraints and (4) array types. The full set of type specifications is defined by the following grammar (in which rsiType is the starting symbol).

intType:int8, int16, int32, uint8, uint16, uint32
floatType:double, single
fixedPointType:sfixbitsSlopeBias
 |ufixbitsSlopeBias
            numberType:intType
 |floatType
 |fixedPointType
baseType:numberType
 |boolean
rsiType:baseType
 |baseType { val1, val2, ... , valn }
 |numberType [ min, max ]
 |numberType delta [ min, max ]
 |numberType [ min, max ] delta [ min, max ]
 |floatType [ min : step : max ]
 |floatType [ min : step : max ] delta [ min, max ]
 |<| rsiType1 * rsiType2 * ... * rsiTypen |>
 |vectorType
 |structType
          vectorType:<| rsiType1 * rsiType2 * ... * rsiTypen |>
          structType:{ fieldName1 : rsiType1 , ... , fieldNamem : rsiTypem }
 |structName -> { fieldName1 : rsiType1 , ... , fieldNamem : rsiTypem }
val:value
 |value : weight

The variables in this grammar are defined as follows. min, max, step, and value are elements of the given base type, weight is an integer greater than zero and less than one thousand. For a vector type <| rsiType1 * rsiType2 * ... * rsiTypen |>, the base types of all rsiTypei must be identical. For a struct type, the base types of the different field types rsiTypei may be different.

Fixed point types are strings that specify a set of parameters for the generalized slope-bias encoding scheme for representing real numbers using integers. These strings consist of a prefix of either sfix (signed) or ufix (unsigned) followed by a suffix of the form bitsSlopeBias. The suffix is further divided into one required substring bits and two optional substrings slope and bias. These three substrings are defined as described below. Note that fpDecimal is a string that encodes a decimal value by replacing a negative sign “-” with “n” and the decimal point “.” with “p”. For example, “-4.9” is represented as “n4p9” and “2.3” as “2p3”. Similarly fpInt is a string that encodes an integer value by replacing a negative sign “-” with “n”.

bits
is a positive integer indicating the number of bits to be used to represent values of the type.
slope
is a decimal specified in one of two ways
  • as _SfpDecimal such that slope = fpDecimal
  • as _FfpDecimal_EfpInt such that slope = fpDecimal×2fpInt
bias
is a decimal specified as _BfpDecimal.

If the slope substring is omitted a default value of 1 is used. If the bias substring is omitted a default value of 0 is used.

The following examples show some legal types and the sets of values they specify.

RSI TypeValues in Type
double [0.0,4.0]All double-precision floating-point numbers x, where 0.0 <= x <= 4.0
double [-10.0:0.25:10.0]-10.0, -9.75, -9.5, ..., 9.5, 9.75, 10.0
int16 [-1,1]-1, 0, 1
int32 {0, 4, 7}0, 4, 7
uint8 {0:1, 1:3}0, 1
<| double { 1.0,2.0,3.0 } * double {10.0} |><| 1.0, 10.0 |>, <| 2.0, 10.0 |>, <| 3.0, 10.0 |>
double delta [-1.0,1.0] All double-precision floating-point numbers, but input values of this type can increase or decrease by at most 1.0 during successive simulation steps.
<| double { 1.0,2.0,3.0 } * double {10.0} |><| 1.0, 10.0 |>, <| 2.0, 10.0 |>, <| 3.0, 10.0 |>
{ x : uint8 { 1, 2 }, y : unit8 { 3, 4} } { x = 1, y = 3 }, { x = 1, y = 4 } { x = 2, y = 3 }, { x = 2, y = 4 }

In range types (i.e. those of form t[l,u]) the lower and upper bounds are inclusive. In enumeration types (i.e. those of form t{u1, …, un}) the probability weights in the ui enable the user to influence the probabilities of the different values in the type being selected during simulation, test generation, and C code validation. For example, an input having type uint8 {0:1, 1:3} would be assigned the value 0 in 25% of random simulation steps and the value 1 in 75% of random simulation steps, on average. In general, if input x is assigned the type t{ v1:w1, v2:w2, ..., vn:wn}, then the probability of each value in the type being assigned to x is computed as follows. Let W = w1 + w2 + ... + wn, where wi denotes the probability weight assigned to vi (a weight of 1 is assumed if no explicit weight is given). During “random” simulation or test generation, the probability of an input x being assigned the value vi is wi/W.

Using delta types (i.e. those of form t delta [l,u]) users may constrain how the values fed into inputs change from one simulation step to the next. For example, an input representing a sensor measuring temperature might have the type double delta [-1.0,1.0] to specify that temperature can either increase or decrease by at most 1 degree between any consecutive simulation steps. In general, if input x has type t delta [l,u] and the current value of x is v1 then in the next simulation step the new value, v2, of x must satisfy: v1 + l <= v2 <= v1 + u .

Using resolution types (i.e. those of form double [i:j:k] where i is a lower bound, j is a resolution, and k is an upper bound) users may specify that each value that a variable of this type may assume will differ from i by some multiple of j. A delta constraint may also be added to a resolution type.

6.9  The Type Editor Dialog

The Type Editor Dialog, shown in Figure 6.8, helps users construct types for inputs and configuration variables. In the following discussion, we use TUC to denote the type under construction, i.e. the type currently being defined with the dialog.


typeEditorA_web.png
Figure 6.8: The dialog for specifying type information for inputs or configuration variables. As shown here a type of double is specified for input x which will be converted to fixpoint before being stored in the memory of the program under test. Furthermore, the input values for x have been constrained to the set { −10000000.0, 0.0, 10000000.0 }. During random simulation, x will be assigned one of these three values with equal probability.

The Type Editor may be invoked from either the Inputs or Configuration Variables tabs and selecting an input or configuration variable row with a single click, and then right-clicking in the body of the Reactis Harness Editor and selecting Edit Type, or selecting menu item Edit -> Edit....

6.9.1  Using the Type Editor

A type may be constructed with the dialog by performing the following steps. Recall that TUC denotes type under construction, i.e. the type currently being defined with the dialog. The process for editing a type works as follows:

  1. Do you wish to use a type in the test harness which is different from the type in the C source code?
    No.
    Leave the harness base type unchanged (it will initially match the internal base type) and proceed to step 2.
    Yes.
    Use the pulldown menu (item 1 in Figure 6.8) to select the desired type and proceed to step 2.
  2. Should the values chosen during simulation include all values in the base type, only a subrange of the base type, or only a set of specific values in the base type?
    All values in base type.
    Select the Complete range of base type radio button (item 3 in Figure 6.8) and proceed to step 3.
    Only a subrange of the base type.
    Select the Subrange of base type radio button (item 4 in Figure 6.8) and specify a lower and upper bound for the range using window items 5 and 6 respectively. If the input has a base type of double or single, then you may specify a resolution for the values in the TUC. To do so click the Resolution check box (item 7 in Figure 6.8) and enter a resolution value in the text box to the right (item 8 in Figure 6.8). When a resolution is specified, a variable of the TUC will only assume values that differ from the lower bound (item 5 in Figure 6.8) by some multiple of the resolution value (item 8 in Figure 6.8). Proceed to step 3.
    A specific set of values in the base type.
    Select the Set of specific values radio button (item 9 in Figure 6.8) and use the Add, Edit, and Remove buttons (items 12, 13, and 14 in Figure 6.8) to create a list of values. Each value must be an element of the base type of the TUC and may be assigned a probability weight. See Section 6.3 for a description of probability weights. Proceed to step 3.
  3. Do you wish to constrain how the values fed into the the input parameter may change from one step to the next during simulation?
    No.
    Select the Complete radio button (item 16 in Figure 6.8) and proceed to step 4.
    Yes.
    Select the Limits radio button (item 17 in Figure 6.8) and enter values in the Minimum and Maximum text entry boxes (items 18 and 19 in Figure 6.8). If min and max are the values specified here, then values fed into the entry function parameter with the TUC will be constrained as follows. If v1 and v2 are values for such a port in consecutive simulation steps, then v1 + min <= v2 <= v1 + max . Proceed to step 4.
  4. Does the C code expect a fixpoint value as input?
    No.
    Leave the internal type unchanged and proceed to step 5.
    Yes.
    Select Fixpoint from the internal base type pulldown menu (item 20 in Figure 6.8), then select a scaling mode (item 21 in Figure 6.8), and finally the scaling parameters (item 24 in Figure 6.8) Proceed to step 5.
  5. Does the conversion from the harness type to the internal type require rounding or can it overflow?
    No.
    Proceed to step 6.
    Yes.
    Select a rounding mode (item 25 in Figure 6.8) and/or overflow behavior (item 26 in Figure 6.8). Proceed to step 6.
  6. When you are satisfied with the type you have constructed click the Ok button to update type and dismiss the Type Editor dialog.
  7. Select File -> Save to save your changes to the .rsh file.

6.9.2  Labeled Window Items

This section describes the labeled items in Figure 6.8. Recall that TUC denotes type under construction, i.e. the type currently being defined with the dialog.

  1. This pulldown menu changes the base type of the harness variable.
  2. The radio buttons in this group (window items 3, 4, and 9) enable the user to specify the values from the base type to be include in the TUC.
  3. Selecting this radio button indicates that all values from the base type should be included in the TUC.
  4. Selecting this radio button indicates that only a subrange of values from the base type should be included in the TUC.
  5. When the Subrange of base type radio button is selected, this entry box enables the user to specify a lower bound for the subrange.
  6. When the Subrange of base type radio button is selected, this entry box enables the user to specify an upper bound for the subrange.
  7. If the Subrange of base type radio button is selected for a base type of double or single, then this check box may be checked in order to specify a resolution for the TUC.
  8. When the Resolution check box (window item 7) is checked, a resolution value must be entered in this text box. When a resolution is specified, a variable of the TUC will only assume values that differ from the lower bound specified in window item 5 by some multiple of the resolution value here.
  9. Selecting this radio button indicates that only a specified set of values from the base type should be included in the TUC. Window items 10-14 are used to specify the set of values.
  10. The entries in this column enumerate the values in the TUC.
  11. The entries in this column associate a probability weight with each value in the TUC. See Section 6.3 for a description of probability weights.
  12. Add a new value (a new entry in each of window items 10 and 11) to the TUC.
  13. Edit the probability weight for the currently selected value.
  14. Remove the currently selected value.
  15. The radio buttons in this group (window items 16 and 17) enable the user to specify whether or not the type has a delta constraint. For a parameter with the TUC, such a constraint limits the allowable changes in value from one simulation step to the next.
  16. The TUC has no delta constraint.
  17. The TUC has the delta constraint indicated by window items 18 and 19.
  18. The value for a parameter with the TUC may change by no less than the value specified here. If v1 and v2 are the values of the parameter in consecutive simulation steps then v2v1 >= min .
  19. The value for a parameter with the TUC may change by no more than the value specified here. v2v1 <= max .
  20. . This pulldown menu changes the internal type from a fixpoint type. It can only be used when the type in the source code is an integer type.
  21. . This pulldown menu determines the scaling used when the internal base type is a fixpoint type. Available choices are Binary Point or Slope and Bias.
  22. The signedness of the fixpoint type is displayed here. It matches the signedness of the underlying integer type and cannot be changed.
  23. The width (in bits) of the fixpoint type is displayed here. It matches the width of the underlying integer type and cannot be changed.
  24. When binary point scaling is selected, the fraction width (in bits) of the fixpoint type is entered here. If slope and bias scaling is chosen, the fraction width will be replaced with entries for the slope and bias.
  25. This pulldown menu determines the rounding mode to use when converting values from the harness type to the internal type. Possible choices are Zero, Ceiling, Floor, or Nearest.
  26. This pulldown menu determines the overflow mode to use when converting values from the harness type to the internal type. Possible choices are Saturate or Wrap over.
  27. View help on the type editor dialog.
  28. Update the TUC and dismiss the dialog. The revised TUC will appear in the appropriate row of the Reactis Harness Editor and “[modified]” will appear in the title bar. Selecting File -> Save will write the .rsh file to disk and cause the “[modified]” tag in the title bar to disappear.
  29. Discard any changes to the TUC and dismiss the dialog.
  30. Update the TUC without dismissing the dialog.

6.10  Error Checking


rheErrorCheckingA_web.png
Figure 6.9: The Error Checking pane of the Reactis Harness Editor.

The Error Checking pane of the Reactis Harness Editor, shown in Figure 6.9, lets you specify what action to take when anomalous conditions occur during program execution. The settings controlled via this pane are numbered 1-12 in Figure 6.9:

  1. The action to take when a type delta exceeds the range of the type. Possible actions are Clip Delta, Clip delta and produce warning, or Produce error.
  2. The default tolerance to use when comparing test suite outputs to program outputs.
  3. The action to take when a signed integer overflow occurs. Possible values are Wrap over, Produce warning, or Produce error.
  4. The action to take when an unsigned integer overflow occurs. Possible values are Wrap over, Produce warning, or Produce error.
  5. The action to take when an overflow occurs while converting an unsigned integer value to signed integer. Possible values are Wrap over, Produce warning, Produce error, or Inherit from "On signed integer overflow".
  6. The action to take when an overflow occurs while converting an floating point value to (signed or unsigned) integer. Possible values are Wrap over, Produce warning, Produce error, or Inherit from "On signed integer overflow".
  7. The action to take when a NaN (not-a-number) or infinite value is detected. Possible values are No action, Produce warning, Produce error.
  8. The action to take when an invalid pointer is detected. Possible values are Do nothing, Produce warning, or Produce error.
  9. The action to take when an empty struct or union type is defined. Possible values are Do nothing, Produce warning, or Produce error.
  10. The action to take when an undefined is called. Possible values are Return zero, or Produce error.
  11. The action to take when an extern variable is never defined. Possible values are Initialize to zero, Produce warning and initialize to zero, or Produce error.

6.11  Coverage Metrics


rheCvgMetricsA_web.png
Figure 6.10: The Coverage Metrics pane of the Reactis Harness Editor.

The Coverage Metrics pane of the Reactis Harness Editor is used to specify which metrics should be tracked and how they should be tracked. An annotated screenshot of the Coverage Metrics pane appears in Figure 6.10. The following items are labeled Figure 6.10:

  1. This setting enables or disables the C Statement metric. See section 7.1 for details.
  2. This setting enabled or disabled the C Function metric. See section 7.2 for details.
  3. This setting enabled or disabled the C Function Call metric. See Section 7.3 for details.
  4. This setting controls which expressions are considered to be decisions. Possible values are Expressions which control if/while/for statements, Expressions which control if/while/for statements or the ? operator, or All non-trivial Boolean expressions. See Section 7.4 for details on the effect of this setting.
  5. This setting enables or disables the Decision metric. See Section 7.4 for details.
  6. This setting enables or disables the Condition metric. See Section 7.5 for details.
  7. This setting enables or disables the Modified Condition/Decision Coverage (MC/DC) metric. See Section 7.6 for details.
  8. This setting enables or disables the Multiple Condition Coverage (MCC) metric. See Section 7.7 for details.
  9. This setting controls the maximum number of conditions per decision for which MCC targets will be created. No MCC targets will be created for decisions which are composed from more conditions than the given limit. Note that 2N MCC targets are created for a decision composed from N conditions, so use caution when changing this setting. See Section 7.7 for details on the MCC metric.
  10. This setting enables or disables the Boundary Value metric. See Section 7.8 for details.
  11. This setting enables or disables the User-Defined Target metric. See Section 10.1.2 for details.
  12. This setting enables or disables the Assertion metric. See Section 10.1.1 for details.
  13. This specifies if assertion targets should be created for each assert statement in a program.

6.12  Excluded Coverage Targets


rheExcludedTgtsA_web.png
Figure 6.11: The Excluded Coverage Targets pane of the Reactis Harness Editor.

The Excluded Coverage Targets pane is shown in Figure 6.11. Each row of this pane contains one target excluded from coverage. There are five data items per target:

  1. Metric. The metric measured by the target.
  2. Item. A description of the target (a location and source code fragment).
  3. Target. A description of the action which causes the target to be covered. For example, if a target’s metric is Condition, then the target will be either Condition true or Condition false.
  4. Status. The target status, which is either excluded, or excluded with assertion.
  5. System. The source file and (possibly) library where the target is located.