Sie sind auf Seite 1von 25

Testing and Test Control Notation Version 3 Internationally standardized testing language Product of the European Telecommunications Standards

s Institute (ETSI) A programming language that has been used for more than 15 years in standardization as well as industry Specifically designed for black box testing and certification Constantly developed and maintained at ETSI by a team of leading testing experts from industry, institutes, and academia

ES 201 873-8: The IDL to TTCN-3 Mapping

Proposed: Mappings to XML, C++ Currently: Edition 3 of TTCN-3 (2007/8)

What makes TTCN-3 different From conventional programming or scripting languages? Rich type system including native list types and support for subtyping Embodies powerful build-in matching mechanism Snapshot semantics, i.e., well defined handling of port and timeout queues during their access Concept of verdicts and a verdict resolution mechanism Support for specification of concurrent test behaviour Support for timers Allows test configuration at run-time Tests focus only on implementation to be tested

A testing technology that applies to a variety of application domains and types of testing Proven to work in very large and complex industrial tests, e.g., 3G network elements

Standards from ETSI [some cross-listed as ITU standards] ES 201 873-1 (Z.140): TTCN-3 Core Language ES 201 873-2 (Z.141): TTCN-3 Tabular Presentation Format (TFT) ES 201 873-3 (Z.142): TTCN-3 Graphical Presentation Format (GFT) ES 201 873-4 (Z.143): TTCN-3 Operational Semantics ES 201 873-5: TTCN-3 Runtime Interface (TRI) ES 201 873-6: TTCN-3 Control Interfaces (TCI) ES 201 873-7: Using ASN.1 with TTCN-3

From a test tool or vendor proprietary testing language? Not tied to a particular application or its interface(s) Not tied to any specific test execution environment, compiler or operation system TTCN-3 as such is not executable and requires a compiler/interpreter, adapter as well as codec implementations

TTCN-3 test systems in a nutshell

Main Capabilities of TTCN-3

Dynamic concurrent testing configurations Various communication mechanisms (synch and asynch) Data and signature templates with powerful matching mechanisms Specification of encoding information Display and user-defined attributes Test suite parameterization Test case control and selection mechanisms Assignment and handling of test verdicts Harmonized with ASN.1 and IDL (XML and C++ coming) Different presentation formats Well-defined syntax, static semantics and operational semantics

Uses of Data in TTCN-3 Test Specifications Data in TTCN-3 is used internally to the test component as information passed between test components within the test system as test data transmitted to and received from the System Under Test (SUT)

The grouping mechanism can be used to collect data definitions of a similar kind e.g., Service Primitives (ASP) Protocol Data Units (PDU) internal coordination messages

Matching Mechanis ms Notation


( ... ) not ( ... ) (lower..upper) ? * ... <?> ... ... <*> ... length ifpresent

Description

Match a value in a list of values Match a value not in a list of values Match an integer range Wildcard for any value Wildcard for any value or no value Wildcard for any single element in a string or array Wildcard for any number of consecutive elements in a string or array Match on a restricted length (string type) Match if an optional element is present

Data Templates

Templates are special data values that have the following characteristics matching mechanisms they can be parameterized they can be modified to provide a simple form of inheritance Templates can be applied to simple types as well as complex types Are most often used to define the possible received values of messages and responses to remote procedure calls

Determine which choice has been made in a union type

ischosen

Pre-defined Functions
Convert bitstring value to integer value Convert hexstring value to integer value Convert octetstring value to integer value Convert charstring value to integer value Convert integer value to bitstring value Convert integer value to hexstring value Convert integer value to octetstring value Convert integer value to charstring value Length functions Return the length of a value of any string type Return number of elements in record, record of, template, set, set of Presence / Choice functions Determine if an optional field in a record, template, etc. is present bit2int hex2int oct2int str2int int2bit int2hex int2oct int2str lengthof sizeof

ispresent

Convert Convert Convert Convert Convert Convert Convert Convert

bitstring value to integer value hexstring value to integer value octetstring value to integer value charstring value to integer value integer value to bitstring value integer value to hexstring value integer value to octetstring value integer value to charstring value

bit2int hex2int oct2int str2int int2bit int2hex int2oct int2str lengthof sizeof

All parallel test components (PTCs) must be created explicitly using the create operation The create operation returns the unique component reference for the newly created component Components can be created at any point in a behaviour description

Length functions

Return the length of a value of any string type Return number of elements in record, record of, template, set, set of
Presence / Choice functions

Determine if an optional field in a record, template, etc. is present Determine which choice has been made in a union type

ispresent ischosen

Configuration Operations Operation Keyword


Create a new parallel test component Connect two components Connect component to test system interface Get master test component address Get test system interface address Get own address Start execution of test component Stop execution of test component Check termination of test component
create map mtc system self start stop done connect

Creating Components

The master test component (MTC) is the only component that is automatically created when the test case is executed

Asynchronous Communication Operations Operation Send a message Receive a message Trigger on a given message Check in queue of port for message Clear port Clear and give access to port Stop access to port Synchronous Communication Operations Operation Invoke (remote) procedure call Reply to (remote) procedure call
Raise an exception Accept (remote) procedure call Handle response from previous call Catch exception (from called entity)

Keyword send receive trigger check clear start stop Keyword call reply
raise getcall getreply catch

Check reply or exception Clear port Clear and give access to port Stop access to port

check clear start stop

Named Alternatives

Named alternatives (named alt) are descriptions of partial alternatives defined in the module definitions are named and may be parameterised Named alternatives are macro-expansions they are not functions Can be referenced from anywhere that it is legal to write a normal alt statement The expand statement allows a named alt to be explicitly expanded inside another set of alternatives

Additional Operations
Statement Timer operations Start timer Stop timer Read elapsed time Check timeout event Check timer status Verdict operations Set local verdict Get local verdict SUT operations Cause SUT action

Keyword or symbol

Module control part

start stop read timeout running verdict.set verdict.get sut.action

Yes Yes Yes Yes Yes

Verdicts
Verdicts: pass, fail, inconc, none, error Each test component has its own local verdict can be written (set) and read (get) Global verdict returned by Test Case (read -only)

Das könnte Ihnen auch gefallen