(The strategy is
not completely random; it uses the model program to rule out actions that are not
enabled in the current state.) We know that this model program will always reach a
deadlock state or an accepting state, so we don??™t have to make any arrangements to
stop the test runs. Let??™s see if random testing can reveal the defect we know is there.
We issue this command:
ct /r:ClientServer.dll ClientServer.Factory.Create
/r:Stepper.dll /iut:ClientServerImpl.Stepper.Create
/runs:1
One test run executes:
TestResult(0, Verdict("Failure"),
"Run stopped in a non-accepting state",
Trace(
ClientSocket(),
ServerSocket(),
ServerClose()
)
)
The tester randomly chose one of the many paths to a deadlock state (state 9 in
Figure 7.2 in Chapter 7). This happens again and again, so we give ct some guidance
by providing a scenario machine (Figure 7.14 in Chapter 7).
ct /r:ClientServer.dll ClientServer.Factory.Create
/r:Stepper.dll /iut:ClientServerImpl.Stepper.Create
/runs:1
/fsm:Scenario.txt
Systems with Complex State 193
This test run executes:
TestResult(0, Verdict("Success"), "",
Trace(
ServerSocket(),
ServerBind(),
ServerListen(),
ClientSocket(),
ClientConnect(),
ServerAccept(),
ServerSend(double("99.9")),
ClientReceive_Start(),
ClientReceive_Finish(double("99.9")),
ServerSend(double("99.9")),
ClientReceive_Start(),
ClientReceive_Finish(double("99.
Pages:
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263