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

Get An Introduction to TTCN-3, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.