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.

124 Structuring <strong>Model</strong> Programs with Features and Composition<br />

0<br />

B() C()<br />

1<br />

Figure 7.7. <strong>Model</strong> program M2.<br />

0<br />

A()<br />

1<br />

B(2)<br />

2<br />

C()<br />

3<br />

Figure 7.8. <strong>Model</strong> program M1 × M2, the product of M1 and M2.<br />

Let us explain exactly how the FSM of the product M1 × M2 in Figure 7.8 was<br />

obtained. There is a systematic method for generating the product of two model<br />

programs. First, identify the action vocabulary for each program, and the unshared<br />

actions from the other program. For M1 the action vocabulary is A, B and there is<br />

one unshared action, C;forM2 the action vocabulary is B, C and the unshared action<br />

is A. Then, form the loop extension of each program: at each state, add a self-loop<br />

transition for each of the unshared actions. The two loop extensions now have the<br />

same action vocabulary. Moreover, in the loop extensions, actions with the same<br />

action symbol are made to have the same arity (number of parameters) by extending<br />

them with placeholder parameters indicated by (underscore). Here the action B()<br />

from M2 becomes B( ) in the loop extension of M2, so it has the same arity as B(2) in<br />

M1. Figures 7.9 and 7.10 show the loop extensions of M1 and M2, respectively. The<br />

product is generated from these loop extensions.<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!