Automatic system testing method and device based on discrete event simulation engine
Through intelligent agent automatic testing, historical data automatic testing and manual-assisted semi-automatic testing methods, the problem of automated testing of discrete event simulation engines is solved, efficient and accurate testing is achieved, meeting the rapidly developing testing needs and reducing costs.
Patent Information
- Application Number
- CN202410698089.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-05-31
AI Technical Summary
The existing technology is difficult to effectively perform automated testing of discrete event simulation engines, resulting in low testing efficiency and high cost, and cannot meet the rapidly developing testing needs.
Using the methods of agent-based automatic testing, historical data-based automatic testing and manual-assisted semi-automatic testing, multi-dimensional analysis and efficient testing of discrete event simulation engines are achieved by generating test instructions, monitoring running status and generating test reports.
It improves testing efficiency, reduces labor costs, provides wider testing coverage and higher testing accuracy, meets the automated testing needs of discrete event simulation engines, and provides a solid testing foundation for its optimization and iteration.
Smart Images

Figure CN118672903A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of software testing, and in particular relates to a system automatic testing method and device based on a discrete event simulation engine. Background Art
[0002] Software testing is the process of evaluating software quality, aiming to discover defects, errors or problems in software products. It is a key link in ensuring the quality of software. Traditional software testing mainly relies on manual testing, that is, verifying system functions and performance through manual operations. However, this method requires a lot of manpower and has disadvantages such as long testing cycle, strong dependence on professional background, and high error rate. It is difficult to adapt to the rapidly developing testing needs. With the development of computer technology, automatic testing has begun to become a convenient option. Automatic testing refers to the process of using automated tools and technologies to perform testing activities, and a smooth and low-interaction testing process is achieved by predefining a series of test processes and interactions.
[0003] Discrete event simulation is an event-driven simulation method. In discrete event simulation, the behavior of the system is modeled as a series of discrete events. These events occur at a specific time and cause the state of the system to change. Events can be defined as different types, such as message arrival events, task start or end events, etc. The discrete event simulation engine is the underlying support platform of the discrete event simulation system, with functions such as event management, time management and entity management. Discrete event simulation systems are currently widely used in various industries such as transportation logistics, industrial production, social relations, and urban planning.
[0004] Discrete event simulation engines store, process, and execute a large number of events during operation. The core of the discrete event simulation engine is to ensure that these events are executed in accordance with the specified priority and time sequence. Ordinary software testing is difficult to focus on the various events and interactive processes during the operation of discrete event simulation engines, and cannot meet the testing requirements of discrete event simulation engines. In this context, a system automatic testing method and device based on discrete event simulation engines came into being.
[0005] Chinese Patent: Performance Testing Method and Storage Medium for Simulation Engine (CN 107315889 B) provides a performance testing method for a simulation engine. However, the patent only provides a manual testing method, and the testing labor cost is high. Summary of the invention
[0006] The purpose of the present invention is to provide a system automatic testing method and device based on a discrete event simulation engine, which uses methods such as intelligent agent-based automatic testing, historical data-based automatic testing, and manually assisted semi-automatic testing to carry out system testing based on the discrete event simulation engine. By performing multi-dimensional analysis on indicators such as discrete event scheduling, time overhead, and abnormal fault tolerance processing during operation, testers can efficiently and quickly perform stability testing on the discrete event simulation engine, thereby providing a testing platform and high-precision testing guarantee for the discrete event simulation engine.
[0007] The technical solution adopted by the present invention is as follows:
[0008] A system automatic testing method based on a discrete event simulation engine comprises the following steps:
[0009] Selecting a test mode of a discrete event simulation engine, wherein the test mode includes an agent-based automatic test, a historical data-based automatic test, and a manual-assisted semi-automatic test;
[0010] Generate test instructions according to the selected test mode;
[0011] Testing the discrete event simulation engine according to the generated test instructions, and monitoring the running status of the discrete event simulation engine;
[0012] Generates test reports for discrete event simulation engines.
[0013] Furthermore, test instructions are generated according to the selected test mode, wherein the agent-based automatic test generates test instructions based on the agent training model, the historical data-based automatic test extracts and issues instructions based on instruction data in the historical operation data, and the manually-assisted semi-automatic test issues instructions in a manual testing manner.
[0014] Furthermore, the discrete event simulation engine is tested according to the generated test instructions, including using different test modes to implement automatic serial testing, automatic parallel testing and periodic loop testing; in the agent-based automatic testing and the historical data-based automatic testing, automatic serial testing or automatic parallel testing is selected to be used, wherein the automatic serial testing is based on the same discrete event simulation engine and simulation conditions to carry out tests one by one, and the automatic parallel testing is to simultaneously deploy the same simulation conditions in multiple computing environments and carry out tests separately; the periodic loop testing is to execute specific test running scenarios and instructions according to the user-defined cycle period and number of cycles, covering multiple test cycles for continuous testing, so as to discover potential problems and logical errors in the discrete event simulation engine and verify the correctness and stability of the engine; if it is a periodic loop test, the test mode is selected and the test parameters are configured to continue the test, if not, the test is terminated.
[0015] Furthermore, the agent-based automatic testing uses artificial intelligence technology to intelligently manage and interact with the testing process of the discrete event simulation engine. The agent generates corresponding instructions according to the test strategy and issues them to the discrete event simulation engine; the agent-based automatic testing includes data processing, feature identification, feature model generation, and deep learning training. First, data processing is performed on the instruction data set or the simulation data generated in real time to provide a data basis for the training of the deep neural network model. The deep neural network model is iteratively trained based on the feature model, and the feature identification in the feature model is updated in real time to create conditions for the agent's decision-making. After the feature model is updated, instructions are automatically generated based on the real-time simulation status, prompting the system to generate a large number of discrete events and promote system operation, thereby achieving more comprehensive and efficient testing of the discrete event simulation engine.
[0016] Furthermore, the automatic testing based on historical data includes:
[0017] Obtain historical data, including historical configuration, instructions, and situation data;
[0018] Preprocess historical data to meet the needs of subsequent tests;
[0019] Based on the vector space model, each historical instruction file is represented as a vector in a high-dimensional space. This vector is composed of the number of occurrences of all historical instructions in the historical instruction file, reflecting the frequency and importance of the historical instructions. By calculating the similarity between two vectors, the correlation analysis between historical instructions is realized, thereby extracting historical instructions and verifying the correctness and completeness of historical instructions.
[0020] The extracted historical instructions are sent to the discrete event simulation engine to trigger a specific event or interactive behavior at a specified time.
[0021] Further, the monitoring of the running state of the discrete event simulation engine includes:
[0022] Select and configure the test mode;
[0023] Automatically configure test parameters, including simulation running time, simulation running speed, simulation data collection frequency, and data storage path;
[0024] Generate an automated test script that meets the discrete event simulation engine test requirements, and run the test script to start the automated test process;
[0025] During the operation, the discrete event simulation engine is monitored to see whether an abnormal state occurs. If no abnormal state occurs, the next step is executed; if an abnormal state occurs, the abnormal handling process is executed;
[0026] Collect data generated during the real-time operation of the discrete event simulation engine to provide a basis for generating test reports;
[0027] Monitor the real-time status data generated during the operation of the discrete event simulation engine, and combine the real-time status data and monitoring indicators generated during the operation to judge the real-time operation status of the discrete event simulation engine in real time.
[0028] A system automatic testing device based on a discrete event simulation engine, comprising:
[0029] A test application module is used to select a test mode of a discrete event simulation engine, including agent-based automatic testing, historical data-based automatic testing, and manual-assisted semi-automatic testing, generate test instructions according to the selected test mode, and test the discrete event simulation engine according to the generated test instructions;
[0030] An operation monitoring module is used to monitor the operation status of the discrete event simulation engine;
[0031] The report generation module is used to generate test reports for discrete event simulation engines.
[0032] The present invention designs a system automatic testing method and device for a discrete event simulation engine, provides an automated and semi-automated testing method, can perform automatic testing based on an intelligent agent, perform automatic testing based on historical data, and can also perform semi-automatic testing based on manual assistance, thereby improving the test efficiency and performing testing on the scheduling process of discrete events, so that the coverage of test scenarios is wider and the test branches are more comprehensive, and the system automatic testing requirements based on the discrete event simulation engine can be met.
[0033] The present invention provides three test modes: agent-based automatic testing, historical data-based automatic testing, and manual-assisted semi-automatic testing; it provides a complete test process including test run preparation, test run monitoring, and run result analysis, which can quickly and accurately test the discrete event simulation engine, effectively improve test efficiency, and reduce labor costs.
[0034] The system automatic testing method based on discrete event simulation engine provided by the present invention has the following functions: ① providing automatic testing based on intelligent agent, which can quickly and efficiently carry out instruction issuance and data interaction with discrete event simulation engine, effectively improving the coverage breadth of test branches; ② providing automatic testing based on historical data, combining the instruction set in the existing test running scenario, and quickly generating instruction interaction for the test scenario, effectively improving test efficiency and test flexibility; ③ carrying out testing for discrete event simulation engine, carrying out automatic testing on the whole set of test processes of discrete event simulation engine in test running preparation, test running monitoring and running result analysis, and adopting discrete event multi-dimensional analysis method to meet the test requirements of discrete event simulation engine in a targeted manner. In summary, the system automatic testing method based on discrete event simulation engine provided by the present invention can meet the requirements of automated, efficient and accurate testing of discrete event simulation engine, and provide a solid testing foundation for the optimization and iteration of discrete event simulation engine. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is a functional composition diagram of the present invention.
[0036] Figure 2 It is the engine automation test flow chart.
[0037] Figure 3 It is the test application module operation flow chart.
[0038] Figure 4 It is a flowchart of automatic test processing based on historical data.
[0039] Figure 5 It is the processing flow chart of the operation monitoring module.
[0040] Figure 6 It is the operation flow chart of the report generation module.
[0041] Figure 7 This is a comparison chart of simulation time and real time overhead. DETAILED DESCRIPTION
[0042] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below through specific embodiments and drawings.
[0043] The present invention provides a system automatic testing device based on a discrete event simulation engine, which mainly includes three modules, namely a test application module, an operation monitoring module and a report generation module, thereby realizing the system automatic testing function based on a discrete event simulation engine. Among them, the test application module defines three test modes and three instruction generation modes (instructions are user inputs that can trigger specific events or interactive behaviors during the operation of the engine), providing test users with a diverse and convenient testing method; the operation monitoring module is mainly used to manage the test process and monitor the test operation status, and its functions include automatic configuration of test parameters, automatic generation and operation of scripts, operation exception handling, real-time data collection, etc.; the report generation module is mainly used to generate test reports, and its functions include automatic comparison of multi-dimensional events, visual display and report generation, operation exception diagnosis, system iterative optimization, etc. Figure 1 The figure shows the functional composition diagram of the system automatic test device based on discrete event simulation engine of the present invention. Figure 2 Shown is the operation flow of the system automatic testing method based on the discrete event simulation engine.
[0044] The specific contents covered by the present invention include:
[0045] 1. Test application module:
[0046] The test application module mainly includes three test modes: agent-based automatic testing, historical data-based automatic testing, and manual-assisted semi-automatic testing. It can realize multiple functions such as multi-cycle automatic loop testing, serial testing, and parallel testing.
[0047] like Figure 3 The following is a flowchart of the test application module operation. The steps are as follows:
[0048] Step 1: Select the test mode and configure the test parameters, and start the test run after ensuring that the system configuration and test requirements are accurate.
[0049] Step 2: Generate test instructions according to different test modes. Agent-based automatic testing can generate instructions based on the agent training model, historical data-based automatic testing models can extract and issue instructions based on instruction data in historical operation data, and manual auxiliary testing uses manual testing to issue instructions.
[0050] Step 3: Select automatic serial testing or automatic parallel testing in automatic testing mode (automatic testing based on intelligent agents or automatic testing based on historical data). Serial testing is to conduct tests one by one based on the same discrete event simulation engine and simulation conditions, while parallel testing is to deploy the same simulation conditions in multiple computing environments at the same time and conduct tests separately to improve the efficiency of simulation operation.
[0051] Step 4: Engine operation and status monitoring, monitor the real-time status of the engine and data input and output, etc.
[0052] Step 5: Generate a test report and analyze the performance of the discrete event simulation engine.
[0053] Step 6: Determine whether to perform a cycle test. Cycle testing is to execute specific test scenarios and instructions according to the cycle period and number of cycles defined by the user, covering multiple test cycles for continuous testing, so as to discover potential problems and logical errors in the discrete event simulation engine and verify the correctness and stability of the engine. If it is a cycle test, jump to step 1 to continue running; if not, end.
[0054] The three test modes of the present invention are specifically described as follows:
[0055] 1) Agent-based automatic testing: Agent-based automatic testing refers to the use of artificial intelligence technology to intelligently manage and interact with the test process of the discrete event simulation engine, including automatic generation and sending of instructions. In automatic testing, the agent generates corresponding instructions according to the test strategy and issues them to the discrete event simulation engine. These instructions include operation instructions during the operation of the engine, event triggering instructions, or other instructions related to system interaction. The generation method is not limited to rule-based, randomness-based, or machine learning-based technologies.
[0056] The agent-based automatic test mainly consists of data processing, feature identification, feature model generation, deep learning training and other parts. First, data processing is performed on the instruction data set or the simulation data generated in real time to provide a data basis for the training of the deep neural network model. The deep neural network model is iteratively trained based on the existing feature model, and the feature identification in the feature model is updated in real time to create conditions for the agent's decision-making. After the feature model is updated, instructions are automatically generated based on the real-time simulation status (the format of the generated instructions is shown in Table 1). After the generated instructions enter the system, they can prompt the system to generate a large number of discrete events and promote the operation of the system, thereby achieving a more comprehensive and efficient test of the discrete event simulation engine.
[0057] Table 1 User input data field table
[0058]
[0059] 2) Automatic testing based on historical data: Automatic testing based on historical data refers to the automatic extraction, screening and sending of instructions by analyzing previous test data (including historical scenarios, configurations, instructions, situations, etc.). In automatic testing based on historical data, according to historical operation data and historical instructions (historical instructions are instruction strings composed of fields such as issuing time, issuing personnel, instruction type, executor, target, parameters, priority, duration, etc.), the processed events and instruction sequences are used to simulate the interactive behavior and operation scenarios of the discrete event simulation engine, thereby realizing automatic system testing.
[0060] Specifically, firstly, the simulation scenarios, configuration and instruction data constructed in the process of testing and verification based on the discrete event simulation engine, as well as the situation data generated thereby, are collected. Since the instruction parameters contained in the historical instruction data are different, it is necessary to pre-process the instruction string, specifically screen out the instructions suitable for the current situation and configure the instruction parameters to ensure the effectiveness of the instructions. Then, instructions or instruction sequences are generated according to the current system status, the patterns and rules in the historical data. Finally, the generated instructions are issued to the simulation engine being tested, and the operation is monitored. Through the above steps, historical data can be used to generate and issue instructions, thereby performing automated testing, improving test efficiency and accuracy, and also being able to better simulate interactive behaviors and operation scenarios.
[0061] Figure 4 It is a flowchart of automatic test processing based on historical data, including the following steps:
[0062] Step 1: Obtain historical configuration, instruction, status and other data, including but not limited to extracting from databases, files or other data sources.
[0063] Step 2: Perform pre-processing operations such as data cleaning, screening, and conversion on historical data to meet the needs of subsequent testing.
[0064] Step 3: Historical instruction extraction. Based on the vector space model, each historical instruction file is represented as a vector in a high-dimensional space. This vector is composed of the number of occurrences of all historical instructions in the historical instruction file (represented as weights), reflecting the frequency and importance of the occurrence of historical instructions. By calculating the similarity (Euclidean distance) between two vectors, the correlation analysis between historical instructions is realized, thereby extracting historical instructions and verifying the correctness and completeness of historical instructions.
[0065] Step 4: Engine operation and status monitoring, sending the extracted historical instructions to the discrete event simulation engine to trigger a specific event or interactive behavior at a specified time.
[0066] Step 5: Generate test report.
[0067] 3) Semi-automatic testing based on manual assistance: Operators and testers cooperate with each other to manually generate and issue instructions to the simulation engine under test based on business knowledge and operation experience. This method has a relatively high degree of freedom and can perform customized tests according to specific needs, making the test more flexible, the instructions more professional, and the test branches more widely covered.
[0068] 2. Run the monitoring module:
[0069] In the present invention, the functions of the operation monitoring module cover the entire test process of test operation preparation, test operation monitoring and operation result analysis, mainly including automatic configuration of test parameters, automatic script generation and operation, operation exception handling, real-time data collection, etc. Figure 5 Shown is the operation monitoring module processing flow chart and its corresponding steps:
[0070] Step 1: Select and configure the test mode.
[0071] Step 2: Automatic configuration of test parameters, including automatic filling of configuration parameters such as simulation running time, simulation running speed, simulation data collection frequency, and data storage path.
[0072] Step 3: Automatically generate and run the test script. Generate an automated test script that meets the discrete event simulation engine test requirements, including execution steps such as starting the simulation engine, setting the simulation running speed, monitoring the simulation running time and events, as well as functions such as data interaction process and expected data processing, to manage and monitor the entire test process. Run the test script to start the automatic test process.
[0073] Step 4: During the operation, monitor whether the discrete event simulation engine generates an abnormal state. If no abnormal state is generated, execute the next step; if an abnormal state is generated, execute step 7.
[0074] Step 5: Real-time data collection: Collect the data generated during the real-time operation of the discrete event simulation engine to provide a basis for module 3 (test report generation).
[0075] Step 6: Data monitoring. Monitor the real-time status data such as event scheduling and event overhead generated during the operation of the discrete event simulation engine, and combine the real-time data generated during the operation with the monitoring indicators to judge the real-time operation status of the discrete event simulation engine in real time. Execute step 8.
[0076] Step 7: Run exception processing and collect exception information. When an exception occurs in the discrete event simulation engine, it can be identified and the processing flow can be started in time to avoid engine crashes or other more serious conditions. Record the exception in the log to lay the foundation for subsequent fault diagnosis, defect repair, optimization iteration, etc.
[0077] Specifically, the exception handling described in the present invention includes: configuration errors of the discrete event simulation engine operating environment, operation exceptions caused by external interruption events of the engine, exceptions caused by internal logic errors of the engine, program blocking caused by waiting for user interaction during operation, etc. Different processing measures are matched mainly through real-time collection of abnormal output information and pre-set keywords, including but not limited to pre-setting user input information, recording and storing abnormal information, and program exit.
[0078] Step 8: Generate test report.
[0079] The operation monitoring module can automatically carry out tests based on the discrete event simulation engine and automatically record the test results, which not only saves testing time and allows engine testers to focus more on analyzing and solving problems, but also ensures the reliability and efficiency of the test.
[0080] 3. Report generation module:
[0081] In the system automatic test, the system performance and functions are analyzed and a test report is generated based on the results of the automatic operation and the monitoring data. The functions of the report generation module include: automatic comparison of multi-dimensional events, visual display and report generation, operation abnormality diagnosis, system iteration optimization and other functions. Figure 6 The following is a flowchart of the report generation module operation, including the following steps:
[0082] Step 1: Select and configure the test mode, start the test run, and monitor whether the running status is normal.
[0083] Step 2: If the status monitoring is normal, proceed to the next step; if the status monitoring is abnormal, proceed to step 5.
[0084] Step three: Conduct automatic comparison of multi-dimensional events. Conduct multi-dimensional comparison of the scheduling and execution of discrete events from aspects such as the number of event scheduling and average execution time overhead, and deeply analyze the functional completeness, computational efficiency, and scheduling accuracy of the discrete event simulation engine. The discrete event simulation engine calls many simulation events (events) during operation. These simulation events are determined in terms of the order of operation and the number of operations. By comparing the order of operation, the functional completeness and scheduling accuracy of the discrete event simulation engine can be analyzed; in addition, in different test instances, the time overhead occupied by the same scheduling of the same simulation event can reflect the computational efficiency and the operating efficiency of the engine algorithm. This is also the indicator that the present invention focuses on in the process of testing the discrete event simulation engine.
[0085] Step 4: Perform visual display. Use statistical methods, data visualization and other technologies to process, compare and analyze the test result data, calculate the average value, standard deviation and other statistics of each dimension indicator, and use line charts, bar charts and other charts to represent data differences. Execute step 10.
[0086] Step 5: Run abnormality diagnosis. In the process of analyzing the test results, if the system has problems or abnormalities, it is necessary to record log information such as detailed description of the problem, steps to reproduce, and scope of impact, and conduct source tracing and diagnosis based on the abnormal situation. For abnormal situations generated during operation: discrete event simulation engine operating environment configuration errors, engine external interruption events leading to operational abnormalities, engine internal logic errors causing abnormalities, program blocking due to the need to wait for user interaction during operation, etc., classification and processing are carried out by matching keywords in the output information of different situations. Including but not limited to presetting user input information, recording and storing abnormal information, and program exit.
[0087] Step 6: Determine whether there is a defect. If so, proceed to the next step; if not, proceed to step 8.
[0088] Step 7: Iterate optimization and fix defects. For the diagnosed anomalies and defects, it is necessary to repair them in a timely manner. First, it is necessary to locate the defects and use code dynamic analysis technology to find the location of the defective code that may exist in the discrete event simulation engine; then use patch repair technology to repair the defective code and verify the effectiveness of the repair; finally, record the relevant information of the repaired defects in a timely manner.
[0089] Step 8: Determine whether there is a demand change. If so, proceed to the next step; if not, proceed to step 10.
[0090] Step 9: Iterate test requirements. Based on the above defect repair and test requirement change verification process, determine the rationality of the current test requirements and the necessity of adjustment. For engine function and performance test requirements that are not currently covered, it is necessary to iterate the test requirements in a timely manner.
[0091] Step 10: Test report generation: Organize, summarize and summarize the test comparison of the discrete event simulation engine and all necessary situations generated during the test to form a test summary report.
[0092] Step 10: Determine whether to perform a periodic test. If yes, execute step 1; if not, end.
[0093] The automatic comparison and visualization of multi-dimensional events based on the discrete event simulation engine directly reflects the test results of the engine. Table 2 statistically analyzes and compares the discrete event scheduling generated by the discrete event simulation engine during the scheduling process, mainly comparing key indicators such as the scheduling times, simulation time, and physical real event overhead of discrete events. The number is the order of the timing record of relevant situations during the operation process. The simulation time is based on 2030-1-1 12:30:00 as the starting time. The situation is summarized and saved every 1 hour of simulation time; the physical time of the simulation start is 2023-6-1 10:00:00. For event 1, its cumulative scheduling times are 2351, 2876, 3202, 3869, 4122, and 4387, showing a certain increasing pattern. Event 2, event 3, ..., event n all show a certain pattern.
[0094] Table 2 Comparison of discrete event scheduling (data example)
[0095]
[0096] like Figure 7 The figure shows a line graph comparing simulation time and real time overhead, which indicates the time overhead of the discrete event simulation engine during operation, including both the time overhead of initializing the system and the time overhead of scheduling and calculating discrete events.
[0097] By generating detailed test reports and analyzing the test results, we can fully and accurately understand the performance and functional performance of the system in different scenarios. The report generation module is an indispensable part of system automatic testing, which can help testers better understand the system situation and provide strong support for problem location and resolution, iterative optimization, etc.
[0098] The key points of the present invention are:
[0099] The present invention proposes a system automatic testing method and device based on a discrete event simulation engine, which realizes the system automatic testing function by constructing functional modules such as test application, operation and monitoring, and report generation. The test application module is mainly based on intelligent agent automatic testing, historical data-based automatic testing, and manual-assisted semi-automatic testing. It adopts automatic serial testing, automatic parallel testing, multi-cycle loop testing and other methods to carry out system testing based on a discrete event simulation engine; the operation monitoring module forms an effective management of the entire test operation process by covering a full set of test processes including test operation preparation, test operation monitoring, and operation result analysis, and provides a data basis and operation support for the next step of analysis; the report generation module analyzes indicators such as discrete event scheduling, time overhead, and abnormal fault tolerance processing during the operation process, and adopts a multi-dimensional event analysis method, so that testers can efficiently and quickly perform stability testing on the discrete event simulation engine, and provide a test platform and high-precision test guarantee for the discrete event simulation engine.
[0100] Another embodiment of the present invention provides a computer device (computer, server, smart phone, etc.), which includes a memory and a processor, the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program includes instructions for executing each step in the method of the present invention.
[0101] Another embodiment of the present invention provides a computer-readable storage medium (such as ROM / RAM, magnetic disk, optical disk), wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the steps of the method of the present invention are implemented.
[0102] The specific embodiments of the present invention disclosed above are intended to help understand the content of the present invention and implement it accordingly. It can be understood by those skilled in the art that various replacements, changes and modifications are possible without departing from the spirit and scope of the present invention. The present invention should not be limited to the contents disclosed in the embodiments of this specification, and the scope of protection of the present invention shall be subject to the scope defined in the claims.
Claims
1. A system automatic testing method based on discrete event simulation engine, characterized in that: The following steps are involved: Selecting a test mode of a discrete event simulation engine, wherein the test mode includes an agent-based automatic test, a historical data-based automatic test, and a manual-assisted semi-automatic test; Generate test instructions according to the selected test mode; Testing the discrete event simulation engine according to the generated test instructions, and monitoring the running status of the discrete event simulation engine; Generates test reports for discrete event simulation engines.
2. The method according to claim 1, characterized in that The test instructions are generated according to the selected test mode, wherein the agent-based automatic test generates test instructions based on the agent training model, the historical data-based automatic test extracts and issues instructions based on instruction data in the historical operation data, and the manually-assisted semi-automatic test issues instructions in a manual testing manner.
3. The method according to claim 1, characterized in that The discrete event simulation engine is tested according to the generated test instructions, including using different test modes to implement automatic serial testing, automatic parallel testing and periodic loop testing; in the agent-based automatic testing and historical data-based automatic testing, automatic serial testing or automatic parallel testing is selected to be used, wherein the automatic serial testing is based on the same discrete event simulation engine and simulation conditions to carry out tests one by one, and the automatic parallel testing is to deploy the same simulation conditions in multiple computing environments at the same time and carry out tests respectively; The cycle test is to execute specific test running scenarios and instructions according to the cycle period and number of cycles defined by the user, covering multiple test cycles for continuous testing, so as to discover potential problems and logical errors of the discrete event simulation engine and verify the correctness and stability of the engine; If it is a cycle test, select the test mode and configure the test parameters to continue the test. If not, end it.
4. The method according to claim 1, characterized in that: The agent-based automatic testing uses artificial intelligence technology to intelligently manage and interact with the testing process of the discrete event simulation engine. The agent generates corresponding instructions according to the test strategy and issues them to the discrete event simulation engine. The agent-based automatic testing includes data processing, feature identification, feature model generation, and deep learning training. First, data processing is performed on the instruction data set or the simulation data generated in real time to provide a data basis for the training of the deep neural network model. The deep neural network model is iteratively trained on the basis of the feature model, and the feature identification in the feature model is updated in real time to create conditions for the agent's decision-making. After the feature model is updated, instructions are automatically generated based on the real-time simulation status, prompting the system to generate a large number of discrete events and promote system operation, thereby achieving more comprehensive and efficient testing of the discrete event simulation engine.
5. The method according to claim 1, characterized in that The automatic test based on historical data includes: Obtain historical data, including historical configuration, instructions, and situation data; Preprocess historical data to meet the needs of subsequent tests; Based on the vector space model, each historical instruction file is represented as a vector in a high-dimensional space. This vector is composed of the number of occurrences of all historical instructions in the historical instruction file, reflecting the frequency and importance of the historical instructions. By calculating the similarity between two vectors, the correlation analysis between historical instructions is realized, thereby extracting historical instructions and verifying the correctness and completeness of historical instructions. The extracted historical instructions are sent to the discrete event simulation engine to trigger a specific event or interactive behavior at a specified time.
6. The method according to claim 1, characterized in that The monitoring of the running state of the discrete event simulation engine comprises: Select and configure the test mode; Automatically configure test parameters, including simulation running time, simulation running speed, simulation data collection frequency, and data storage path; Generate an automated test script that meets the discrete event simulation engine test requirements, and run the test script to start the automated test process; During the operation, the discrete event simulation engine is monitored to see whether an abnormal state occurs. If no abnormal state occurs, the next step is executed; if an abnormal state occurs, the abnormal handling process is executed; Collect data generated during the real-time operation of the discrete event simulation engine to provide a basis for generating test reports; Monitor the real-time status data generated during the operation of the discrete event simulation engine, and combine the real-time status data and monitoring indicators generated during the operation to judge the real-time operation status of the discrete event simulation engine in real time.
7. The method according to claim 1, characterized in that The test report of the discrete event simulation engine is generated, including: Step 1: Select and configure the test mode, start the test run, and monitor whether the running status is normal; Step 2: If the status monitoring is normal, proceed to the next step; if the status monitoring is abnormal, proceed to step 5; Step 3: Conduct a multi-dimensional comparison of the scheduling and execution of discrete events, and conduct an in-depth analysis of the functional completeness, computational efficiency, and scheduling accuracy of the discrete event simulation engine; Step 4: Use statistical methods and data visualization technology to process, compare and analyze the test result data, calculate the statistics of each dimension indicator, and represent the data differences in the form of charts and graphs, and then proceed to step 10; Step 5: When analyzing the test results, if any problems or anomalies are found in the system, record the detailed description of the problem, steps to reproduce the problem, and the scope of impact, and perform source tracing and diagnosis based on the anomaly. Step 6: Determine whether there is a defect. If so, proceed to the next step; if not, proceed to step 8; Step 7: Repair the diagnosed anomalies and defects in a timely manner; Step 8: Determine whether there is a demand change. If so, proceed to the next step; if not, proceed to step 10; Step 9: Based on the defect repair and test requirement change verification process, determine the rationality of the current test requirements and the necessity of adjustment; for engine function and performance test requirements that are not currently covered, promptly iterate the test requirements; Step 10: Arrange, summarize and conclude the test comparison of the discrete event simulation engine and all necessary situations generated during the test to form a test report; Step 10: Determine whether to perform a periodic test. If yes, execute step 1; if not, end.
8. A system automatic testing device based on a discrete event simulation engine, characterized in that: include: A test application module is used to select a test mode of a discrete event simulation engine, including agent-based automatic testing, historical data-based automatic testing, and manual-assisted semi-automatic testing, generate test instructions according to the selected test mode, and test the discrete event simulation engine according to the generated test instructions; An operation monitoring module is used to monitor the operation status of the discrete event simulation engine; The report generation module is used to generate test reports for discrete event simulation engines.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program comprises instructions for executing the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Railway vehicle electrical control cabinet test device and test method
CN105223897A
Performance testing method of simulation engine and storage medium
CN107315889A
Intelligent game confrontation platform
CN112295229A
Application program testing method and device, equipment and storage medium
CN112988552A
Flight parameter acquisition and recording equipment test system and test method
CN116119019A
Cited By
Automatic test system and method based on virtual chip mounter simulation system, and storage medium
CN119322727A
