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.

ServerClose()<br />

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

3<br />

5<br />

ServerClose()<br />

2<br />

0<br />

ServerSocket()<br />

ClientSocket()<br />

ServerBind() ClientSocket() ServerSocket()<br />

ServerListen()<br />

6<br />

ServerClose() ClientSocket()<br />

10<br />

ClientSocket()<br />

8<br />

ClientConnect()<br />

7<br />

1<br />

4<br />

ServerListen()<br />

Figure 7.2. Client/server: the first few transitions of all runs.<br />

ServerBind()<br />

ServerClose()<br />

ServerClose()<br />

9<br />

ServerClose()<br />

This example shows that we often know a priori – before any exploration or<br />

testing – that we do not want to consider certain runs. <strong>We</strong> need a way to use this a<br />

priori knowledge – or other preferences – in automated analysis and testing. But we<br />

do not want to put limitations into the model program itself. <strong>We</strong> want to separate the<br />

contract model program that describes all allowed behaviors from scenario control,<br />

the limitations we introduce to focus on interesting runs. Then we can use the same<br />

contract model program to analyze or test many different scenarios. Features and<br />

composition make this possible.<br />

7.2 Features<br />

A feature is a cluster of related state variables and actions that can be selectively<br />

included or excluded from a model program. Features make it possible to define<br />

different configurations for a model program, which include different subsets of<br />

features, in a single source program file (or collection of files). In addition, features<br />

can be combined for purposes of scenario control.<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!