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.

4<br />

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

Command()<br />

7<br />

1<br />

0<br />

Command()<br />

Timeout()<br />

2<br />

3<br />

Reset()<br />

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

5<br />

Message("999.9")<br />

Figure 6.14. Reactive system: interactive exploration showing path to deadlock.<br />

6<br />

TimeoutMsgLost()<br />

8<br />

19<br />

20<br />

21<br />

NoHandler()<br />

Command()<br />

NoHandler() Command()<br />

<strong>We</strong> also reproduce the LostMessageWhenIdle run, where the program reaches<br />

a deadlocks (Figure 6.14). The deadlock is indicated by the loop of alternating<br />

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

is a loop rather than a dead end. The supervisor can always command the controller,<br />

so the Command action is always enabled. But the controller can do nothing; recall<br />

that NoHandler is a dummy action that indicates no handlers are enabled.<br />

These examples confirm that model-based analysis reveals the design errors we<br />

originally discovered by executing the implementation.<br />

In Chapter 7 we will discuss another kind of analysis. Instead of searching for<br />

unsafe states or dead states, that analysis checks temporal properties defined by<br />

sequences of actions.<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!