# A Method for Modeling and Testing Near-Real-Time System Scenarios
## 5 Sample Scenario
### Generating Tests for a Handover Scenario
\(k=1\)
6. for each pair \((s,v):v\in V^{\prime}\)

\(\{P_{k}=\text{pathCoverage}(G^{\prime},s,v);k=k+1\}\) end
```  
**Algorithm 1**Path coverages in DAG  
```
Input: \(G\), \(s\)--source vertex, \(t\)--target vertex Result: \(P\)--path coverage Algorithm: Ciurea and Ciupala [36]
1. establish a feasible flow
2. establish the minimum flow from a given feasible flow
```  
**Algorithm 2**pathCoverage  
For the sequence algorithm shown in Figure 9, the designated path coverage is shown in Table 2.  
The methods are usually based on a graph approach and determining minimum flows based on a modified network, on which the permissible flow (Ciurea and Ciupala [36]) is first determined. These methods have been known since the late 1970s and have been strongly developed since the 1990s ([PERSON] et al. [37] and [PERSON] et al. [38]). Modifications \begin{table}
\begin{tabular}{c c c c} \hline \hline
**ID** & **Transition** & **Input Samples** & **Output Time [s]** \\ \hline
1 & S0 \(\rightarrow\) S1 & setDLGConfig & \\
2 & S1 \(\rightarrow\) S2 & sendDLGConfig(rFreq) & \\
3 & S2 \(\rightarrow\) S3 & setChannel(rFreq) & \\
4 & S3 \(\rightarrow\) S4 & setChannel(rFreq,antennaID) & \\
5 & S4 \(\rightarrow\) S5 & getGCSpos(GCSid) & \\
6 & S5 \(\rightarrow\) S6 & connect(UAVId) & OK \\
7 & S6 \(\rightarrow\) S7 & connectionWithGCASet() & \\
8 & S7 \(\rightarrow\) S8 & connectionSet(status) & \\
9 & S8 \(\rightarrow\) S9 & sendMessage(GCS2 ready) & \\
10 & S9 \(\rightarrow\) S10 & message(DLOK) & \\
11 & S10 \(\rightarrow\) S11 & ack() & connOK \\
12 & S11 \(\rightarrow\) S12 & ack() & connOK \\
13 & S12 \(\rightarrow\) S13 & ack() & connOK \\
14 & S13 \(\rightarrow\) S14 & channelReady() & \\
15 & S5 \(\rightarrow\) S15 & connectionTimeout() & \\
16 & S15 \(\rightarrow\) S16 & ack() & connNOK \\
17 & S16 \(\rightarrow\) S17 & ack() & connNOK \\
18 & S17 \(\rightarrow\) S18 & channelNotReady() & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Details of EFSM transitions. and extensions of the coverage planning methods are the required pair or required path problem methods (Ntafos and Hakimi [20]). In order to understand the method of determining the minimum flow in DAG, it is necessary to describe the method of constructing the network on which such flow will be determined. Figures 11 and 12 show the algorithm for building a flow network divided into subsequent stages of network construction and determining the minimum flow. It should be borne in mind that in the first phase of the algorithm, the maximum flow in the network (or feasible flow) is determined. Then, in the second phase, the minimum flow is determined. When determining maximum flow, it is worth connecting vertices located on one path that has no branches. This action reduces the number of vertices in the network, which simplifies the calculations. It is also worth noting an important element influencing further calculations. Each vertex of the network is an element of the algorithm (in the presented case, the sequence diagram), and when determining coverage it must be taken into account in one of the tests. Figure 11 shows the network created after vertex reduction. For each of the vertices of the new network (e.g., S0-S4), two new vertices were generated: \((50-54)^{\prime}\) and \((50-54)^{\prime\prime}\). The minimum flow between these vertices is 1 and the maximum value is C (usually it can be equal to the number of vertices of the network). This move allows the addition of an arc \(((50-54)^{\prime},(50-54)^{\prime\prime})\) to be forced when determining the maximum flow. This corresponds to the determination of the flow through the vertex \((50-54)\). Then, the network is expanded according to the algorithm given by [PERSON] and [PERSON] [36]. The feasible flow problem can be solved by solving the maximum flow problem defined in the transformed network. Two new nodes have been added: source node \(S^{*}\) and sink node \(T^{*}\).