Systems with Finite Models 129
Recall that the purpose of scenario control is to eliminate runs allowed by a
contract model program that are not pertinent to the particular issue we wish to
analyze or test. The unwanted runs can be eliminated by composing the contract
model program with a scenario model program that encodes the runs we wish to
see. It is often convenient to code the scenario model program as an FSM. Recall
that composition has the effect of selecting only the runs that are allowed by both
composed programs. If there is a particular sequence of actions you want to see
in the product, put that sequence in the scenario model program. If there are other
actions you would allow to interleave in the product, do not mention those actions
in the scenario model program. If there are actions you want to eliminate from the
product, include those actions in the vocabulary of the scenario model program but
do not write any transitions that use them. This has the effect of disabling those
actions in all states.
There is a typical scenario that we oftenwant to use for testing: first, a sequence of
setup actions, then several (or many) interleaved test actions, and finally, a sequence
of cleanup actions. Figure 7.14 shows a model program for generating such a
scenario from the client/server model program. Compare this to the true FSM for
the contract model program (Figures 7.
Pages:
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193