Research Article

Synthesis of Test Scenarios Using UML Sequence Diagrams

Procedure 1

Function Create Scenario Graph.
Input:  𝐷 : Sequence diagram in XMI form     // 𝐷 is the main fragment
Output: G: scenario graph in the form ⟨ 𝐴 , 𝐸 , 𝑖 𝑛 , 𝐹 ⟩
1: Create initial node 𝑖 𝑛 ;
2: π‘₯ = 𝑃 π‘Ÿ π‘œ 𝑐 𝑒 𝑠 𝑠 𝐹 π‘Ÿ π‘Ž 𝑔 π‘š 𝑒 𝑛 𝑑 ( 𝐷 , 𝑖 𝑛 )     // Process the main
  fragment with 𝑓 π‘Ÿ π‘Ž 𝑔 π‘š 𝑒 𝑛 𝑑 𝐼 𝑑 = 𝐷
3: if   π‘₯ β‰  𝑓 𝑖 𝑛 π‘Ž 𝑙 𝑛 π‘œ 𝑑 𝑒 then
4:   Create final node 𝑓 𝑛 ∈ 𝐹 ;
5:   Connect edge from π‘₯ 𝑑 π‘œ 𝑓 𝑛 ;
6:  end if
7:  return   𝐺 with entry node 𝑖 𝑛 ∈ 𝐴 and exit node 𝑓 𝑛 ∈ 𝐹 ;
8: stop
Algorithmβ€”The scenario graph generation algorithm