07.01.2013 Views

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

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.

478 George D<strong>in</strong><br />

altstep Default() runs on PTCType {<br />

[] httpPort.receive {<br />

localTimer.stop;<br />

setverdict (fail);<br />

}<br />

[] localTimer.timeout {<br />

setverdict (fail);<br />

}<br />

}<br />

Program Statements A program element (test case, function or altstep) may<br />

conta<strong>in</strong> different types of statements and operations:<br />

• program statements: expressions, assignments, loop constructs<br />

• behavioral statements: sequential behavior, alternative behavior, <strong>in</strong>terleav<strong>in</strong>g,<br />

defaults<br />

• communication operations: send, receive, call, getcall<br />

• timer operations: start, stop, runn<strong>in</strong>g<br />

• verdict handl<strong>in</strong>g: set<br />

Snapshot Semantic One of the most important features of TTCN-3 is the<br />

snapshot mechanism which allows the def<strong>in</strong>ition of complex <strong>in</strong>terleaved or parallel<br />

behaviors. Alternatives are complex behaviors whose sequences of statements<br />

are def<strong>in</strong>ed as multiple alternatives. To def<strong>in</strong>e a branch <strong>in</strong> an alternative<br />

behavior, the alt statement is used.<br />

The execution environment will execute the alternatives by us<strong>in</strong>g snapshots.<br />

Each branch of an alternative has an associated guard. The guard represents one<br />

or more conditions (boolean expressions) that must be fulfilled <strong>in</strong> order to enter<br />

a branch. A snapshot is a state of the test system that <strong>in</strong>cludes all <strong>in</strong>formation<br />

necessary to evaluate the guard of an alt branch. A snapshot is taken when<br />

execut<strong>in</strong>g an alt statement; that means that all relevant <strong>in</strong>formation is collected<br />

and used for evaluation of guards. This <strong>in</strong>formation conta<strong>in</strong>s the states of the<br />

components, the timer events and the port enqueued messages. The test system<br />

may change its configuration, but the alt statement is evaluated accord<strong>in</strong>gly to<br />

the snapshot. The execution environment selects only the branches whose guard<br />

conditions are fulfilled. If there is more than one valid guard, then the first one<br />

is chosen. If none is valid, then the alt is reevaluated with a new snapshot.<br />

Communication Operations The communication operations are some of the<br />

most important operations used to specify test behaviors. TTCN-3 supports<br />

message-based and procedure-based communication. The communication operations<br />

can be grouped <strong>in</strong>to two parts: stimuli which send <strong>in</strong>formation to SUT<br />

(send, call, reply raise) and responses used to describe the reaction of the SUT<br />

(receive, getreply, trigger, catch).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!