1 / 33

The Use of TTCN-3 for Software Testing

The Use of TTCN-3 for Software Testing. Ina Schieferdecker FOKUS, Berlin schieferdecker@fokus.fhg.de. Content. Overview on TTCN-3 TTCN-3 applied to software TTCN-3 and XML Test Execution. Content. Overview on TTCN-3 TTCN-3 applied to software TTCN-3 and XML Test Execution.

clare
Download Presentation

The Use of TTCN-3 for Software Testing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. Content • Overview on TTCN-3 • TTCN-3 applied to software • TTCN-3 and XML • Test Execution

  3. Content • Overview on TTCN-3 • TTCN-3 applied to software • TTCN-3 and XML • Test Execution

  4. 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. msc mi_synch1_conc1 mtc ISAP1 MSAP2 Other Types & Values 2 Overview on TTCN-3 TTCN-3 Core Language ASN.1 Types & Values Tabular Format : testcase myTestcase () runson 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(); allcomponent.done; log(”Correct Termination”); } : Graphical Format Presentation Format n Other Types & Values n

  6. TTCN-3 Test Case Port.send(Stimulus) Port.receive(Response) Port System Under Test TTCN-3 – Based Black-Box Testing • Assignmentof aTest Verdict

  7. SUT create start TC TC TC MTC TCs TCs TCs TC TC TC create start create start Component-Based Test System TTCN-3 Test Case

  8. 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. Content • Overview on TTCN-3 • TTCN-3 applied to software • TTCN-3 and XML • Test Execution

  10. 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 TTCN-3 and Software Testing • Reuse of XML/IDL/... data within TTCN-3 • Define a mapping from XML/IDL/... to TTCN-3

  11. IDL C, C++, JAVA XML Other Types & Values 2 Presentation Format n TTCN-3 and Software Testing TTCN-3 Core Language ASN.1 Types & Values Tabular Format Graphical Format Presentation Format n Other Types & Values n

  12. Content • Overview on TTCN-3 • TTCN-3 applied to software • TTCN-3 and XML • Test Execution

  13. 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. 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. Example Paleontologist feeding the database Student requesting data XML Example – The Dinosaur Database

  16. XML File XML The Request Interface URL http://www.testingtech.de/TTCN-3_Example/dinolist.xml

  17. Generation of test data XML Generation of test data structure Generation of test behavior Adaptor acc. to the mapping rules Compilation to Executable Tests A D A P T O R Test Component Test Component Test Component Test Component Web Service Test System Principal Approach

  18. Example Structured Type Defintions <!ELEMENT dinolist (dinosaur*)> <!ELEMENT dinosaur (name, len, mass, time, place)> <!ELEMENT name (#PCDATA)> <!ELEMENT len (#PCDATA)> <!ELEMENT mass (#PCDATA)> <!ELEMENT time (#PCDATA)> <!ELEMENT place (#PCDATA)> typeset of dinosaur dinolist; typerecord dinosaur { charstring name, charstring len, charstring mass, charstring time, charstring place } XML DTD Set of Type Definition Record Type Definition Field Definition

  19. Example Test Data Definitions templatedinolistDinoList:= {?, ?, Brachiosaurus, ?, ?, ?, ?}; templatedinosaurBrachiosaurus:= { name := "Brachiosaurus", len := ?, mass := ?, time := ?, place := ? } Any Value

  20. Example Test Port /** communication port type definition */ type porthttpTestPortType message { out url; in dinolist; } Port Definition

  21. Example Test Components /** component type definitions */ type component httpTestComponent{ port httpTestPortTypehttpPort; timer localTimer := 3.0; } type component httpTestSystemComponent{ port httpTestPortTypehttpTestSystemPort; } Component Definition Local Port Local Timer

  22. Example Test Behavior Sending a message Starting the timer httpPort.send(requestURL); localTimer.start; alt { [] httpPort.receive(DinoList) { localTimer.stop; setverdict(pass); } [] httpPort.receive { localTimer.stop; setverdict(fail); } [] localTimer.timeout { setverdict(fail); } } Alternative reactions The expected response An unexpected response A timeout

  23. Example Simplification: Altstep altstepDinoList_Default_1() runson httpTestComponent { [] httpPort.receive { localTimer.stop; setverdict(fail); } [] localTimer.timeout { setverdict(fail); } } Test Component Type Handling of unexpected response Handling of timeouts

  24. Example Simplification: Use of the Altstep ... activate(DinoList_Default_1()); httpPort.send(requestURL); localTimer.start; httpPort.receive(DinoList); localTimer.stop; setverdict(pass); … Default activation The expected response is given here only, All other cases are handled by the default

  25. Example A Test Case Test Case Definition testcaseDinoList_Test_1() runson httpTestComponent system httpTestSystemComponent { map(mtc:httpPort, system:httpTestSystemPort); activate(DinoList_Default_1()); httpPort.send(requestURL); localTimer.start; httpPort.receive(DinoList); localTimer.stop; setverdict(pass); } MTC Type TSI Type Mapping the Ports

  26. testcaseDinoList_Test_1 runs on httpTestComponent system httpTestSystemComponent mtc httpPort httpTestComponent activate(DinoList_Default_1) LocalTimer requestURL DinoList pass Graphical Format map(mtc:httpPort,system:httpTestSystemPort)

  27. Content • Overview on TTCN-3 • TTCN-3 applied to software • TTCN-3 and XML • Test Execution

  28. Test System Connected Ports INOUT TC2 OUT IN OUT IN Mapped Ports OUT IN Real Test System Interface Real Test System Interface SUT TC1 Test Execution Abstract Test System Interface

  29. TTCN-3 Execution • Generic XML adaptor that adheres to the mapping Test System User Test System TM: Management TE CD: CoDec CH: ComponentHandling SA: Communication PA: Timer System Under Test (SUT)

  30. Test System User TM: Management TE CD: CoDec CH: ComponentHandling TRI SA: Communication PA: Timer System Under Test (SUT) TTCN-3 Runtime Interface • Adaptation to the SUT

  31. Test System User TM: Management TCI TE CD: CoDec CH: ComponentHandling SA: Communication PA: Timer System Under Test (SUT) TTCN-3 Control Interfaces • Adaptation to the test platform/test device

  32. 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

  33. Thank You.Questions?

More Related