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.

ClientSend()<br />

7<br />

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

8<br />

13<br />

0<br />

ServerSocket()<br />

1<br />

ServerBind()<br />

2<br />

ServerListen()<br />

3<br />

ClientSocket()<br />

4<br />

ClientConnect()<br />

5<br />

ServerAccept()<br />

6<br />

ServerReceive() ClientClose() ServerSend(double("99.9")) ClientReceive() / double("99.9") ServerSend(double("100")) ClientReceive() / double("100")<br />

12<br />

ServerCloseConnection()<br />

ServerClose()<br />

Figure 7.15. Client/server: test scenario composed with contract model program.<br />

9<br />

state-dependent parameter generation, or when enabling conditions must depend on<br />

the contract model program state in other ways. Composed programs cannot share<br />

state, so use composition when you can describe the scenario you want in terms<br />

of sequences of actions, without refering to the contract model program state. In<br />

particular, use composition when the scenario can be expressed as an FSM.<br />

7.5 Composition for analysis<br />

<strong>We</strong> now show how composition can be used for analysis. Recall that the analysis<br />

methods discussed in Chapter 6 require you to write Boolean expressions that<br />

identify unsafe states (for safety analysis) or accepting states (for liveness analysis).<br />

But sometimes it is easier to express requirements in terms of actions, rather than<br />

states. For example, in the reactive system, we can express the safety requirement<br />

more free ebooks download links at:<br />

http://www.ebook-x.com<br />

10

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

Saved successfully!

Ooh no, something went wrong!