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.

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

Abstract Test System Interface can also be def<strong>in</strong>ed as a component, s<strong>in</strong>ce its<br />

def<strong>in</strong>ition is the same as a component def<strong>in</strong>ition: a collection of ports used to<br />

connect and communicate with other components.<br />

For D<strong>in</strong>o web service test we def<strong>in</strong>e the MTCType, PTCType and SUTType<br />

components. The SUTType component def<strong>in</strong>es a component type which conta<strong>in</strong>s<br />

an array of ports. This component represents, at an abstract level, the SUT. Accord<strong>in</strong>g<br />

to SUTType def<strong>in</strong>ition the SUT provides many connection ports which<br />

implies that many PTCs can <strong>in</strong>teract with the SUT at the same time.<br />

type component MTCType {}<br />

type component PTCType {<br />

port httpTestPortType httpPort;<br />

timer localTimer := 3.0;<br />

}<br />

type component SUTType {<br />

port httpTestPortType httpTestSystemPort[NUMBER_OF_PTCS];<br />

}<br />

The communication between test components as well as the one between test<br />

components and test system <strong>in</strong>terface are realized over ports. There are two types<br />

of communication: message based (the communication is based on asynchronous<br />

<strong>in</strong>terchange of messages) and procedure based (the communication is realized<br />

<strong>in</strong> form of synchronous remote procedure <strong>in</strong>vocations). Therefore, TTCN-3 supports<br />

two types of ports: message-based and procedure-based ports. Data transmission<br />

directions can be def<strong>in</strong>ed for each port: <strong>in</strong> (the received data), out (the<br />

sent data), <strong>in</strong>out (the data can be both sent or received). Ports can also be<br />

mixed; they can be used both for message-based and for procedure-based communication.<br />

In our example, we use the httpTestPortType port to connect a test component<br />

to the web service (SUT). S<strong>in</strong>ce the communication with the SUT is an<br />

asynchronous one, we def<strong>in</strong>e this port of type message. This port allows to send<br />

request messages like search, update, add or remove. The <strong>in</strong>com<strong>in</strong>g messages can<br />

be of type d<strong>in</strong>osaur, updateAck, addAck or removeAck.<br />

type port httpTestPortType message {<br />

out search;<br />

out update;<br />

out add;<br />

out remove;<br />

<strong>in</strong> d<strong>in</strong>osaur;<br />

<strong>in</strong> updateAck;<br />

<strong>in</strong> addAck;<br />

<strong>in</strong> removeAck;<br />

}

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

Saved successfully!

Ooh no, something went wrong!