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.

50 <strong>Why</strong> <strong>We</strong> <strong>Need</strong> <strong>Model</strong>-<strong>Based</strong> Analysis<br />

4<br />

Command()<br />

7<br />

1<br />

0<br />

Command()<br />

Timeout()<br />

2<br />

3<br />

Reset()<br />

Message("99.9") TimeoutMsgLate()<br />

Figure 3.10. Portion of controller FSM showing deadlock.<br />

5<br />

Message("999.9")<br />

6<br />

TimeoutMsgLost()<br />

8<br />

19<br />

20<br />

21<br />

NoHandler()<br />

Command()<br />

NoHandler() Command()<br />

For liveness analysis, the tool can search for dead states from which the controller<br />

cannot reach any accepting states where the program’s goals have been achieved.<br />

The most obvious dead states are deadlock states: the program stops, as in the<br />

LostMessageWhenIdle run (Figure 3.10). The deadlock is indicated here by the loop<br />

of alternating Command and NoHandler actions, from which there is no escape. The<br />

supervisor can always command the controller, so the Command action is always<br />

enabled. But the controller can do nothing; recall that NoHandler is a dummy action<br />

that indicates no handlers are enabled. Other dead states belong to livelocks where<br />

the program cycles without making progress. In this FSM, we find the same cycle<br />

of actions with no escape that we found in the InitialOutOfRangeMessage run:<br />

Timeout, Reset, Message, CheckMessage (Figure 3.11).<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!