Research Article

Synthesis of Test Scenarios Using UML Sequence Diagrams

Procedure 4

Function ComposeRegion.
Input:   𝐺 π‘˜ : The input graph
   𝑐 𝑒 π‘Ÿ 𝑁 π‘œ 𝑑 𝑒 : The current node to be inspected
Output:   𝑒 π‘₯ 𝑖 𝑑 𝑁 π‘œ 𝑑 𝑒 : The trailer node
1:  π‘₯ = 𝐹 𝑖 𝑛 𝑑 𝑀 𝑖 𝑛 𝑖 π‘š π‘Ž 𝑙 𝑅 𝑒 𝑔 𝑖 π‘œ 𝑛 ( 𝑐 𝑒 π‘Ÿ 𝑁 π‘œ 𝑑 𝑒 )     // Takes
  care of nested regions
2:  if π‘₯ = 𝑁 π‘ˆ 𝐿 𝐿   then
3:   𝑒 π‘₯ 𝑖 𝑑 𝑁 π‘œ 𝑑 𝑒 = 𝑅 𝑒 𝑑 𝑒 𝑐 𝑒 𝑅 𝑒 𝑔 𝑖 π‘œ 𝑛 ( 𝑐 𝑒 π‘Ÿ 𝑁 π‘œ 𝑑 𝑒 )     // Do
    the composition following composition rules
4:   π‘ˆ 𝑝 𝑑 π‘Ž 𝑑 𝑒 ( 𝐺 π‘˜ )     // Update 𝐺 π‘˜ with CCG at 𝑐 𝑒 π‘Ÿ 𝑁 π‘œ 𝑑 𝑒
5:  else // Indicates a nested region is found
6:   𝑒 π‘₯ 𝑖 𝑑 𝑁 π‘œ 𝑑 𝑒 = 𝑅 𝑒 𝑑 𝑒 𝑐 𝑒 𝑅 𝑒 𝑔 𝑖 π‘œ 𝑛 ( π‘₯ )     // π‘₯ is the entry node
7:   π‘ˆ 𝑝 𝑑 π‘Ž 𝑑 𝑒 ( 𝐺 π‘˜ )
8:   𝑒 π‘₯ 𝑖 𝑑 𝑁 π‘œ 𝑑 𝑒    =    𝐢 π‘œ π‘š 𝑝 π‘œ 𝑠 𝑒 𝑅 𝑒 𝑔 𝑖 π‘œ 𝑛 ( 𝐺 π‘˜ , 𝑐 𝑒 π‘Ÿ 𝑁 π‘œ 𝑑 𝑒 )
        // recursively repeat the composition
9:  end if
10:  return  𝑒 π‘₯ 𝑖 𝑑 𝑁 π‘œ 𝑑 𝑒
Function ComposeRegion(G, RegionFound)