Research Article

Formal Specification Based Automatic Test Generation for Embedded Network Systems

Pseudocode 1

An example SENS specification.
<main.cls>
( ) Import  A,  B;
( ) Class  main
( ) Data
( )onoff_status  {on,off};
( ) Var
( )B1,  B2 : B;
( )A1 : A(B1,  B2);
<A.cls>
( ) Import B;
( ) Extern
( ) Data
( )onoff_status;  //from  main
( ) Class  A(arg1:B,  arg2:B)
( ) Var
( )op:onoff_status {off};
( ) Timer
( )t 2min;
( )
( ) Function SendingM
( ) Require
( )~op==off && op==on:null: t!start;
( ) op==on:t?ring:arg1.ch!m,arg2.ch!m;
<B.cls>
( ) Extern
( ) Data
( )onoff_status; //from main
( ) Class B
( ) Data
( )m_type {m};
( ) Var
( )   op:onoff_status {off};
( )   lamp:onoff_status {off};
( )  Channel
( )ch:m_type;
( )
( )  Function Lighting
( )  Require
( )op==on && lamp==off:ch?m:lamp==on;
( )op==off > lamp==off;