Information Technology Reference
In-Depth Information
Requirement 1: Arming. The system is armed 20 seconds after the vehicle is
locked and the bonnet, luggage compartment and all doors are closed.
Requirement 2: Alarm. The alarm sounds for 30 seconds if an unauthorized
person opens the door, the luggage compartment or the bonnet. The hazard
flasher lights will flash for five minutes.
Requirement 3: Deactivation. The anti-theft alarm system can be deactivated
at any time, even when the alarm is sounding, by unlocking the vehicle from
outside.
When trying to construct an animated model based on textual requirements it is
often the case that conflicts or underspecified situations become apparent. One
might think that the simplistic car alarm system is suciently described by these
three textual requirements - the contrary is the case. What is left unspecified is
the case of what happens when an alarm is ended by the five minute timeout:
does the system go back to armed directly, or does it need to wait for all doors
to be closed again before returning to armed?
2.1 Testing Interface and Instantiation
The UML model of the car alarm system comprises four classes and four signals,
as shown in Fig. 1. The class AlarmSystem is marked as system under test (SUT)
and may receive any of the Lock , Unlock , Close ,or Open signals. At the same
time, the SUT calls methods of the classes AlarmArmed , AcousticAlarm ,and
OpticalAlarm - all of them marked as being part of the environment.
Notice that the context diagram specifies the observations (all calls to methods
being part of the environment) we can make and the stimuli the system under
test can take (all signals). In effect, this diagram specifies our testing interface.
+ opticalAlarm
«system_under_test»
AlarmSystem
«signal»
Lock
«signal»
Unlock
+ acousticAlarm
+ alarmArmed
[1]
[1]
[1]
Lock
Unlock
Closed
Opened
«environment»
AlarmArmed
«environment»
AcousticAlarm
«environment»
OpticalAlarm
«signal»
Close
SetOn()
SetOff()
SetOn()
SetOff()
SetOn()
SetOff()
«signal»
Open
Fig. 1. Car Alarm System - Testing Interface
We use an initialization diagram (not shown) to specify the system configu-
ration: we create a singleton object for each of the classes.
2.2 State Machine
Fig. 2 shows the CAS state-machine diagram. From the state OpenAndUnlocked
one can traverse to ClosedAndLocked by closing all doors and locking the car.
Search WWH ::




Custom Search