Software Engineering for Students A Programming Approach
Software Engineering for Students A Programming Approach Software Engineering for Students A Programming Approach
9.2 Identifying data flows 113 Notice again the essential components – data flows (lines) and functions (bubbles). Each line is labeled to describe exactly what data it is. Each bubble is labeled with a verb to describe what it does. We could go on redrawing our data flow diagram for the chef in the kitchen, adding more and more detail. There are, for example, other ingredients, like tomatoes to consider (data flows) and more detailed actions (bubbles), such as mixing in the various ingredients. We started with a single, high-level diagram in which all the detail was hidden. We end with a richer, more detailed diagram in which the components of the system (and their interrelationships) are revealed. In a computer system, the bubbles correspond to the software components. We have created a design for the kitchen system expressed in terms of components and the flows of data between the components. 9.2 ● Identifying data flows We will use as a case study the design of software to monitor a patient in a hospital. The specification (Appendix A) for the software is: A computer system monitors the vital signs of a patient in a hospital. Sensors attached to a patient send information continually to the computer: ■ heart rate ■ temperature ■ blood pressure Some of the readings require conversion to useful units of measurement (e.g. micro volts into degrees centigrade). The computer displays the information on a screen. It also logs the information in a file that can be retrieved and displayed. If any of the vital signs exceeds safe limits, the screen flashes a warning and an alarm sounds. The limits have default values, but can also be changed by the operator. If a sensor fails, the screen flashes a warning and the alarm sounds. The data flow diagram of the major data flow for this software is shown in Figure 9.3. It is straightforward to draw this diagram simply by reading the specification closely and picking out the functional steps that need to be carried out. This diagram also shows some data stores. These are drawn as open boxes and represent files or databases. The difference between a data store and a data flow is that a data store is static (it does not move). Drawing the data flow diagram for a proposed piece of software is a vital step in the method. How do we do it? There are three alternative approaches. Method 1 is to start with a single bubble like Figure 9.4 that shows the overall function of the software and its input and output data flows. We then refine the bubble, or break it down, into a set of smaller bubbles like Figure 9.5. We continue redrawing bubbles as sets of smaller ones until we can’t do it any more. In method 2 we start with the output data flow from the system and try to identify the final transformation that has to be done to it. Then we try to identify the transformation before that, and so on, until we have a complete diagram.
114 Chapter 9 ■ Data flow design raw data converted data status information data read data convert check display message message Figure 9.3 Data flow diagram for patient monitoring software input data flow Figure 9.4 Initial data flow diagram input data flow function A Figure 9.5 Refined data flow diagram overall function data flow conversion factors function B safe limits output data flow output data flow
- Page 86 and 87: 5.8 Help systems 63 Our plan is to
- Page 88 and 89: Further reading 65 5.5 Design a use
- Page 90 and 91: CHAPTER 6 Modularity This chapter e
- Page 92 and 93: 6.2 Why modularity? 69 observed fau
- Page 94 and 95: Figure 6.1 Two alternative software
- Page 96 and 97: ■ a simple program is more likely
- Page 98 and 99: 6.6 Information hiding 75 The class
- Page 100 and 101: 6.8 ● Coupling 6.8 Coupling 77 We
- Page 102 and 103: 6. Method calls with parameters tha
- Page 104 and 105: 3. Temporal cohesion 6.9 Cohesion 8
- Page 106 and 107: > } public void setY(int newY) { y
- Page 108 and 109: • Exercises 6.1 What is modularit
- Page 110 and 111: CHAPTER 7 Structured programming Th
- Page 112 and 113: 7.2 Arguments against goto 89 If we
- Page 114 and 115: ■ if-then-else ■ while-do or re
- Page 116 and 117: 7.3 Arguments in favor of goto 93 l
- Page 118 and 119: 7.4 Selecting control structures 95
- Page 120 and 121: while do if endif then else endWhil
- Page 122 and 123: • Exercises 7.1 Review the argume
- Page 124 and 125: count = 0 loop: count = count + 1 i
- Page 126 and 127: > 8.2 Case study 103 A statement th
- Page 128 and 129: start button event create defender
- Page 130 and 131: 8.3 ● Discussion Abstraction One
- Page 132 and 133: Exercises 109 skill. On the other h
- Page 134 and 135: CHAPTER 9 This chapter explains: 9.
- Page 138 and 139: 9.3 Creation of a structure chart 1
- Page 140 and 141: SELF-TEST QUESTION 9.4 Discussion 1
- Page 142 and 143: Exercises 119 During the second sta
- Page 144 and 145: CHAPTER 10 This chapter explains:
- Page 146 and 147: In English, this reads: 10.2 A simp
- Page 148 and 149: 10.2 A simple example 125 Now comes
- Page 150 and 151: 10.4 Multiple input and output stre
- Page 152 and 153: Process header Process issue 10.4 M
- Page 154 and 155: 10.5 Structure clashes 131 As seen
- Page 156 and 157: 10.5 Structure clashes 133 Let us r
- Page 158 and 159: 10.6 Discussion 135 ■ teachable -
- Page 160 and 161: Exercises 137 2. a control block, s
- Page 162 and 163: CHAPTER 11 Object-oriented design T
- Page 164 and 165: Figure 11.1 The cyberspace invaders
- Page 166 and 167: SELF-TEST QUESTION 11.1 Derive info
- Page 168 and 169: 11.5 Class-responsibility-collabora
- Page 170 and 171: 11.7 ● Discussion Summary 147 OOD
- Page 172 and 173: 11.11 Compare and contrast the prin
- Page 174 and 175: CHAPTER 12 This chapter explains: 1
- Page 176 and 177: 12.3 Delegation 153 The concepts of
- Page 178 and 179: 12.5 Factory method 155 The followi
- Page 180 and 181: 12.8 Model, view controller (observ
- Page 182 and 183: Figure 12.4 Pipe and Filter pattern
- Page 184 and 185: Figure 12.6 Layers in a distributed
9.2 Identifying data flows 113<br />
Notice again the essential components – data flows (lines) and functions (bubbles).<br />
Each line is labeled to describe exactly what data it is. Each bubble is labeled with a verb<br />
to describe what it does.<br />
We could go on redrawing our data flow diagram <strong>for</strong> the chef in the kitchen,<br />
adding more and more detail. There are, <strong>for</strong> example, other ingredients, like tomatoes<br />
to consider (data flows) and more detailed actions (bubbles), such as mixing in the<br />
various ingredients.<br />
We started with a single, high-level diagram in which all the detail was hidden. We<br />
end with a richer, more detailed diagram in which the components of the system (and<br />
their interrelationships) are revealed. In a computer system, the bubbles correspond to<br />
the software components. We have created a design <strong>for</strong> the kitchen system expressed in<br />
terms of components and the flows of data between the components.<br />
9.2 ● Identifying data flows<br />
We will use as a case study the design of software to monitor a patient in a hospital. The<br />
specification (Appendix A) <strong>for</strong> the software is:<br />
A computer system monitors the vital signs of a patient in a hospital. Sensors attached<br />
to a patient send in<strong>for</strong>mation continually to the computer:<br />
■ heart rate<br />
■ temperature<br />
■ blood pressure<br />
Some of the readings require conversion to useful units of measurement (e.g. micro volts<br />
into degrees centigrade). The computer displays the in<strong>for</strong>mation on a screen. It also logs<br />
the in<strong>for</strong>mation in a file that can be retrieved and displayed. If any of the vital signs<br />
exceeds safe limits, the screen flashes a warning and an alarm sounds. The limits have<br />
default values, but can also be changed by the operator. If a sensor fails, the screen flashes<br />
a warning and the alarm sounds.<br />
The data flow diagram of the major data flow <strong>for</strong> this software is shown in Figure 9.3.<br />
It is straight<strong>for</strong>ward to draw this diagram simply by reading the specification closely and<br />
picking out the functional steps that need to be carried out.<br />
This diagram also shows some data stores. These are drawn as open boxes and represent<br />
files or databases. The difference between a data store and a data flow is that a<br />
data store is static (it does not move).<br />
Drawing the data flow diagram <strong>for</strong> a proposed piece of software is a vital step in the<br />
method. How do we do it? There are three alternative approaches.<br />
Method 1 is to start with a single bubble like Figure 9.4 that shows the overall function<br />
of the software and its input and output data flows. We then refine the bubble, or<br />
break it down, into a set of smaller bubbles like Figure 9.5. We continue redrawing<br />
bubbles as sets of smaller ones until we can’t do it any more.<br />
In method 2 we start with the output data flow from the system and try to identify the<br />
final trans<strong>for</strong>mation that has to be done to it. Then we try to identify the trans<strong>for</strong>mation<br />
be<strong>for</strong>e that, and so on, until we have a complete diagram.