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.

Advanced Topics 237<br />

ReqSetup(3, _)<br />

Map(3 -> CMD("Setup"))<br />

Map()<br />

ResSetup(3, _, _)<br />

ReqWork(4, _) ResWork(4, _, _) ReqWork(4, _) ResWork(4, _, _)<br />

Map(3 -> CMD("Setup"),4 -> CMD("Work"))<br />

ResSetup(3, _, _)<br />

ReqSetup(3, _)<br />

Map(4 -> CMD("Work"))<br />

Figure 14.14. Composition of the commands model program in Figure 14.12 with the FSM in Figure 14.13.<br />

Labels on states show the value of cmd.<br />

Inactive<br />

ReqSetup()<br />

Activating<br />

Active<br />

ResSetup(_, _, STATUS("Cancelled"))<br />

ResSetup(_, _, STATUS("Completed"))<br />

ReqWork()<br />

ResWork()<br />

FSM("Inactive", AcceptingStates("Active"),<br />

Transitions(t("Inactive",ReqSetup(),"Activating"),<br />

t("Activating",ResSetup(_,_,STATUS("Cancelled")),"Inactive"),<br />

t("Activating",ResSetup(_,_,STATUS("Completed")),"Active"),<br />

t("Active",ReqWork(),"Active"),<br />

t("Active",ResWork(),"Active")))<br />

Figure 14.15. Setup model program.<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!