![]() |
automatically generated test descriptions
last updated December 11, 1998
|
formalWARE
project
formalWARE
formalWARE
|
Example Five:
The Generation of Test Frames from Simple Requirements
OverviewThis example briefly demonstrates the process of formalizing a given specification for the purpose of generating test descriptions, referred to as test frames, and the generation of test frames. The automatic test frame generation portion of this example is from the Ph.D. research of Michael Donat. Other more detailed examples are also available:
This example also demonstrates the difference between formalizing a specification and modelling it. For this example, generating test frames requires only that the logical relationships between conditions be formalized. Therefore, modelling the requirements at a deeper level of detail is unnecessary (for the purpose of generating test frames). The RequirementsThe requirements for this example are for a simple boiler vessel. The system is to monitor certain aspects of the vessel and be consistent with the following requirements:
The Formal SpecificationNote that there are certain temporal aspects, e.g. every five minutes, to the requirements that have not been formalized below.
We distinguish a formal specification from a model.
A formal specification typically contains a small amount of formal detail,
such as the specification below.
For example, the condition A formal specification, in S, of the above requirements is (vessel.s): %include startup.s temp, pressure : num; critical : bool; R1 := if temp > 514 \/ pressure > 78 \/ (temp > 480 /\ pressure > 52) then critical; "Receipt of shutdown" : bool; "extinguish heat source" : bool; R2 := if "Receipt of shutdown" \/ critical then "extinguish heat source"; "Sensor malfunction" : bool; "alert signalled to the operator" : bool; R3 := if critical \/ "Sensor malfunction" then "alert signalled to the operator"; "The vessel is being heated" : bool; "operator is procedurally required to notify the control system that he is actively monitoring the system at least once every five minutes" : bool; R4 := if "The vessel is being heated" \/ critical then "operator is procedurally required to notify the control system that he is actively monitoring the system at least once every five minutes"; "Operator notifications are required" := "The vessel is being heated" \/ critical; "An operator notification has not been received within the last five minutes" : bool; "warning signalled to operator" : bool; R5 := if "An operator notification has not been received within the last five minutes" /\ "Operator notifications are required" then "warning signalled to operator"; "A warning is not acknowledged within 30 seconds of being signalled" : bool; R6 := if "A warning is not acknowledged within 30 seconds of being signalled" then "extinguish heat source"; Vessel := R1 /\ R2 /\ R3 /\ R4 /\ R5 /\ R6;
The definition of Automatically Generated Test Frames from a Formal SpecificationTest frames are produced from a formal specification by identifying which conditions are responses of the system (indicated by a predicate beginning with a lower case letter) and which are stimuli. They are then re-assembled into a set of test classes. A set of test frames is generated for each test class.
Test frames for the formal specification can be produced using the TCG tool and are
shown below.
The HTML for this page was generated with the command
tcg vessel.s -C -H Vessel
Test Class 1temp > 514 \/ pressure > 78 \/ temp > 480 /\ pressure > 52 ==> critical --Test Frame 1:
--Test Frame 2:
--Test Frame 3:
Test Class 2"Receipt of shutdown" \/ "A warning is not acknowledged within 30 seconds of being signalled" ==> "extinguish heat source" --Test Frame 1:
--Test Frame 2:
Test Class 3temp > 514 \/ pressure > 78 \/ temp > 480 /\ pressure > 52 ==> "extinguish heat source" /\ "alert signalled to the operator" /\ "operator is procedurally required to notify the control system that he is actively monitoring the system at least once every five minutes" --Test Frame 1:
--Test Frame 2:
--Test Frame 3:
Test Class 4"Sensor malfunction" ==> "alert signalled to the operator" --Test Frame 1:
Test Class 5"The vessel is being heated" ==> "operator is procedurally required to notify the control system that he is actively monitoring the system at least once every five minutes" --Test Frame 1:
Test Class 6"An operator notification has not been received within the last five minutes" /\ "The vessel is being heated" \/ "An operator notification has not been received within the last five minutes" /\ (temp > 514 \/ pressure > 78 \/ temp > 480 /\ pressure > 52) ==> "warning signalled to operator" --Test Frame 1:
--Test Frame 2:
--Test Frame 3:
--Test Frame 4:
|