Input: 𝐼 𝑇 𝑀 , an intermediate testable model of a given scenario
  graph with initial node, 𝑖 𝑛 .
Output: 𝑇 , a collection of test scenarios forming the test suite.
Data: 𝐵 , a set of base paths which is initially empty
𝑃 𝑗 : a set of internal paths corresponding to a composite node,
𝐶 𝑗 .
1:Generate base path, 𝑡 𝑏 from ITM
2: 𝐵 = 𝐵 𝑡 𝑏      // Add 𝑡 𝑏 to the set of base paths
3:while 𝐵 𝑒 𝑚 𝑝 𝑡 𝑦 do
4: for path 𝑡 𝑖 𝐵 do
5:   Let 𝑡 𝑖 = 𝑛 0 , 𝑛 𝑖 1 , 𝑛 𝑖 2 , , 𝑛 𝑖 𝑝 , 𝑛 𝑖 𝑞 be a sequence
     of adjacent nodes in 𝑡 𝑖
6:   for all 𝑛 𝑖 𝑗 𝑡 𝑖 do
7:    if 𝑛 𝑖 𝑗 is not a composite node then
8:      𝑇 = 𝑇 𝑡 𝑖    // 𝑡 𝑖 is fully expanded and it
       is added to the test suite 𝑇
9:     Remove 𝑡 𝑖 from 𝐵
10:    else
11:    for composite node 𝑛 𝑖 𝑗 𝑡 𝑖 do
12:    Get internal paths corresponding to the node 𝑛 𝑖 𝑗
13:    Let 𝑃 𝑗 = { 𝑝 1 , , 𝑝 𝑚 } denote 𝑚 internal paths
       corresponding to the composite node 𝑛 𝑖 𝑗
14:    for 𝑝 𝑖 𝑃 𝑗 do
15:       Replace the node 𝑛 𝑖 𝑗 in 𝑡 𝑖 with the internal path
          𝑝 𝑖 and let the expanded form of 𝑡 𝑖 be 𝑡 𝑖
16:        𝐵 = 𝐵 𝑡 𝑖     // Add 𝑡 𝑖 to 𝐵
17:    end for
18:    end for
19:   end if
20:  end for
21: end for
22:end while
Algorithm—Test scenario generation from ITM
Procedure 5: Function GenerateTestScenario.