Since we intend to use
it for testing, we must show that it behaves as the implementation is supposed to
behave. We can do a few simulation runs as we did in Section 5.5, simulating the
test run of Chapter 2, Section 2.8, for example.We will analyze this model program
more thorougly in Chapter 6 and use it to generate and check tests in Chapter 8. But
first we present another model program.
5.7 Case study: reactive program
In this section we model the reactive system discussed in Chapter 3. This example
shows how a single model program can represent a reactive program interacting
with its environment.
5.7.1 Preliminary analysis
Purpose
The purpose of this model program is to be the subject of a design analysis that
can reveal the design errors that we discovered by testing in Chapter 3, Sections 3.4
and 3.5.
We also plan to use this model program for testing. After the design errors are
corrected in the model program, we will be able to use the corrected model program
to generate and check tests for the revised implementation (which still might have
defects).
Systems with Finite Models 83
Features
We will model all of the features of the implementation Controller class (Chapter 3,
Section 3.1).
We must also model the controller??™s environment: the timer, sensor, and supervisor
(Chapter 3, Figure 3.1). This is necessary in order to model events realistically.
Pages:
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131