Testing and Test Control Notation

TTCN is a standard and formal notation that was originally invented to specify telecommunications Protocols test cases. Since then it has been used in many different fields of application other than telecommunications.

The new TTCN standard: TTCN-3

TTCN-3 is the latest version for TTCN, an ITU standard.

TTCN-3 has been defined by ETSI with strong Industry contributions.

It uses all the basic concepts of the original TTCN language defined in the '80s but added an array of enhancements and even brand new concepts.

While the previous versions of TTCN were exclusively GUI tools oriented, the new TTCN-3 version includes a core notation that is fully text based exactly like any other general purpose language (GPL). The previous table and tree graphic interfaces are still supported by TTCN-3 and are defined in the standard. A new graphic version consists in using Message Sequence Charts like diagrams. For some obscure reasons, most of today's users prefer to use the core text notation.

However, TTCN-3 is not to be confused with a GPL. Its central concepts of templates and behavior trees and related matching mechanism is unique to TTCN-3. Also, the concept of parallel test components with its concise syntax and clear semantics makes the use of multi-threading for complex test architectures purposes extremely easy to use. These concepts lead to considerable reductions in test development and debugging time. Moreover, TTCN-3 provides the tester with a model, the separation of concerns between an abstract and a concrete layer. The abstract layer is where the tester would specify the abstract test suite, free of any implementation details while the concrete layer is where the link between the abstract layer and the real world is performed. The concrete layer is where tradition GPL are used.

The TTCN-3 model has a very clear benefit: test specifications can be understood by people other than the ones who developed them and thus can be exchanged among the user community. This in turn increases the confidence in a product by potential customers because they can have access to the test suites that were used to test the product that they purchased or about to purchase and actually understand them. This property also lead many industries to require that test systems be written in TTCN-3 to speed up the purchasing approval process.

TTCN-3 is also not to be confused with a framework. TTCN-3 is a strongly typed language with precise syntax and test semantics. Strong typing enables to detect specification errors at compile time rather than at run time, thus potentially reducing considerably time to market and freeing resources for more in-depth testing.

More important is the fact that there are now open source tools for compiling TTCN-3 test specification, thus eliminating the absolute use of vendor tools that prevailed for the old version. TRex by University of Goettingen is such a tool. Any new user can use it to explore this language.

TTCN-3 tutorials

TTCN-3 Examples

1. The simpliest TTCN-3 example you can think of.

This is a simple request/response example of someone playing ping pong. You send a ping and you expect a pong back. Alternative responses are a net or totally unexpected responses. click here to download PingPong.html

2. The SOAP XML based service TTCN-3 example consist in an abstract test suite that enables to test the responses of a weather forecast service to requests of weather conditions for various cities. It illustrates the TTCN-3 features of typing, data templates definitions, data template parametrization, the use of timers, the mismatch of responses, the re-use of data template definitions.

A SOAP XML based service TTCN-3 test case
the SOAP XML based service TTCN-3 test case example execution trace
Testing Web content using TTCN-3
3. Simple Web testing example from the T3UC'06 tutorial

This example consist in testing a simple web page with content and links.

click here to download the web pages testing example. This is the example discussed in the T3UC Stockholm conference (see turorial slides in the tutorials section of this page).

4. A minimal SIP fully executable Abstract Test Suite without the need for a Test Adapter

TTCN-3 integration in Eclipse TPTP

TPTP stands for Eclipse Test & Performance Tools Platform Project. TPTP is a framework that is an extension of JUnit. It is basically test case management framework.
However, test case behavior must be specified by the user using traditional programming languages such as Java. The TTCN-3 integration into TPTP combines it's efficient graphical test case management features with the powerful expressiveness of the TTCN-3 language.
Slides from the EclipseCon'05 presentation

TTCN-3 Papers

B.Stepien, L. Peyton, Test Coordination and Dynamic Test Oracles for Testing Concurrent Systems in SOFTENG 2020 proceedings

B.Stepien, L. Peyton, Challenges of Cost Estimation for Software Testing in SOFTENG 2019 proceedings

B. Stepien, L. Peyton, M. Alhaj, Data-Driven Testing using TTCN-3, in SOFTENG 2018 proceedings

B. Stepien, L. Peyton, M. Alhaj, Model-based Visualization of Execution Traces and Testing Results, in IARA journals

B. Stepien, L. Peyton, M. Alhaj, Visualizing Execution Models and Testing Results in SOFTENG 2017 proceedings

N. Kesserwan, R. Dsouli, M. Bentahar, B. Stepien, P. Labreche, From Use Case Maps to Executable Test Procedures -A Scenario-based Approach, in Software and Systems Modeling Journal

M. Alhaj, K. Mallur, B. Stepien, L.Peyton, Towards a model-based approach for developing and QA of online business processes in ICICS 2017 proceedings

B. Stepien, L. Peyton, M. Alhaj, Visualizing Execution Models and Testing Results in SOFTENG 2017 proceedings

Testing Business Processes Using TTCN-3 in SDL Forum 2015 proceedings
Testing Policy-Based e-Health Monitoring Processes Using TTCN-3 in Mcetech 2015 proceedings
Challenges of Testing Periodic Messages in Avionics Systems Using TTCN-3 in proceedings ICTSS 2013
Innovation and evolution in integrated web application testing with TTCN-3 in International Journal on Software Tools for Technology Transfer
An Integrated TTCN-3 Test Framework Architecture for Interconnected Object-based Internet Applications in International Journal, Electronic Business, 2012
Using TTCN-3 as a Modeling Language for Web Penetration Testing, in ICIT'12 proceedings
A Systematic Approach to Web Application Penetration Testing Using TTCN-3, in MCeTech 2011 proceedings
Integration Testing of Web Applications and Databases Using TTCN-3
Model-Based Penetration Test Framework for Web Applications using TTCN-3
Framework Testing of Web Applications using TTCN-3- STTT - Springer Verlag
Integration Testing of Composite Applications , HICSS-41
Open Source Integration Testing in OOPSLA '07
An Efficient Formal Testing Approach for Web Service with TTCN-3
Formal Testing of Web Content using TTCN-3
A Life-cycle E-Commerce Testing with OO-TTCN-3
Automated testing of XML/SOAP based web services

Want to know more about TTCN-3? link to the official ETSI TTCN-3 Web Site

TTCN-2 tools

Here is some legacy tool that could be handy for those who still use the old version of TTCN.

TTCN-2 Dynamic behavior ASCII viewer

TTCN specification come in two forms, tools internal representation that is usually not human readable and MP format that is text based. However the text based representation is very complex with a large number (over a hundred) keywords and thus is in a way not more readable than internal binary versions.

There are many TTCN-2 test suites freely available from a number of international bodies that the user community can download. However, some of the users are not familiar with TTCN and mostly do not have TTCN tools at hand.

view_behav.exe is a handy tool when away from the office and you need to view a TTCN behavior part if you don't have a copy of Telelogic's itex installed on your laptop. You need to first transform your ttcn specification from itex format to the mp format using Telelogic's itex2mp command, then download the resulting mp file and view it with viewbehav.

An example of TTCN-2 MP format test suite

The result of view_behav after transformation of the MP format

(click here to download the TTCN viewbehav software