Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Use of TTCN-3 for Software Testing Ina Schieferdecker FOKUS, Berlin

Similar presentations


Presentation on theme: "The Use of TTCN-3 for Software Testing Ina Schieferdecker FOKUS, Berlin"— Presentation transcript:

1 The Use of TTCN-3 for Software Testing Ina Schieferdecker FOKUS, Berlin schieferdecker@fokus.fhg.de

2 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Content Overview on TTCN-3 TTCN-3 applied to software TTCN-3 and XML Test Execution

3 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Content  Overview on TTCN-3 TTCN-3 applied to software TTCN-3 and XML Test Execution

4 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Introduction TTCN-3 is the Testing and Test Control Notation The new standardised test specification and test implementation language Developed from 1999 – 2002 at the European Telecommunications Standards Institute (ETSI). Developed based on experiences from previous TTCN editions Removal of OSI specific concepts; Improvement of concepts; Introduction of new concepts. Applicable for all kinds of black-box testing for reactive and distributed systems, e.g., Telecom systems (ISDN, ATM, GSM, UMTS); Internet (IP, IP based protocols and applications); Software systems (Java, XML); Middleware platforms and component-based systems (CORBA,.Net, EJB).

5 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Overview on TTCN-3 Presentation Format n Graphical Format Tabular Format TTCN-3 Core Language Other Types & Values n Other Types & Values 2 ASN.1 Types & Values : testcase myTestcase () runs on MTCType system TSIType {mydefault := activate (OtherwiseFail); verdict.set(pass); : connect(PTC_ISAP1:CP_ISAP1,mtc:CP_ISAP1); : map(PTC_ISAP1:ISAP1, system:TSI_ISAP1); : PTC_ISAP1.start(func_PTC_ISAP1()); PTC_MSAP2.start(func_PTC_MSAP2()); Synchronization(); all component.done; log(”Correct Termination”); } : mscmi_synch1_conc1 mtcISAP1MSAP2

6 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 TTCN-3 Test Case TTCN-3 – Based Black-Box Testing Port.send(Stimulus) Port.receive(Response) System Under Test Port Assignment of a Test Verdict

7 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 TTCN-3 Test Case TC TCs TC create TC TCs MTC create TC SUT TCs TC start TC Component-Based Test System

8 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Main Elements of TTCN-3 Module covers declarations and control Templates (test data description) and matching mechanisms (pattern matching) Test configurations Formally defined interfaces to the SUT Dynamic creation of test component Concurrency to describe distributed test setups Test cases Small (complete) separate compilable programs Share (type and data) information Test verdicts

9 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Content Overview on TTCN-3  TTCN-3 applied to software TTCN-3 and XML Test Execution

10 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 TTCN-3 and Software Testing Message-Based Software Such as Protocols, Messaging Services, Web site and Portals,... Example technology is XML Signature-Based Software Such as Client-Server, Peer-to-Peer, Component-based Systems,.... Example technology is IDL  Reuse of XML/IDL/... data within TTCN-3  Define a mapping from XML/IDL/... to TTCN-3

11 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Presentation Format n Graphical Format Tabular Format Other Types & Values 2 IDL ASN.1 Types & Values Other Types & Values n TTCN-3 Core Language Presentation Format n TTCN-3 and Software Testing C, C++, JAVA XML

12 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Content Overview on TTCN-3 TTCN-3 applied to software  TTCN-3 and XML Test Execution

13 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 XML in Distributed Applications Increasing number of distributed applications use XML for Description of messages in datacom protocols Exchange format between software components Data description in Web-applications etc. XML is a structured method for putting data into a textual presentation by marking up data can have attributes that describe additional information describes both attributes and content is intuitive and self describing

14 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Mapping XML to TTCN-3 Idea: Map element tags and attributes to TTCN-3 fields Different grammar definitions and mappings Schemas Embedded approach Flat-Catalog approach Named Type approach DTDs

15 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Example – The Dinosaur Database XML Paleontologist feeding the database Student requesting dataExampleExample

16 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 The Request Interface XML URL http://www.testingtech.de/TTCN-3_Example/dinolist.xml XML File

17 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Web Service Generation of test data structure Test System Test Component Test Component Test Component Test Component Compilation to Executable Tests XML ADAPTORADAPTOR Adaptor acc. to the mapping rules Generation of test behavior Generation of test data Principal Approach

18 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Structured Type DefintionsExampleExample XML DTD type set of dinosaur dinolist; type record dinosaur { charstringname, charstringlen, charstringmass, charstringtime, charstringplace } Set of Type Definition Field Definition Record Type Definition

19 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Test Data Definitions template dinolist DinoList := {?, ?, Brachiosaurus, ?, ?, ?, ?}; template dinosaur Brachiosaurus := { name:= "Brachiosaurus", len:= ?, mass:= ?, time:= ?, place:= ? }ExampleExample Any Value

20 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Test Port /** communication port type definition */ type port httpTestPortType message { outurl; indinolist; } Port DefinitionExampleExample

21 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Test Components /** component type definitions */ type component httpTestComponent { port httpTestPortTypehttpPort; timer localTimer := 3.0; } type component httpTestSystemComponent { port httpTestPortTypehttpTestSystemPort; } Component DefinitionExampleExample Local Port Local Timer

22 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Test Behavior httpPort.send(requestURL); localTimer.start; alt { [] httpPort.receive(DinoList) { localTimer.stop; setverdict(pass); } [] httpPort.receive { localTimer.stop; setverdict(fail); } [] localTimer.timeout { setverdict(fail); } Alternative reactionsExampleExample Sending a message Starting the timer The expected response An unexpected response A timeout

23 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 altstep DinoList_Default_1() runs on httpTestComponent { [] httpPort.receive { localTimer.stop; setverdict(fail); } [] localTimer.timeout { setverdict(fail); } Handling of unexpected response Simplification: Altstep Test Component Type Handling of timeoutsExampleExample

24 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3... activate(DinoList_Default_1()); httpPort.send(requestURL); localTimer.start; httpPort.receive(DinoList); localTimer.stop; setverdict(pass); … The expected response is given here only, All other cases are handled by the default Simplification: Use of the Altstep Default activationExampleExample

25 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 testcase DinoList_Test_1() runs on httpTestComponent system httpTestSystemComponent { map(mtc:httpPort, system:httpTestSystemPort); activate(DinoList_Default_1()); httpPort.send(requestURL); localTimer.start; httpPort.receive(DinoList); localTimer.stop; setverdict(pass); } A Test Case MTC TypeExampleExample Test Case Definition TSI Type Mapping the Ports

26 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Module module dinolistTest { type record url {...} type set of dinosaur dinolist; type record dinosaur {...} template url requestURL := {...} template dinolist DinoList := {...} template dinosaur Brachiosaurus := {...} type port httpTestPortType message {...} type component httpTestComponent {...} type component httpTestSystemComponent {...} altstep DinoList_Default_1() runs on httpTestComponent {...} testcase DinoList_Test_1() runs on httpTestComponent system httpTestSystemComponent {... } control {... } } Module NameExampleExample The Complete Module

27 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Graphical Format testcase DinoList_Test_1 runs on httpTestComponent system httpTestSystemComponent httpTest Component mtc requestURLDinoList httpPort activate (DinoList_Default_1) pass LocalTimer map(mtc:httpPort, system:httpTestSystemPort)

28 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Content Overview on TTCN-3 TTCN-3 applied to software TTCN-3 and XML  Test Execution

29 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 SUT Real Test System Interface Test Execution Test System Abstract Test System Interface TC2 TC1 IN OUT OUT IN Connected Ports INOUT Mapped Ports INOUT Real Test System Interface

30 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 TTCN-3 Execution Test System Test System User TE TM: Management System Under Test (SUT) CD: CoDec CH: Component Handling SA: CommunicationPA: Timer Generic XML adaptor that adheres to the mapping

31 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 TTCN-3 Runtime Interface Adaptation to the SUT Test System User TE TM: Management System Under Test (SUT) CD: CoDec CH: Component Handling SA: Communication PA: Timer TRI

32 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 TTCN-3 Control Interfaces Adaptation to the test platform/test device Test System User TE TM: Management System Under Test (SUT) CD: CoDec CH: Component Handling SA: CommunicationPA: Timer TCI

33 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 Summary of TTCN-3 New version of the only standardized test notation Modernization: Programming-like test specification with flexible data support and various representation formats Wider scope of application applicable to many kinds of test applications not just conformance (development, system, integration, interoperability, scalability …) applicable in the datacom domain Harmonization first choice for test specifiers, implementors and users both for standardized test suites and as a generic solution in industrial software development Was successfully shown to be applicable to testing of IDL and XML interfaces, Java and C++ classes, … Tools are available

34 Thank You. Questions?

35 ITU-T Workshop, Geneva, Nov. 2002 I. Schieferdecker: TTCN-3 The TTCN-3 Set of Standards ETSI ES 201 873-1 TTCN-3 Core Notation ETSI ES 201 873-2 TTCN-3 Tabular Presentation Format ETSI ES 201 873-3 TTCN-3 Graphical Presentation Format ETSI ES 201 873-4 TTCN-3 TTCN-3 Semantics ETSI ES 201 873-5 The TTCN-3 Runtime Interface ETSI ES 201 873-6 The TTCN-3 Control Interfaces


Download ppt "The Use of TTCN-3 for Software Testing Ina Schieferdecker FOKUS, Berlin"

Similar presentations


Ads by Google