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.

102 Exploring and Analyzing Finite <strong>Model</strong> Programs<br />

1<br />

0<br />

SelectMessages()<br />

ShowTitles()<br />

Figure 6.5. Simulation by interactive exploration (1).<br />

1<br />

0<br />

2<br />

SelectMessages() ShowTitles() ShowText()<br />

3<br />

2<br />

SelectMessages()<br />

Figure 6.6. Simulation by interactive exploration (2).<br />

SortByFirst()<br />

4<br />

and select SortByFirst by selecting its next state (Figure 6.5). Proceeding in this<br />

way, we can simulate the entire run. 3<br />

Interactive exploration can also show that a run is not allowed. If we attempt<br />

to explore the second run that we tested in Chapter 5, we find that after the first<br />

SortByFirst transition, the second SortByFirst transition is not enabled, so it is not<br />

possible to execute that run.<br />

It is not always obvious whether or not a particular run (that you might write down)<br />

is allowed by a model program. As we have shown here, interactive exploration is one<br />

way to determine this. But, like any interactive procedure, it is not fully automated<br />

so it can be time-consuming and difficult to repeat. In Chapter 7 we describe another,<br />

3 In mpv, select the initial node with the mouse, press the Delete key to hide all the other states<br />

and transitions, press Enter to display the enabled transitions, press n (next) and p (previous) to<br />

select another node, and so on.<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!