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.

0<br />

ShowTitles()<br />

1<br />

SortByFirst()<br />

2<br />

SortByFirst()<br />

3<br />

ShowText()<br />

4<br />

Systems with Finite <strong>Model</strong>s 133<br />

Figure 7.16. Newsreader scenario FSM for analysis by composition.<br />

0<br />

1<br />

2<br />

ShowTitles()<br />

SortByFirst()<br />

Figure 7.17. News reader scenario FSM, incomplete projection after composition.<br />

might interleave anywhere among the actions of the scenario. Defining the scenario<br />

vocabulary as we do here prevents these unwanted interleavings from confusing the<br />

analysis.<br />

Figure 7.16 shows the FSM for this scenario. <strong>We</strong> compose this with the contract<br />

model program (whose FSM is shown in Chapter 6, Figure 6.2). Figure 7.17 shows<br />

the projection of the product onto the scenario. The projection is incomplete; it only<br />

includes the first two transitions of the scenario. This shows that the contract model<br />

program cannot execute this scenario, because the third transition of the scenario is<br />

not enabled in the contract model program. It was at this point that the simulation<br />

failed (Chapter 5, Section 5.5). The FSM of the product shows the same thing, but<br />

the product sometimes contains additional transitions that make it harder to interpret,<br />

so we recommend inspecting the projection for this analysis.<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!