An automated testing method and device for a simulation test verification platform
By simulating users to perform random operations and random matching functions on the simulation test verification platform, automated testing of the GCAir platform is realized, solving the problems of low manual testing efficiency and poor accuracy, and improving testing efficiency and accuracy.
Patent Information
- Application Number
- CN202411402252.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-10-09
AI Technical Summary
The existing methods of testing software defects in GCAir rely on manual labor, are inefficient and are prone to ignore important bugs or introduce subjective judgments, which affects the accuracy of the test.
The automated testing method is adopted to simulate users performing multiple random operations on the simulation test verification platform, obtain configuration options that support these operations, and randomly match the software interface design mapping information with the functions of the automation testing framework to realize automated testing of the simulation test verification platform.
It improves the testing efficiency and accuracy of the simulation test verification platform, avoids subjective judgment and negligence caused by human factors, and ensures comprehensive and accurate detection of software defects.
Smart Images

Figure CN119292930B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automated testing technology, and more specifically, to an automated testing method and device for a simulation test verification platform. Background Art
[0002] The system simulation, test and verification integrated platform (GCAir) provides tool support for the forward design of complex equipment system development and provides solutions for the implementation of digital twin technology, which can realize full virtual simulation to semi-physical simulation.
[0003] The existing method of testing software defects (bugs) in GCAir is done manually. Since the efficiency of manual testing is relatively low, and testers may ignore some important bugs due to negligence or misunderstanding when reviewing codes and conducting tests, or introduce subjective judgments due to personal preferences or lack of experience, which affects the accuracy of the test.
[0004] Therefore, how to improve the testing efficiency and accuracy in GCAir is a problem that needs to be solved urgently in this application. Summary of the invention
[0005] In view of this, the present application discloses an automated testing method and device for a simulation test verification platform, aiming to improve the testing efficiency and accuracy in the simulation test verification platform.
[0006] In order to achieve the above purpose, the disclosed technical solution is as follows:
[0007] The first aspect of the present application discloses an automated testing method for a simulation test verification platform, the method comprising:
[0008] Simulate multiple random operations performed by the user on the simulation test verification platform; the random operations include clicking buttons, dragging models, and inputting data;
[0009] Through the preset command prompt, get the configuration options corresponding to supporting multiple random operations;
[0010] In running a test program for a simulation test verification platform, obtaining each software interface design mapping information of the simulation test verification platform; the software interface design mapping information includes UI information and its level information;
[0011] Randomly match the design mapping information of each software interface with the functions supported by the automated testing framework;
[0012] Obtain the number of times each function passes the normal operation simulation test verification platform after random matching;
[0013] If the number of passes meets the preset conditions, a test report is generated to complete the automated test of the simulation test verification platform; wherein the preset conditions are determined based on the total number of operations of the event specified in the configuration options;
[0014] The random matching of the software interface design mapping information with the functions supported by the automated testing framework includes:
[0015] Get the key in the UI key-value pair from each software interface design mapping information;
[0016] The key is randomly matched with the functions supported by the automated testing framework, and the random match is executed to generate a statement for normal operation.
[0017] Preferably, in running the test program for the simulation test verification platform, obtaining the design mapping information of each software interface of the simulation test verification platform includes:
[0018] In running the test program for the simulation test verification platform, starting the integrated development environment process of the automated test;
[0019] Through the integrated development environment process of the automated test, the source code file is called to obtain the design mapping information of each software interface of the simulation test verification platform.
[0020] Preferably, if the number of passes meets a preset condition, a test report is generated to complete the automated test of the simulation test verification platform, including:
[0021] Get the total number of operations of the events set in the configuration options;
[0022] If the number of passes is greater than or equal to the total number of operations, determining that the number of passes meets a preset condition;
[0023] When the number of passes meets the preset conditions, a test report is generated to complete the automated testing of the simulation test verification platform.
[0024] Preferably, it also includes:
[0025] If the number of passes is less than the total number of operations, determining that the number of passes does not meet a preset condition;
[0026] If the number of pass times does not meet the preset conditions, return to the step of randomly matching the software interface design mapping information with the functions supported by the automated testing framework until the number of pass times meets the preset conditions, and generate a test report to complete the automated testing of the simulation test verification platform.
[0027] Preferably, it also includes:
[0028] In the process of randomly matching the mapping information of each software interface design with the functions supported by the automated testing framework, when it is detected that the functions supported by the automated testing framework indicate the input of numbers, random numbers are used for addition.
[0029] Preferably, it also includes:
[0030] When the randomly matched functions operate normally on the simulation test verification platform, each valid operation record is obtained;
[0031] Associating each valid operation record with a seed value and storing the result in a local file; wherein the seed value is used for reproducing the location;
[0032] When executing the test command, if the seed value read is the same as the seed value in the local file, then return to execute the step of obtaining each valid operation record when each function after random matching operates normally on the simulation test verification platform;
[0033] If the read seed value is different from the seed value in the local file, a new seed value is created and all subsequent operations are recorded.
[0034] Preferably, it also includes:
[0035] Store the test report via the store command;
[0036] The storing of the test report by the storage command comprises:
[0037] When the storage command is a full-process recording command, a start screen capture function is executed at the start time of the automated test code running, and a stop screen capture function is executed at the end of the automated test code, a video file of the full-process recording of the automated test is generated, and the video file is stored;
[0038] When the storage command is a test generation command, information during the automated test is recorded in a log file, a file corresponding to the test report is generated, and the file corresponding to the test report is stored.
[0039] The second aspect of the present application discloses an automated testing device for a simulation test verification platform, the device comprising:
[0040] A simulation unit, used to simulate multiple random operations performed by a user on the simulation test verification platform; the random operations include clicking a button, dragging a model, and inputting data;
[0041] A first acquisition unit is used to obtain configuration options corresponding to supporting multiple random operations through a preset command prompt;
[0042] The second acquisition unit is used to acquire the design mapping information of each software interface of the simulation test verification platform when running the test program for the simulation test verification platform; the software interface design mapping information includes UI information and its level information;
[0043] A random matching unit is used to randomly match the mapping information of each software interface design with the functions supported by the automated testing framework;
[0044] The third acquisition unit is used to obtain the number of times each function passes the normal operation simulation test verification platform after random matching;
[0045] A generating unit, configured to generate a test report if the number of passes meets a preset condition, so as to complete the automated test of the simulation test verification platform; wherein the preset condition is determined based on the total number of operations of the event specified in the configuration option;
[0046] The random matching unit is specifically used to obtain the key in the UI key-value pair from each software interface design mapping information; randomly match the key with the function supported by the automated testing framework, and execute the random matching to generate a statement for normal operation.
[0047] Preferably, the second acquisition unit includes:
[0048] A startup module, used to start the integrated development environment process of the automated test while running the test program for the simulation test verification platform;
[0049] The calling acquisition module is used to call the source code file to acquire the design mapping information of each software interface of the simulation test verification platform through the integrated development environment process of the automated test.
[0050] Preferably, the generating unit comprises:
[0051] The first acquisition module is used to acquire the total number of operations of the event set in the configuration option;
[0052] A first determination module, configured to determine that the number of passes satisfies a preset condition if the number of passes is greater than or equal to the total number of operations;
[0053] The generation module is used to generate a test report when the number of passes meets a preset condition, so as to complete the automated test of the simulation test verification platform.
[0054] Through the above technology, it can be known that the present application discloses an automated testing method and device for a simulation test verification platform, which simulates multiple random operations performed by a user on the simulation test verification platform, the random operations include clicking buttons, dragging models and inputting data, and obtaining configuration options corresponding to supporting multiple random operations through a preset command prompt; in running a test program for the simulation test verification platform, obtaining various software interface design mapping information of the simulation test verification platform, the software interface design mapping information includes UI information and its hierarchical information, and randomly matching each software interface design mapping information with the functions supported by the automated testing framework, and obtaining the number of passes of the simulation test verification platform for normal operation of each function after random matching, and if the number of passes meets the preset conditions, generating a test report to complete the automated testing of the simulation test verification platform; wherein the preset conditions are determined based on the total number of operations of the specified event in the configuration options, and randomly matching each software interface design mapping information with the functions supported by the automated testing framework, including obtaining the key in the UI key-value pair from each software interface design mapping information; randomly matching the key with the function supported by the automated testing framework, and executing the random matching to generate a statement for normal operation. Through the above scheme, during the testing process of the simulation test verification platform, there is no need to manually test the software defects in the simulation test verification platform, avoiding the introduction of subjective judgment due to personal preference or lack of experience, which affects the accuracy of the test. It is only necessary to simulate multiple random operations performed by users on the simulation test verification platform to obtain the configuration options corresponding to the support of multiple random operations, and through the number of times and configuration options of the normal operation of the simulation test verification platform after random matching, the automated testing of the simulation test verification platform is realized, and the testing efficiency and accuracy of the simulation test verification platform are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0056] Figure 1 A flowchart of an automated testing method for a simulation test verification platform disclosed in an embodiment of the present application;
[0057] Figure 2 A schematic diagram of a preset command prompt disclosed in an embodiment of the present application;
[0058] Figure 3A schematic diagram of randomly matching mapping information of various software interface designs disclosed in the embodiments of the present application with functions supported by the automated testing framework;
[0059] Figure 4 A schematic diagram of the process of running the automatic test program disclosed in the embodiment of the present application;
[0060] Figure 5 A schematic diagram of code generated for the test report disclosed in the embodiment of the present application;
[0061] Figure 6 A schematic diagram of the structure of an automated testing device for a simulation test verification platform disclosed in an embodiment of the present application;
[0062] Figure 7 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0063] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0064] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0065] As can be seen from the background technology, the existing method of testing software bugs in GCAir is done manually. Since the efficiency of manual testing is relatively low, and when the testers review the code and conduct the test, some important bugs may be ignored due to negligence or misunderstanding, or subjective judgment may be introduced due to personal preference or lack of experience, affecting the accuracy of the test. Therefore, how to improve the efficiency and accuracy of the test in GCAir is a problem that needs to be solved urgently in this application.
[0066] In order to solve the above problems, the present application discloses an automated testing method and device for a simulation test verification platform. During the testing process of the simulation test verification platform, there is no need to manually test the software defects in the simulation test verification platform, so as to avoid introducing subjective judgments due to personal preferences or lack of experience, which affects the accuracy of the test. It is only necessary to simulate multiple random operations performed by users on the simulation test verification platform to obtain configuration options corresponding to multiple random operations. By checking the number of passes and configuration options of the simulation test verification platform for normal operation of each function after random matching, the automated testing of the simulation test verification platform is realized, thereby improving the testing efficiency and accuracy in the simulation test verification platform. The specific implementation method is specifically described through the following embodiments.
[0067] refer to Figure 1 As shown, an automated testing method for a simulation test verification platform disclosed in an embodiment of the present application is provided. The automated testing method for a simulation test verification platform mainly includes the following steps:
[0068] S101: Simulate multiple random operations performed by users on GCAir; random operations include clicking buttons, dragging models, and inputting data.
[0069] Random operations include clicking buttons, dragging models, entering data, and so on.
[0070] Simulate users to send pseudo-random user event streams on GCAir, i.e. random operations such as keystrokes, touch screen, input, etc., to determine whether the application will be abnormal, accompanied by log output. This solution can perform some stress tests, stability tests, etc. on the program. It is an indispensable part of application (Application, App) automated testing. GCAir software under the cross-platform application development framework (QT framework) can also perform this test, which can not only find some extremely difficult to find bugs, but also greatly improve the stability and reliability of GCAir products.
[0071] By automating the simulation of multiple random operations that users will perform on GCAir, such as clicking buttons, dragging models, entering data, etc., and by configuring parameters such as GCAir path, number of operations, and interval time, the automation of GCAir random operations is achieved.
[0072] GCAir supports multi-source heterogeneous model integration and one-click switching from full virtual simulation to semi-physical simulation. It can complete model-in-the-loop, software-in-the-loop, and hardware-in-the-loop simulation and testing on the same platform. It has the ability of continuous comprehensive integrated testing and verification, and can be applied to the entire life cycle of complex equipment from design and development to operation and maintenance.
[0073] S102: Obtain configuration options corresponding to multiple random operations supported on GCAir through a preset command prompt.
[0074] Among them, the default command prompt is the randomsquish-help command.
[0075] Configuration options are as follows Figure 2 shown.
[0076] Open the command prompt window and enter the randomsquish –help command to get all supported configuration options. The specific configuration options are as follows:
[0077] 1) -gcair YOUR_PATH:
[0078] Specify GCAir. After executing the command, randomsquish will operate on GCAir.
[0079] Example: randomsquish -gcair “C:\GC\GCAir9.0\GCAir.exe”.
[0080] 2) -r YOUR_PATH:
[0081] The whole process will be recorded, and the video file will be generated to the specified path;
[0082] Example: randomsquish -r “C:\my_randomsquish\record”.
[0083] 3) -s SEED_VALUE:
[0084] Specify a seed value. If the same seed value is used, the event operation will be repeated.
[0085] Example: randomsquish -s 111.
[0086] 4) -ic:
[0087] Ignore crash exceptions and restart the program to continue running if the set number of times has not been reached;
[0088] Example: randomsquish –ic.
[0089] 5)-it:
[0090] Ignore the time delay, if it exceeds the time, continue to the next item;
[0091] Example: randomsquish –it.
[0092] 6) -k:
[0093] Ends the process after an error occurs.
[0094] Example: randomsquish –k.
[0095] 7) -t TIME_INTERVAL:
[0096] Set the interval time between each event (ms);
[0097] Example: randomsquish -t 300.
[0098] 8) -l YOUR_PATH:
[0099] Generate test results to the specified path;
[0100] Example: randomsquish -l “C:\my_randomsquish\log”.
[0101] 9) -e COUNT:
[0102] Set the total number of operations for the event;
[0103] Example: randomsquish -e 30.
[0104] 10) -n YOUR _PATH:
[0105] The storage path of the mapping relationship names.py;
[0106] Example: randomsquish -n “C:\squish\workspace\GCAir_case\tst_ID1002390_UI display bug\names.py”.
[0107] 11) -ide YOUR_PATH:
[0108] The storage path of Squish ide;
[0109] Example: randomsquish -ide “C:\squish\squish.exe”.
[0110] 12) -st SET_TIME:
[0111] Set the time for automatic startup every day. The number before the comma represents the hour, and the number after the comma represents the minute.
[0112] Example: randomsquish -st 7,30.
[0113] S103: while running the test program for the simulation test verification platform, obtaining mapping information of various software interface designs (UIs) of GCAir; the software interface design mapping information includes UI information and its hierarchical information.
[0114] In S103 , in running the test program for the simulation test verification platform, the integrated development environment (Squish IDE) process of the automated test is started, and through the Squish IDE process of the automated test, the source code file (Python file) is called to obtain various UI mapping information of GCAir.
[0115] When running the test program for the simulation test verification platform, execute the command: randomsquish -gcair "C:\GC\GCAir9.0\GCAir.exe" -ide "C:\squish\squish.exe" -e 30, then GCAir will be started and random operations will be performed 30 times (x). If any operation such as clicking or double-clicking on a control can be performed normally, then n+1, when n>=30, the operation ends. Among them, n is the number of passes.
[0116] The UI mapping information includes UI information and its level information.
[0117] S104: Randomly match each UI mapping information with the functions supported by the automated testing framework (Squish).
[0118] In S104, the key in the UI key-value pair is obtained from each software interface design mapping information, the key is randomly matched with the function supported by the automated testing framework, and the random matching is executed to generate a statement for normal operation.
[0119] Among them, Squish can reduce the complexity of graphical user interface (GUI) and human-machine interface (HMI) testing.
[0120] It should be noted that since Squish itself can obtain the various UI mapping information of GCAir under the QT framework, and the various UI mapping information is stored in names.py, this python file can be called to obtain its various UI mapping information, and the various UI mapping information can be randomly matched with the functions supported by Squish according to the function functions supported by Squish.
[0121] In the process of randomly matching each UI mapping information with the functions supported by Squish, when it is detected that the functions supported by Squish indicate input of numbers, random numbers are used for addition.
[0122] The specific process of randomly matching each UI mapping information with the functions supported by Squish is as follows: Figure 3 shown.
[0123] Figure 3 In the process, the squish ide process is started in the background, and the GCAir UI mapping information (UI information and its hierarchy information) in the names.py file is read. Each UI mapping information is randomly matched with some functions supported by squish. When a number needs to be entered in the function, a random number is used to add it.
[0124] Among them, the names.py file is used to store key-value pair information of hierarchical relationships.
[0125] Figure 3 In the example, Randomx and Randomy are random numbers. Because some statements in squish require (x, y) spatial positions, their relative positions need to be given, and some numerical input controls also require random numbers for input.
[0126] Figure 3 The meaning is that the key in some UI key-value pairs obtained in names is randomly matched with the functions supported by squish itself, and finally the last statement of the combination of the two is executed. If it passes, then n+1. For example, the key in some UI key-value pairs obtained in names is randomly matched with the functions supported by squish itself, and the statement can be operated normally, that is, no exception occurs, which means it passes, that is, n+1.
[0127] S105: Obtain the number of times each function after random matching normally operates GCAir.
[0128] If some useless input is still generated even if the hierarchical relationship and the UI controls on the current page are obtained, use the try except statement to skip the useless input, and only when the input operation is successfully performed will it be considered a valid operation.
[0129] Among them, in the initial interface of GCAir, the modules in the template library on the right can be clicked (although the effect is invalid, normal user operations can be clicked, so it is considered a valid operation), but numbers cannot be entered. If the two are combined and an operation of entering numbers appears in this module, the except logic will skip this impossible operation.
[0130] Each execution record will save its seed value and all valid operations as key-value pairs to a json file in the randomsquish library. If the command contains -s, check whether there is a corresponding seed value in the json. If so, repeat the steps in the value; if not, record the subsequent steps with the seed.
[0131] The try block contains code that may raise an exception. When the program executes to the try block, Python will try to execute this part of the code.
[0132] If an exception occurs during the execution of the code in the try block, Python will jump to the except block that matches the exception type and execute the code in it. The except block is used to handle specific types of exceptions, or the general Exception class can be used to catch all types of exceptions.
[0133] When the randomly matched functions operate GCAir normally, each valid operation record is obtained.
[0134] Associate each valid operation record with a seed value and store them in a local file. The seed value is used for reproducible positioning.
[0135] When executing the test command, if the seed value read is the same as the seed value in the local file, it returns to execute the step of obtaining each valid operation record when each function after random matching operates GCAir normally;
[0136] If the seed value read is different from the seed value in the local file, a new seed value is created and all subsequent operations are recorded.
[0137] The same newly created seed value pairs are reproduced, and different newly created seed value pairs record the steps for later reproduction. A new key-value pair is created, with different seed values as keys and the set of all operation steps as values.
[0138] S106: If the number of passes meets the preset condition, a test report is generated to complete the automated test of GCAir; wherein the preset condition is determined based on the total number of operations of the event specified in the configuration option.
[0139] It should be noted that the preset condition is determined based on the total number of operations of the event specified in the -e COUNT configuration option.
[0140] If the number of passes meets the preset conditions, a test report is generated to complete the process of automated testing of GCAir. Figure 4 shown.
[0141] Figure 4 In the configuration option -e COUNT, the total number of operations (total number of operations) of the specified event is x, and n=0, where n is the number of passes;
[0142] Randomly match each UI mapping information with the functions supported by Squish;
[0143] Get the number of times each function after random matching can be used to operate GCAir normally;
[0144] If the number of times GCAir passes each function normally is greater than or equal to the total number of operations of the event set in the configuration options, the operation is terminated and a test report is generated;
[0145] If the number of GCAir passes for normal operation of each function is less than the total number of events set in the configuration options, return to the step of randomly matching each UI mapping information with the functions supported by Squish until the number of passes meets the preset conditions, and generate a test report to complete the automated test of GCAir;
[0146] If the randomly matched functions cannot operate GCAir normally, return to the step of randomly matching the UI mapping information with the functions supported by Squish.
[0147] After the test report is generated, you can view it through the query command.
[0148] The specific process of viewing the test report through the preset query command is as follows: B1-B4 and Figure 5 shown. Figure 5 Schematic diagram of the code generated for the test report.
[0149] B1: When it is detected that the query command is a full-process recording command (-r YOUR_PATH), the start screen capture (startscreencapture) function is executed at the beginning of the automated test code running, and the stop screen capture (stopscreencapture) function is executed at the end of the automated test code to complete the full-process recording of the automated test.
[0150] B2: When it is detected that the query command is a test generation command (-l YOUR_PATH), the information of the automated test process is recorded in the log file.
[0151] The information in the automated testing process includes whether the operation passed, description of the operation content, pass rate, failure rate, etc.
[0152] The advantages of this application are as follows:
[0153] (1) It can solve hidden bugs in GCAir that are difficult to find by humans, thereby enhancing the stability and reliability of the software;
[0154] (2) You can configure options and write command statements as needed; for example, randomsquish -gcair “C:\GC\GCAir9.0\GCAir.exe” -ide “C:\squish\squish.exe” -e 30;
[0155] (3) View the test report and read the information or video recorded in the log file during the automated test;
[0156] (4) The seed value makes it easier for users to reproduce and locate the problem. For example, if you execute the statement randomsquish -gcair "C:\GC\GCAir9.0\GCAir.exe" -ide "C:\squish\squish.exe" -s 111, the entire process of recording the seed value as 111 will be reproduced.
[0157] The beneficial effects of the embodiments of the present application are as follows: during the testing process of the simulation test verification platform, there is no need to manually test the software defects in the simulation test verification platform, avoiding the introduction of subjective judgment due to personal preference or lack of experience, which affects the accuracy of the test. It is only necessary to simulate multiple random operations performed by the user on the simulation test verification platform to obtain the configuration options corresponding to the multiple random operations, and to realize the automated testing of the simulation test verification platform by checking the number of times and configuration options of the normal operation of each function after random matching, thereby improving the test efficiency and accuracy in the simulation test verification platform.
[0158] Based on the above embodiments Figure 1 An automated testing method for a simulation test verification platform is disclosed. The present application embodiment also discloses an automated testing device for a simulation test verification platform. Figure 6 As shown, the automated testing device for the simulation test verification platform includes:
[0159] The simulation unit 601 is used to simulate multiple random operations performed by the user on the simulation test verification platform; the random operations include clicking a button, dragging a model, and inputting data;
[0160] A first acquisition unit 602 is used to obtain configuration options corresponding to supporting multiple random operations through a preset command prompt;
[0161] The second acquisition unit 603 is used to acquire the software interface design mapping information of the simulation test verification platform when running the test program for the simulation test verification platform; the software interface design mapping information includes UI information and its level information;
[0162] A random matching unit 604 is used to randomly match each software interface design mapping information with the functions supported by the automated testing framework;
[0163] The third acquisition unit 605 is used to obtain the number of times each function passes the normal operation simulation test verification platform after random matching;
[0164] A generating unit 606 is used to generate a test report if the number of passes meets a preset condition, so as to complete the automated test of the simulation test verification platform; wherein the preset condition is determined based on the total number of operations of the event specified in the configuration option;
[0165] The random matching unit is specifically used to obtain the key in the UI key-value pair from the mapping information of each software interface design; randomly match the key with the function supported by the automated testing framework, and execute the random matching to generate a statement for normal operation.
[0166] Further, the second acquisition unit 603 includes:
[0167] A startup module, used to start the integrated development environment process of the automated test while running the test program for the simulation test verification platform;
[0168] The calling acquisition module is used to call the source code file to obtain the design mapping information of each software interface of the simulation test verification platform through the integrated development environment process of the automated test.
[0169] Further, the generating unit 606 includes:
[0170] The first acquisition module is used to acquire the total number of operations of the event set in the configuration option;
[0171] A first determination module, configured to determine that the number of passes meets a preset condition if the number of passes is greater than or equal to the total number of operations;
[0172] The generation module is used to generate a test report when the number of passes meets the preset conditions to complete the automated testing of the simulation test verification platform.
[0173] Furthermore, the automated testing device for the simulation test verification platform also includes:
[0174] A determination unit, configured to determine that the number of passes does not satisfy a preset condition if the number of passes is less than the total number of operations;
[0175] The first return execution unit is used to return to the step of randomly matching the mapping information of each software interface design with the functions supported by the automated testing framework if the number of pass times does not meet the preset conditions, until the number of pass times meets the preset conditions, and generate a test report to complete the automated testing of the simulation test verification platform.
[0176] Furthermore, the automated testing device for the simulation test verification platform also includes:
[0177] The application unit is used to add random numbers when it detects that the functions supported by the automated testing framework indicate input numbers during the process of randomly matching the design mapping information of various software interfaces with the functions supported by the automated testing framework.
[0178] Furthermore, the automated testing device for the simulation test verification platform also includes:
[0179] A fourth acquisition unit is used to obtain each valid operation record when each function after random matching operates normally on the simulation test verification platform;
[0180] An associated storage unit is used to associate each valid operation record with a seed value and store it in a local file; wherein the seed value is used for recurrence positioning;
[0181] The second return execution unit is used for returning to the step of obtaining each valid operation record when each function after random matching operates normally on the simulation test verification platform if the seed value read is the same as the seed value in the local file when executing the test command;
[0182] A new recording unit is created to create a new seed value if the read seed value is different from the seed value in the local file, and to record all subsequent operations.
[0183] Furthermore, the automated testing device for the simulation test verification platform also includes:
[0184] A storage unit, used for storing the test report through a storage command;
[0185] The storage unit includes:
[0186] An execution module, for executing a start screen capture function at the start time of the automated test code running when the storage command is a full-process recording command, and executing a stop screen capture function at the end of the automated test code, to generate a video file of the full-process recording of the automated test, and to store the video file;
[0187] The recording module is used to record the information of the automated test process in a log file when the storage command is a test generation command, generate a file corresponding to the test report, and store the file corresponding to the test report.
[0188] The beneficial effects of the embodiments of the present application are as follows: during the testing process of the simulation test verification platform, there is no need to manually test the software defects in the simulation test verification platform, avoiding the introduction of subjective judgment due to personal preference or lack of experience, which affects the accuracy of the test. It is only necessary to simulate multiple random operations performed by the user on the simulation test verification platform to obtain the configuration options corresponding to the multiple random operations, and to realize the automated testing of the simulation test verification platform by checking the number of times and configuration options of the normal operation of each function after random matching, thereby improving the test efficiency and accuracy in the simulation test verification platform.
[0189] An embodiment of the present application further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned automated testing method for the simulation test verification platform.
[0190] The present application also provides an electronic device, whose structural diagram is as follows: Figure 7 As shown, it specifically includes a memory 701 and one or more instructions 702, wherein the one or more instructions 702 are stored in the memory 701 and are configured to be executed by one or more processors 703 to execute the one or more instructions 702 to perform the above-mentioned automated testing method for the simulation test verification platform.
[0191] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0192] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0193] The steps in the methods of the embodiments of the present application can be adjusted in order, combined, and deleted according to actual needs.
[0194] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.
[0195] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
[0196] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. An automated testing method for a simulation test verification platform, characterized in that: The method comprises: Simulate multiple random operations performed by the user on the simulation test verification platform; the random operations include clicking buttons, dragging models, and inputting data; Through the preset command prompt, get the configuration options corresponding to supporting multiple random operations; In running a test program for a simulation test verification platform, obtaining each software interface design mapping information of the simulation test verification platform; the software interface design mapping information includes UI information and its level information; Randomly match the design mapping information of each software interface with the functions supported by the automated testing framework; Obtain the number of times each function passes the normal operation simulation test verification platform after random matching; If the number of passes meets the preset conditions, a test report is generated to complete the automated test of the simulation test verification platform; wherein the preset conditions are determined based on the total number of operations of the event specified in the configuration options; The random matching of the software interface design mapping information with the functions supported by the automated testing framework includes: Get the key in the UI key-value pair from each software interface design mapping information; The key is randomly matched with the functions supported by the automated testing framework, and the random match is executed to generate a statement for normal operation.
2. The method according to claim 1, characterized in that The step of obtaining the design mapping information of each software interface of the simulation test verification platform during the running of the test program for the simulation test verification platform includes: In running the test program for the simulation test verification platform, starting the integrated development environment process of the automated test; Through the integrated development environment process of the automated test, the source code file is called to obtain the design mapping information of each software interface of the simulation test verification platform.
3. The method according to claim 1, characterized in that If the number of passes meets the preset conditions, a test report is generated to complete the automated testing of the simulation test verification platform, including: Get the total number of operations of the events set in the configuration options; If the number of passes is greater than or equal to the total number of operations, determining that the number of passes meets a preset condition; When the number of passes meets the preset conditions, a test report is generated to complete the automated testing of the simulation test verification platform.
4. The method according to claim 3, characterized in that Also includes: If the number of passes is less than the total number of operations, determining that the number of passes does not meet a preset condition; If the number of pass times does not meet the preset conditions, return to the step of randomly matching the software interface design mapping information with the functions supported by the automated testing framework until the number of pass times meets the preset conditions, and generate a test report to complete the automated testing of the simulation test verification platform.
5. The method according to claim 1, characterized in that Also includes: In the process of randomly matching the mapping information of each software interface design with the functions supported by the automated testing framework, when it is detected that the functions supported by the automated testing framework indicate the input of numbers, random numbers are used for addition.
6. The method according to claim 1, characterized in that Also includes: When the randomly matched functions operate normally on the simulation test verification platform, each valid operation record is obtained; Associating each valid operation record with a seed value and storing the result in a local file; wherein the seed value is used for reproducing the location; When executing the test command, if the seed value read is the same as the seed value in the local file, then return to execute the step of obtaining each valid operation record when each function after random matching operates normally on the simulation test verification platform; If the read seed value is different from the seed value in the local file, a new seed value is created and all subsequent operations are recorded.
7. The method according to claim 1, characterized in that Also includes: Store the test report via the store command; The storing of the test report by the storage command comprises: When the storage command is a full-process recording command, a start screen capture function is executed at the start time of the automated test code running, and a stop screen capture function is executed at the end of the automated test code, a video file of the full-process recording of the automated test is generated, and the video file is stored; When the storage command is a test generation command, information during the automated test is recorded in a log file, a file corresponding to the test report is generated, and the file corresponding to the test report is stored.
8. An automated testing device for a simulation test verification platform, characterized in that: The device comprises: A simulation unit, used to simulate multiple random operations performed by a user on the simulation test verification platform; the random operations include clicking a button, dragging a model, and inputting data; A first acquisition unit is used to obtain configuration options corresponding to supporting multiple random operations through a preset command prompt; The second acquisition unit is used to acquire the design mapping information of each software interface of the simulation test verification platform when running the test program for the simulation test verification platform; the software interface design mapping information includes UI information and its level information; A random matching unit is used to randomly match the mapping information of each software interface design with the functions supported by the automated testing framework; The third acquisition unit is used to obtain the number of times each function passes the normal operation simulation test verification platform after random matching; A generating unit, configured to generate a test report if the number of passes meets a preset condition, so as to complete the automated test of the simulation test verification platform; wherein the preset condition is determined based on the total number of operations of the event specified in the configuration option; The random matching unit is specifically used to obtain the key in the UI key-value pair from each software interface design mapping information; randomly match the key with the function supported by the automated testing framework, and execute the random matching to generate a statement for normal operation.
9. The device according to claim 8, characterized in that The second acquisition unit includes: A startup module, used to start the integrated development environment process of the automated test while running the test program for the simulation test verification platform; The calling acquisition module is used to call the source code file to acquire the design mapping information of each software interface of the simulation test verification platform through the integrated development environment process of the automated test.
10. The device according to claim 8, characterized in that The generating unit comprises: The first acquisition module is used to acquire the total number of operations of the event set in the configuration option; A first determination module, configured to determine that the number of passes satisfies a preset condition if the number of passes is greater than or equal to the total number of operations; The generation module is used to generate a test report when the number of passes meets a preset condition, so as to complete the automated test of the simulation test verification platform.
Citation Information
Patent Citations
Application test method and apparatus
CN107704396A
Configurable automatic test method and system based on embedded simulation verification software
CN112084113A