# A Method for Modeling and Testing Near-Real-Time System Scenarios
## 1 Introduction
The system architecture was prepared for an unmanned aircraft system for which it is possible to implement the functionality of transferring control between GCSs. Generally, the system functions were modeled in the use cases view of the 1+5 model using UML use case diagrams. UAV takeover involves giving control of the UAV to a second control station (GCS). In such a scenario, the distributed system consists of five components: a UAV, two GCS control stations, and two ground data terminals (GDTs). The separation of GDT components is not accidental and occurs in every case when the system has to isolate the place of working of operators from the place of data transmission using a radio station to the UAV. In this case, there are two typical connections between system elements. The first is the GCS landline connection to the GDT. These are usually connections made using optical fibers. The GDT connection to the UAV is a radio connection. The described architecture is very popular and is practically used in most air systems used by the military. An example of such an architecture is the Turkish Bayraktar TB2, which uses handover procedures when patrolling borders. Systems of this type are used by border protection services, including the European Frontex. They perform search and rescue missions and border protection missions against smugglers. The novelties presented in this work concern the description of the method of modeling near-real-time system operation scenarios and the location of these scenarios in the system's hardware architecture. For this purpose, the UML modeling language and the model-based system design methodology were used in such a way as to minimize the scope of work in the description of system scenarios, model transformation, and methods of generating tests based on the prepared models. For this purpose, CEFSM machines commonly known from the literature, and their simplified versions of EESMs, were used. In the article, it is shown how to generate EFSMs from sequence diagram models and how to build test scenarios. The method of integrating scenarios with flight safety functions described in the Functional Hazard Analysis formal document is also presented. The work aims to show how to model the system architecture ensuring the required level of safety and reliability. Reference is made to the NATO 4586 standard [2], which indicates the preferred method of building solutions for military unmanned software. The rest of the work is as follows. Section 2 presents the most important literature items related to the issues described in the article. Section 3 shows how to model requirements and transform the requirements description into a formal UML use case model. Issues related to modeling functions related to the safety of UAVs in flight, described in the formal document Functional Hazard Analysis (a document required in the certification process of air platforms), were also discussed. Section 4 presents the principles of transformation from formal state machine models containing parallel states in UML to EFSM machines using an intermediate step, i.e., model transformation based on sequence diagrams. A method of practical system modeling is shown, which allows the use of basic UML models (state machines and sequence diagrams) for planning a set of system tests. The relationship between sequence models and EFSMs is discussed, for which there is extensive literature related to planning the testing of model paths. Section 5 shows an example of modeling system functions based on the task of transferring control of a UAV between two GCS stations. An example of generating test coverage of the model based on the transformation model to EFSM and generating test path coverage is discussed. Section 6 encompasses a discussion on the pros and cons of the method. Section 7 summarizes the method described in the work and indicates further possible directions of its development.