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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

190 Analyzing Systems with Complex State<br />

grouping, then the branching is eliminated. Instead, we explore an action only if it<br />

leads to a state with a Count value that has not previously been seen. The idea in this<br />

example is that the size of the stack is the interesting property and that the particular<br />

choice of elements may be ignored for the purposes of analysis.<br />

The mpv tool supports state grouping over state property state-property with the<br />

/group:state-property switch. More than one /group switch may be supplied. If<br />

grouping is specified then each state must produce a new value for at least one of<br />

the given state properties in order to be included in the exploration.<br />

11.3 Sampling<br />

Up to this point we have discussed pruning techniques that eliminate some transitions<br />

from an exhaustive search. In effect, we are “cutting away” (pruning) choices.<br />

Another category of techniques is sampling. Here we focus on selecting a desirable<br />

path to explore, rather than excluding undesired transitions as with pruning.<br />

Exploration via sampling is a stochastic algorithm because it combines random and<br />

directed aspects.<br />

<strong>We</strong> present exploration via sampling in Chapter 12 in the context of testing.<br />

However, stochastic techniques may be appropriate for design analysis in some<br />

cases where the state space is large.<br />

11.4 Exercises<br />

1. Use the Domain attributes and StateFilter attributes in a feature that makes the<br />

revision control system a finite model program. Which state variables must be<br />

mentioned in your state filter expressions? Which action parameters must be<br />

given finite domains?<br />

2. Use a Domain attribute in a feature to limit the number of users of the revision<br />

control system to two. Then, use state grouping to create two properties that represent<br />

the state of each client. Can you use these properties with state groupings<br />

to eliminate some interleavings? You will also need a property that represents<br />

the state of the repository.<br />

3. Create a scenario for the state repository system that shows all of the ways that<br />

Revert can affect the behavior of the system for one user.<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!