![]() |
![]() |
![]() |
![]() |
![]() |
Verdicts
There are two mechanisms in TTCN that provide assignment of verdicts to a test case. These mechanisms are:
A preliminary result or explicit final verdict may be associated with any TTCN statement except for the following:
The Result Variable
TTCN has a predefined test case variable, known as the result variable, called R. This variable may be used in expressions and the verdict column of a behaviour description. It is used to store preliminary results and has the following characteristics:
- A preliminary verdict does not terminate execution of a test case;
- it may appear in expressions as a read-only variable, i.e. it may not be used on the l.h.s. of an assignment;
- it may only take one of the values: pass, fail, inconc or type definition. These values are predefined identifiers, and are case sensitive;
- changes are made to its value by entries in the verdicts column;
- at the start of a test case R is bound to the value type definition.
Preliminary Results
The value of R is changed by recording a preliminary result in the verdicts column. A preliminary result may be one of the following:
- (P) or (PASS), meaning that some aspect of the test purpose has been achieved;
- (I) or (INCONC), meaning that something has occurred which makes the test case inconclusive for some aspect of the test purpose;
- (F) or (FAIL), meaning that a protocol error has occurred or that some aspect of the test purpose has resulted in failure.
Preliminary results have an order of precedence, for example:
- if R has the value fail and a preliminary result (PASS) is encountered in the verdict column, then R cannot be changed to pass and it will remain bound to fail. On the other hand, if R has the value pass and a preliminary result (FAIL) is encountered in the verdict column, then R is bound to the value fail.
The table below shows how R may be changed according to the precedence rules:
Final Verdicts
Execution of a test case is terminated either by:
- reaching a leaf of the test case behaviour tree; and/or
- an explicit final verdict on the behaviour line (i.e. in the verdict column).
A final verdict may be one of the following:
- P or PASS, meaning that a pass verdict is to be recorded;
- I or INCONC, meaning that an inconclusive verdict is to be recorded;
- F or FAIL, meaning that a fail verdict is to be recorded;
- the predefined variable R, meaning that the value of R is to be taken as the final verdict, unless the value of R is none in which case a test case error is recorded instead of a final verdict.
If no explicit final verdict is reached, then the final verdict is the value of R. If R is still bound to the value none then this is a test case error.
The final verdict must be consistent with the value of R. For example:
- if R has the value fail and an explicit final verdict PASS is encountered in the verdict column, then a final verdict of fail and not pass should be recorded. On the other hand, if R has the value pass and an explicit final verdict FAIL is encountered in the verdict column, then a final verdict of fail should be recorded.
The table below shows how the final verdict should be recorded according to the value of R:
http://www.ibm.com/rational |
![]() |
![]() |
![]() |
![]() |