Assembly,
"ClientServer");
}
// Features argument in constructor, include just that feature
public static ModelProgram CreateServerOnly()
{
return new LibraryModelProgram(typeof(Factory).Assembly,
"ClientServer",
new Set
("Server")); //feature
}
}
}
Figure 7.3. Client/server: model program with features (excerpts).
120 Structuring Model Programs with Features and Composition
0
1
ServerSocket()
2
ServerClose()
3
ServerBind()
ServerClose() 4
ServerListen()
ServerClose()
Figure 7.4. Client/server: server feature included, client feature not included.
all of its action methods are true (in all the included features and other classes).
During exploration, the combined action is executed repeatedly in each state, with
each combination of parameter values that is enabled in all of the features. When
the combined action executes, all of the action methods for that action execute, as if
in parallel (actually, in some order that cannot be predicted). This only makes sense
if the next state after executing all the action methods is the same for any order of
execution. This is assured if none of the action methods assigns state variables that
are used by other action methods in the same action.
Here we show how to combine features to control parameter generation, an
aspect of scenario control. Recall that each parameter of each action method must
be provided with a domain, a set of argument values for that parameter.
Pages:
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181