Research Article

Synthesis of Test Scenarios Using UML Sequence Diagrams

Procedure 3

Function FormIntermediateGraph.
Input:   𝐺 : The scenario graph in the form ⟨ 𝐴 , 𝐸 , 𝑖 𝑛 , 𝐹 ⟩
  RegionFound: a flag for deciding the termination criteria
Output:   𝐺 π‘˜ : ITM
Data:   𝑐 𝑒 π‘Ÿ 𝑁 π‘œ 𝑑 𝑒 : Denotes the next node to be inspected
    𝑒 π‘₯ 𝑖 𝑑 𝑁 π‘œ 𝑑 𝑒 : Denotes the trailer node when the region is formed
1 ∢   𝐺 π‘˜ = 𝐺     // Initially, 𝐺 is the ITM
2 ∢   𝑐 𝑒 π‘Ÿ 𝑁 π‘œ 𝑑 𝑒 = 𝑖 𝑛    // Start from the initial node of 𝐺 π‘˜
3 ∢   while 𝑐 𝑒 π‘Ÿ 𝑁 π‘œ 𝑑 𝑒 is not a 𝑓 𝑖 𝑛 π‘Ž 𝑙 𝑁 π‘œ 𝑑 𝑒   do
4 ∢    if   𝐹 𝑖 𝑛 𝑑 𝐢 π‘œ 𝑛 𝑑 π‘Ÿ π‘œ 𝑙 𝑁 π‘œ 𝑑 𝑒 ( 𝑐 𝑒 π‘Ÿ 𝑁 π‘œ 𝑑 𝑒 )   then // 𝑐 𝑒 π‘Ÿ 𝑁 π‘œ 𝑑 𝑒 is not a
    control node
5 ∢      𝑒 π‘₯ 𝑖 𝑑 𝑁 π‘œ 𝑑 𝑒    =    𝐢 π‘œ π‘š 𝑝 π‘œ 𝑠 𝑒 𝑅 𝑒 𝑔 𝑖 π‘œ 𝑛 ( 𝐺 π‘˜ , 𝑐 𝑒 π‘Ÿ 𝑁 π‘œ 𝑑 𝑒 )
          // Composing to be carried out at 𝑐 𝑒 π‘Ÿ 𝑁 π‘œ 𝑑 𝑒
6 ∢    else
7 ∢      if 𝑒 π‘₯ 𝑖 𝑑 𝑁 π‘œ 𝑑 𝑒 = 𝑁 π‘ˆ 𝐿 𝐿 then // Ensures that no composition was carried out so far
8 ∢       𝑅 𝑒 𝑔 𝑖 π‘œ 𝑛 𝐹 π‘œ 𝑒 𝑛 𝑑 = 𝐹 𝐴 𝐿 𝑆 𝐸 ;
9 ∢      end if;
1 0 ∢    break;
1 1 ∢    end if
1 2 ∢    𝑐 𝑒 π‘Ÿ 𝑁 π‘œ 𝑑 𝑒 = 𝑒 π‘₯ 𝑖 𝑑 𝑁 π‘œ 𝑑 𝑒 ;
1 3 ∢   end while
1 4 ∢   return   𝐺 π‘˜
Function FormIntermediateGraph(G, RegionFound)