) Create different
features that use different domains and include the one that generates the scenario
you want. You must include one of these features; a model program cannot be
explored (is not explorable) if there are parameters without domains.
7.3 Composition
Composition combines separate model programs into a new model program called
the product. The product formed by composing model programs M1 and M2 is
written M1?—M2 or M1??—M2. Composition is performed automatically by the analysis
and testing tools when multiple model programs are named on the command line;
the tools can then analyze or test from the product. You can also do composition
in programs you write by calling the library. Composition can be used to build up
complex model programs by combining simpler ones (as we shall see in Chapter 14).
In this chapter we use it for scenario control.
The next section explains how composition is done. The section after that describes
some additional styles for coding model programs that make it easy to write
scenarios for composition. In Section 7.3.3 we will return to using composition for
scenario control.
7.3.1 Understanding composition
Recall that features are classes in the same model program (the same namespace),
which may use the same state variables and are compiled into the same assembly.
In contrast, we compose separate model programs, which can be in separate namespaces
and can be compiled into separate assemblies.
Pages:
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183