O'Reilly logo

An Introduction to TTCN-3, 2nd Edition by Stephan Schulz, Federico Engler, Stefan Keil, Stephan Tobies, Thomas Deiß, Colin Willcock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11

Advanced Templates

In practice, information content, that is communicated between the test components and the system under test (SUT) is rarely so simple that it can be expressed using simple unstructured types. The more common case is that such content is specified by deeply nested type structures, which require the specification of quite complex templates. In these cases, templates tend to grow large and the use of one template definition per message quickly becomes hard to read and maintain.

To manage complex values in a better way, TTCN-3 offers the possibility to parameterise template definitions and to decompose templates using template references. Furthermore, it is possible to define templates via the selective modification of existing templates. This provides yet another powerful way for a more concise definition of message families. Finally, templates can even be computed at runtime by template computing functions. Template restrictions increase the possibilities to analyse templates, especially whether templates in send statements correspond to single values only. After introducing these mechanisms in this chapter, we will provide some guidance on how to use them to structure templates for complex messages and discuss the issue of implicit template definitions.

11.1 Template Definitions for Complex Type Structures

So far in this book, we have mainly focused on template definitions for fairly simple type structures, with at most a handful of fields. In practice, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required