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 225<br />

Only a subset of the information that is present in the concrete messages of the protocol<br />

is relevant for modeling these protocol features. Therefore, concrete messages<br />

of the protocol are mapped to the abstract actions of the model program as follows.<br />

Each message has a particular command field that indicates the operation requested<br />

by the client or responded by the server. For this protocol it is natural to map the kind<br />

of the message, that is, whether it is a request or a response message, together with<br />

the command field of the message to one action symbol. This is because there are<br />

only a couple of dozen commands in total and different features are very naturally<br />

related to different groups of commands. Without loss of generality, we suppose that<br />

the commands are Setup, Work, and Cancel. The corresponding action symbols are<br />

as follows:<br />

• ReqSetup and ReqWork are action symbols that represent requests from the client<br />

to execute the commands Setup and Work, respectively. A setup (work) request<br />

is an action ReqSetup(m,c) (ReqWork(m,c)), where m is a message ID and c is a<br />

number of requested credits.<br />

• ResSetup and ResWork are action symbols that represent responses from the<br />

server to commands Setup and Work, respectively. A setup (work) response is<br />

an action ResSetup(m,c,s) (ResWork(m,c,s)), where m is a message ID, c is a<br />

number of granted credits, and s is a status value.<br />

• Cancel is used as an action symbol that represents a request from the client to<br />

cancel a previous operation; that is, the command is Cancel. Acancel request<br />

has the form Cancel(m), where m is a message ID. There is no response to a<br />

cancel request.<br />

Each action symbol has a number of parameters that corresponds to the number of<br />

relevant fields in the messages. As said, not all of the fields of messages are relevant.<br />

If we were to consider more features of the protocol, the number of parameters of<br />

the action symbols would be bigger but the remaining arguments would be ignored<br />

in the model programs of the above features.<br />

14.2.1 Credits feature<br />

The protocol is designed to prevent the client from overwhelming the server with too<br />

many requests. The client can only use certain message identifiers to communicate<br />

with the server. Each identifier can only be used once. The identifiers that the client<br />

can use can be seen as a pool of numbers. The client can ask for additional credits<br />

in the requests that it sends to the server in order to expand the pool. The server<br />

may grant credits in its responses to the client. The number of credits granted by the<br />

server determines how the pool grows or shrinks as time progresses. There is quite<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!