# Context-Aware System for Information Flow Management in Factories of the Future
## 4 Experimental Findings
### Tests
The functional tests conducted in the application are detailed in Table 4, indicating to which applications they were applied, their description, and the test results. All functionalities for which the components of the Context Engine are responsible passed the tests, confirming that the applications are functioning as expected. Figure 5 presents an example of the Context Acquisition in operation when tests 1, 2, and 3 from Table 4 were applied to verify its functioning. In this test, two productions and two stops were added to the database through the ContinentalTestDb application; for each dataset, one object requires sending an alert, while the other does not. As can be seen in Figure 5, in the red square, the application identified all four data changes. In the blue square, it is presented what the application performed after these checks, showing that tests 1, 2, and 3 were approved. In other words, all four data points were added to the _Context Engine_ database, the application recognized urgent or important situations during the analysis of this data, and the corresponding alerts were successfully sent for both cases that should occur. These tests were not only verified by the console outputs presented in Figure 5, but it was also confirmed in the Context Engine database whether the identified data changes were added, and if information about the respective alert submissions was also recorded. After this verification, it was confirmed that the application was functioning correctly. In order to conduct test 3, presented in Table 4, in the _Context Builder_, the approach was similar. Information about a missing component in a production line was sent through an HTTP POST request to an API microservice. After this submission, it was verified whether the application processed the information correctly, sent the corresponding alert, and recorded the information in the database. This test was also approved, demonstrating that the functionality is operating correctly. \begin{table}
\begin{tabular}{c l l l} \hline \hline \# & **Description** & **Application(s)** & **Results** \\ \hline \multirow{4}{*}{1} & Identification of changes when inserting new data & \multirow{4}{*}{_Context Acquisition_} & \multirow{4}{*}{Working correctly} \\  & into the simulated database and recognition of urgent or important situations during the analysis of this data. & & \\ \hline \multirow{4}{*}{2} & Verification of whether, after identifying changes & \multirow{4}{*}{_Context Acquisition_} & \multirow{4}{*}{Working correctly} \\  & in the data, there is an addition or update in the & & \\ \cline{1-1}  & Context Engine database. & & \\ \hline \multirow{4}{*}{3} & Verification of the sending of alerts/notifications to the NAS when necessary and confirmation in the history of the Context Engine database regarding the recording of the sent alerts. & \multirow{4}{*}{_Context Acquisition_} & \multirow{4}{*}{Working correctly} \\  & & & \\ \cline{1-1}  & Verification of the application’s ability to manage/clean data by eliminating those older than deemed valid after their addition to the database. & & \\ \cline{1-1} \cline{2-2} \cline{4-4}  & Verification of the correct operation of the services & \multirow{4}{*}{_Context Builder_} & \multirow{4}{*}{Working correctly} \\  & by executing API methods with various data, analyzing different situations. & & \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Functional tests. Test 4, presented in Table 4, conducted in the _Context Builder_, was executed as follows: data was added to the database with dates older than those considered valid by the application. After this insertion, the necessary time was waited for the application to clean up old data. Subsequently, it was verified in the database whether this data was successfully removed. After this verification, it was confirmed that this functionality was operating correctly. Finally, test 5 presented in Table 4 was conducted in the _Context Builder_ and _Context Server_.