180 likes | 273 Views
Michael Schmitt · University of Trier · Germany. Michael Ebner · University of Göttingen · Germany. The TTCN-3 module and template concepts revisited. TestCom 2003. Outline. Revised module concept Parallel operator Enhanced matching mechanisms for records, arrays, and sets.
E N D
Michael Schmitt· University of Trier · Germany Michael Ebner· University of Göttingen · Germany The TTCN-3 module and template concepts revisited TestCom 2003
Outline • Revised module concept • Parallel operator • Enhanced matching mechanismsfor records, arrays, and sets
Combine groups and modulesand introduce a control function Why a revised module concept? • Coping with large amounts of test cases • cascading can only be realised by auxiliary functions called in the module control part • Limitations of groups • groups have no own scope • no semantic purpose (except for import) • No signature defined
Module Concept Comparison Current Style module CGIabuses{ control { IIS.control_IIS(); } group IIS { functioncontrol_IIS() { ExAir.control_ExAir(); } groupExAir { functioncontrol_ExAir() { … } Proposed Style module CGIabuses { functioncontrol() returnverdicttype{ IIS(); } moduleIIS { functioncontrol() returnverdicttype{ ExAir();} moduleExAir { functioncontrol() { … }
Why a Parallel Operator? • Sequential test case execution is too time-consuming in case of a large number of test cases • Test cases may depend on each other
Parallel Operator Example module SecurityTests( integer maxNoOfTestCases, boolean denialOfService ) { function control() { var verdicttype v := pass; par ( maxNoOfTestCases ) { info [ true ] { v.set( execute( findServices() ) ); } mssql [ v == passandinfo == trueand port[1433] == open ] { v.set( execute( MSSQLPasswords() ) ); } smurf[10] [ v == pass and info == true and denialOfService == true ] { v.set( execute( smurfAttack() ) ); } else { ... } } } } module SecurityTests( integer maxNoOfTestCases, boolean denialOfService ) { function control() { var verdicttype v := pass; par ( maxNoOfTestCases ) { info [ true ] { v.set( execute( findServices() ) ); } mssql [ v == pass and info == true and port[1433] == open ] { v.set( execute( MSSQLPasswords() ) ); } smurf[10] [ v == pass and info == true and denialOfService == true ] { v.set( execute( smurfAttack() ) ); } else { ... } } } } module SecurityTests( integer maxNoOfTestCases, boolean denialOfService ) { function control() { var verdicttype v := pass; par ( maxNoOfTestCases ) { info [ true ] { v.set( execute( findServices() ) ); } mssql [ v == pass and info == true and port[1433] == open ] { v.set( execute( MSSQLPasswords() ) ); } smurf[10] [ v == pass and info == true and denialOfService == true ] { v.set( execute( smurfAttack() ) ); } else { ... } } } } module SecurityTests( integer maxNoOfTestCases, boolean denialOfService ) { functioncontrol() { varverdicttype v := pass; par ( maxNoOfTestCases ) { info [ true ] { v.set( execute( findServices() ) ); } mssql [ v == passandinfo == trueand port[1433] == open ] { v.set( execute( MSSQLPasswords() ) ); } smurf[10] [ v == passandinfo == trueand denialOfService == true ] { v.set( execute( smurfAttack() ) ); } else { ... } } } } module SecurityTests( integer maxNoOfTestCases, booleandenialOfService ) { function control() { var verdicttype v := pass; par ( maxNoOfTestCases ) { info [ true ] { v.set( execute( findServices() ) ); } mssql [ v == pass and info == true and port[1433] == open ] { v.set( execute( MSSQLPasswords() ) ); } smurf[10] [ v == passandinfo == trueand denialOfService == true ] { v.set( execute( smurfAttack() ) ); } else { ... } } } } Degree of concurrency Goal Prerequisite Command Repetitions Goal variable Termination
Enhanced Matching Mechanisms • Powerful mechanisms can be used to describe templates for character strings • Same expressiveness as regular expressions • Less powerful mechanisms are available for structured types • * matches a sequence of zero or more elements • Goal • Provide the power of regular expressions on the level of arrays, records of, and sets of • Find a suitable, non-ambiguous notation
Enhanced Matching Mechanisms Example varinteger myInt := 8; templaterecord of integer RegExp1 := { <1,2>#(2,5), 3#(,), 4, (5,6,7), myInt, ?}; Alternatives At least 2 and at most 5 occurrences of 1,2 Group
Design Issues of Parallel Operator • alt-like structure • Degree of concurrency can be restricted • Execution of many identical test cases • Scheduling • non-blocked scheduler • blocked scheduler • Termination • else goal
Module Concept Comparison (1) Current Style module CGIabuses{ control { . . . } } Proposed Style module CGIabuses{ functioncontrol( in integer number ) returnverdicttype { . . . } }
Module Example (1) • module CGIabuses { • importfrom DenialOfService all; • functioncontrol() { • IIS(); PHP-Nuke(); • execute( IIS.ExAir.ExAirSearch() ); • } • module IIS { • functioncontrol() { • varverdicttype v; • DenialofService.IIS(); • if( execute( DangerousSampleFiles ) == pass) • v := ExAir(); • } • module ExAir { • functioncontrol() returnverdicttype { • } } } }
Module Example (2) • module DenialofService { • module IIS { • functioncontrol() { • } • } • }
Enhanced Matching Mechanisms • Enhanced matching mechanisms for structured types (arrays, sets, records) • x#(min,max) • matches at least min and at most max occurrences of x • < … > • Grouping of sequential elements • Description of alternatives • use existing notation for value lists
Why Enhanced Matching Mechanism? • Powerful character patterns are provided for templates • For structured types less powerful matching mechanism are provided
Summary & Outlook • Better module concept • A new parallel operator • New matching mechanisms for records, arrays, and sets
Advantages of a Control Function • Hierarchically structured control parts • Call from detached modules • Improved Characteristics • Parameterisation • Return value
Michael Ebner, University of Göttingen The TTCN-3 module and template concepts revisited Michael Schmitt, University of Trier TestCom 2003