The Control Specification

12.6.4 The Control Specification

The control specification (CSPEC) represents the behavior of the system (at the level from which it has been referenced) in two different ways. The CSPEC contains a state transition diagram that is a sequential specification of behavior. It can also contain

a program activation table—a combinatorial specification of behavior. The underly- ing attributes of the CSPEC were introduced in Section 12.4.4. It is now time to con- sider an example of this important modeling notation for structured analysis.

Figure 12.24 depicts a state transition diagram for the level 1 control flow model for SafeHome. The labeled transition arrows indicate how the system responds to events as it traverses the four states defined at this level. By studying the STD, a soft- ware engineer can determine the behavior of the system and, more important, can ascertain whether there are "holes" in the specified behavior. For example, the STD (Figure 12.24) indicates that the only transition from the reading user input state occurs when the start/stop switch is encountered and a transition to the monitoring sys- tem status state occurs. Yet, there appears to be no way, other than the occurrence of sensor event, that will allow the system to return to reading user input. This is an

PA R T T H R E E C O N V E N T I O N A L M E T H O D S F O R S O F T WA R E E N G I N E E R I N G

Control panel

Display action status (complete, in progress)

Interact

with

Start/stop

Activate/ deactivate system

and status

Time display out

Sensor Alarm

Alarm

status Alarm Sensors

Telephone line

F I G U R E 12.23 Level 1 CFD for SafeHome

F I G U R E 12.24

Start/stop switch

State transition

Invoke monitor &

diagram for

control system

Reading

SafeHome

user input

Time out

Sensor event

Invoke

Invoke monitor &

interact with user

control system

Monitoring

system

Acting on a

status

Sensor event

sensor event

Invoke display message & status

Sensor event Invoke display

Sensor event

messages & status

Invoke monitor & control system

Displaying user feedback

Display actions status

Blink flag

Invoke interact with user

Invoke display messages and status Invoke display messages and status

A somewhat different mode of behavioral representation is the process activation table. The PAT represents information contained in the STD in the context of processes, not states. That is, the table indicates which processes (bubbles) in the flow model will be invoked when an event occurs. The PAT can be used as a guide for a designer who must build an executive that controls the processes represented at this level. A PAT for the level 1 flow model of SafeHome software is shown in Figure 12.25.

The CSPEC describes the behavior of the system, but it gives us no information about the inner working of the processes that are activated as a result of this behav- ior. The modeling notation that provides this information is discussed in the next section.