# A Method for Modeling and Testing Near-Real-Time System Scenarios
## 1 Introduction  
This article presents the concept of modeling the architecture and operating scenarios of a near-real-time system, which implements system operating scenarios subject to the certification process. To describe the issue and related problems for this purpose, the case of designing the construction of an unmanned aerial vehicle (UAV) managed from a ground control station (GCS) is used. The UAV mission management system is a near-real-time system due to delays in the radio link between the UAV and the GCS. Conducting a certification process that ends with issuing a decision regarding system safety requires an evidentiary process in which detailed system scenarios are presented, along with their mapping to the architectural elements on which they were implemented. For the purposes of certification, a methodology for describing scenarios must be developed, allowing them to be tested and providing evidence that all code affecting the system's safety has been covered with tests. Issues related to capacity planning must be described, i.e., ensuring the throughput of individual architectural elements from the point of view of processing requirements (capacity planning). This type of activity requires methodical system design, starting from collecting a coherent and complete set of requirements for the system (high-level requirements) and decomposing the requirements into detailed requirements (low-level requirements). Thefinal stage of requirements modeling is the presentation of all system functionalities in the form of decomposed system use cases on use case diagrams. At this point, for each use case of the system (function or group of interrelated functions, depending on the level of decomposition), the place in the system architecture where the given functionality will be implemented is determined. In the next steps of system design, operating scenarios are designed in the form of finite-state machine (FSM) models known from the SysML language (an engineering extension of UML). Each machine is decomposed into different diagrams describing the processing in the system. Typically, sequence diagrams are used. For each state machine, a description of test case coverage should be prepared, usually the so-called path coverage, transition coverage, or state coverage. This involves describing a coherent and complete set of possible paths (transitions) in state machines that directly correspond to the processing scenarios in the system. The prepared sets of system scenario coverage translate directly into test sets and system test plans. Because unmanned systems controlled by ground control stations (GCSs) can be considered distributed systems connected via wireless networks with a high degree of unreliability, they are usually modeled using state machines containing parallel states, interconnected only by sequences of controls sent between states. This type of system modeling requires determining test coverage of all scenarios on a modified state machine description, which is an additional complication when modeling the system. Due to the dispersion of the elements of the system under consideration, we use the 1+5 architectural views model, adapted to describe the cooperating independent components (Gorski [1]). In this article, the logical view of the model is used to present the allowed states of the unmanned aircraft system. This paper presents an example of modeling unmanned system scenarios using UML state machines containing parallel states and methods of transforming the UML model to ECFSM models (an extension of the classic FSM machine), and then, to a state machine model without parallel states (FSM). Based on such a model, a method and examples of generating coverage of processing paths are presented. Then, for the abstract system model designed in this way and the selected operating scenario, an unmanned system architecture model is presented, on which the software implementing the previously described scenarios is embedded.