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.

14 <strong>Why</strong> <strong>We</strong> <strong>Need</strong> <strong>Model</strong>-<strong>Based</strong> <strong>Testing</strong><br />

Temperature<br />

sensor<br />

✛<br />

✲<br />

Embedded<br />

computer<br />

(Server)<br />

✛<br />

Figure 2.1. Remote instrument, a client/server system.<br />

✛<br />

commands<br />

TCP/IP network<br />

responses<br />

At the data storage computer, we invoke the client program Logger:<br />

Logger 128.95.165.121 8023 3 10 F<br />

✲<br />

✲<br />

Data logging<br />

computer<br />

(Client)<br />

Here the command line arguments are the server host IP address and port number, the<br />

number of temperature samples to acquire before exiting, the time interval between<br />

samples in seconds, and the units (Celsius or Fahrenheit) for expressing the samples.<br />

Logger then acquires the samples and writes them to the console, along with a time<br />

stamp and information about the server.<br />

2006-10-26 13:12:42Z Temperature server at port 8023 reports 72.2 F<br />

2006-10-26 13:12:52Z Temperature server at port 8023 reports 72.4 F<br />

2006-10-26 13:13:02Z Temperature server at port 8023 reports 72.5 F<br />

Monitor also writes messages about client connections to the console on the<br />

embedded computer.<br />

2006-10-26 13:12:34Z Temperature server binds port 8023<br />

2006-10-26 13:12:42Z Temperature server accepts connection<br />

2006-10-26 13:13:12Z Temperature server connection closed<br />

2006-10-26 13:13:12Z Temperature server exits<br />

It might seem that not much could go wrong with such a simple system. But we<br />

have already experienced failures, and some have been intermittent and difficult to<br />

reproduce. Therefore, we have resolved to test and analyze the system thoroughly,<br />

to discover the different ways it can fail, in order to prepare for correcting defects<br />

or designing a more robust system.<br />

Before we can describe our testing and analysis, we must explain a bit more about<br />

how our programs work.<br />

2.2 Protocol<br />

Our two programs implement a protocol, an agreement about how to work together.<br />

A protocol is defined by rules for forming messages and rules that constrain the<br />

ordering of the messages. In this example, the “messages” in the protocol are the<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!