Presentation is loading. Please wait.

Presentation is loading. Please wait.

VIENNA DEVELOPMENT METHOD -II. Improving the Incubator System  The software will not only record the current temperature of the system, but will also.

Similar presentations


Presentation on theme: "VIENNA DEVELOPMENT METHOD -II. Improving the Incubator System  The software will not only record the current temperature of the system, but will also."— Presentation transcript:

1 VIENNA DEVELOPMENT METHOD -II

2 Improving the Incubator System  The software will not only record the current temperature of the system, but will also control the hardware  The system will be able to respond to a request from the user to change the temperature, and to signal the hardware to increase or decrease the temperature.  When the software receives such a signal, in addition to recording the new temperature, it must send back a response  This response tells the hardware whether changes are required or not required to achieve the temperature that has been requested.

3 Improving the Incubator System 1.New system will behave according to initial behavior 2.In the new system, the temperature of the incubator will not be recorded until a message is received from the hardware 3.The operations on the system will not be able to run until the initial temperature is set. 4.It will be necessary for the software to record both the actual temperature of the system and the requested temperature

4 The UML diagram for the new software The previous class IncubatorMonitor

5 Specifying enumerated types  Three operations of the class IncubatorController requestChange, increment and decrement) have an output of type Signal;  Signal is not a standard UML type such as Integer;  The internal details of this Signal class are relevant to the specification of the IncubatorMonitor class

6 Specifying Enumerated Types  The signal that must be sent to the hardware could be one of three possible values:  an instruction to the hardware to increase the temperature;  an instruction to the hardware to decrease the temperature;  an instruction to the hardware to do nothing. A type that consists of a number of named values is often referred to as an enumerated type;

7 In VDM-SL the types clause is the appropriate place to define new types. UML Specification of Signal type A type is defined by type construction

8 Specifying the state of the IncubatorController ·  There need to be two components of the state  hold the actual temperature  hold the temperature that has been requested  when the system first comes into being these values will be undefined, therefore be set to nil

9 The Invariant  The actual temperature must not be allowed to go outside the range of -10 to +10 degrees;  We also know the possibility that actual temprature could be equal to the nil value;  The same is true for the requested temperature.  They are defined as make function

10 Improving the Readibility of the Specification by using a function  T he purpose of this function is to check whether an integer value, val, is within the range MIN and MAX as defined earlier  we can now use this function in the invariant,:

11 Specifying the Operations for the IncubatorController  Initial temperature of the system;  This will be invoked by the hardware when the incubator has established a initial temperature  Initialization clause  The initialization clause is simply a function that states the conditions that must exist  When the system first comes into being - it is not an operation that can be invoked during the system's life time.

12  setInitialSet operation requires an input parameter TempIn  read-write access is needed to the actualTemp component,  Preconditon: the first conjunct is validating the input - if the input value is out of range, then the behavior of the system for this operation is not defined; the second part ensures the actual temperature of the incubator has a value of nil,  Once the temperature has been set, the temperature has an actual value, and this operation could not take place again unless some other operation set the temperature back to nil; The setInitialTemp Operation

13 The requestChange Operation  This operation records the value of the temperature  It has been requested by the user of the system, and to signal the hardware to take the appropriate action in order to bring about the change;  It will require an input of an integer, and will result in an output of type Signal.

14  we need access to both components of the state, but the mode of access is different in each case;  case of requestedTemp requires to have write access to this component  we must record the temperature that has been requested;  case of actualTemp, requires read access in order to compare it to the requested temperature and determine the action that must be taken by the hardware.  the precondition is similar to that of the previous operation, but we are checking that the actual temperature is not undefined, thus the initial temperature had been properly set.  the postcondition consists of two conjuncts;

15 The increment operation The precondition consists of three conjuncts  The first checks that the actual temperature is less than the requested temperature (otherwise we should not increment it); Since all operations must preserve the invariant, assume that the requested temperature will not be greater than MAX, so this conjunct automatically checks that the actual temperature is less that the maximum allowed temperature; The second and third conjuncts check that an initial temperature and a requested temperature has been set.

16 Operations for the Requested Temperature and the Actual Temperature:

17 A standard template for VDM-SL specifications

18 values MAX:  =10 MIN : Z=--10 The system that monitored the temperature of an incubator


Download ppt "VIENNA DEVELOPMENT METHOD -II. Improving the Incubator System  The software will not only record the current temperature of the system, but will also."

Similar presentations


Ads by Google