27.07.2013 Views

2 Why We Need Model-Based Testing

2 Why We Need Model-Based Testing

2 Why We Need Model-Based Testing

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Systems with Complex State 209<br />

# factory method of the stepper<br />

/iut:BagImpl.Stepper.Create<br />

# number of steps and runs<br />

/runs:1 /steps:20<br />

<strong>We</strong> can now execute ct @args.txt in a directory that contains the referenced<br />

libraries and get the following output:<br />

reward: 1 actions: Set(Count_Start(), Add("b"), Lookup_Start("b"),<br />

Lookup_Start(""), Add(""), Delete(""), Delete("b"))<br />

reward: 1 actions: Set(Count_Start(), Add("b"), Add(""), Delete(""),<br />

Delete("b"))<br />

reward: 1 actions: Set(Count_Start(), Delete(""), Delete("b"))<br />

reward: 1 actions: Set(Delete(""), Delete("b"))<br />

reward: 0.5 actions: Set(Count_Start(), Add("b"),<br />

Lookup_Start("b"), Lookup_Start(""), Add(""), Delete(""), Delete("b"))<br />

reward: 0.5 actions: Set(Count_Start(), Add("b"), Add(""), Delete(""),<br />

Delete("b"))<br />

reward: 0.5 actions: Set(Count_Start(), Add("b"), Add(""))<br />

TestResult(0, Verdict("Failure"),<br />

"Action ’Count_Finish(-1)’ not enabled in the model<br />

Unexpected return value of finish action, expected: Count_Finish(0)<br />

Unexpected finish action",<br />

Trace(<br />

Lookup_Start("b"),<br />

Lookup_Finish(0),<br />

Add("b"),<br />

Count_Start(),<br />

Count_Finish(1),<br />

Delete("b"),<br />

Lookup_Start(""),<br />

Lookup_Finish(0),<br />

Delete("b"),<br />

Count_Start(),<br />

Count_Finish(-1)<br />

)<br />

)<br />

What is interesting to note here is the effect that the coverage function and the<br />

reward functions have on the action selection process. Notice that all action symbols<br />

are used k times before any of them is used k + 1 times.<br />

more free ebooks download links at:<br />

http://www.ebook-x.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!