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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Advanced Topics 245<br />

14.4 <strong>Model</strong>ing techniques using composition and features<br />

Composition and features can be used for many different purposes. This has been<br />

illustrated with numerous examples in the book. In this section we provide a brief<br />

summary of the techniques according to the following topics:<br />

• Feature-oriented modeling<br />

• Scenario control<br />

• Parameter generation<br />

• Property checking<br />

• State refinement<br />

14.4.1 Feature-oriented modeling<br />

This was the main topic of this chapter. The idea is that a large system is divided<br />

into separate features. There is one model program per feature. The composition<br />

of all the feature model programs is the model program of the whole system. It<br />

helps to separate concerns and helps to keep the individual feature model programs<br />

managable size. When the features use disjoint state variables it is a matter of style<br />

whether to introduce separate model programs (with distinct namespaces) or to use a<br />

single model program (with a single namespace) and with multiple Feature classes.<br />

14.4.2 Scenario control<br />

The most common style of scenario contol is to write an FSM model program that<br />

describes a particular pattern of actions. Such a pattern is usually a regular expression<br />

(see also Exercise 4 in this connection). For testing, there is often a startup phase<br />

consisting of a particular sequence of actions that drive the system under test to a<br />

particular state, followed by an exploration phase that allows most of the actions to<br />

be explored exhaustively, followed by a finalization phase that is again a particular<br />

sequence of actions that causes the system under test to be cleaned up so that a new<br />

test run can be started.<br />

For scenario control one can also use dependent features of model programs for<br />

state-dependent enabling condition strengthening.<br />

14.4.3 Parameter generation<br />

A typical use of FSM model programs is to restrict parameter domains of actions of<br />

the contract model program so that the composition of the contract model program<br />

and the FSM scenario is explorable.<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!