Data testing method and device, medium and equipment
By constructing the graph structure data of the test task and determining the test priority, the problem of poor order of test tasks in the existing technology is solved, and the testing efficiency is improved.
Patent Information
- Application Number
- CN202510176436.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-17
- Publication Date
- 2025-06-13
AI Technical Summary
During software development and testing, the execution order of test tasks has a great impact on testing efficiency. It is difficult for the existing technology to reasonably determine the test order of test tasks, resulting in an increase in the number of tests and a decrease in efficiency.
By receiving different test tasks belonging to the same test project, construct the graph structure data of the test task, determine the test priority of the test task based on the graph structure data, and perform the test operations in priority order.
The test sequence of test tasks is achieved reasonably determined, the number of tests is reduced, and the overall testing efficiency of the software is improved.
Smart Images

Figure CN120144442A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automated testing technologies, and particularly to the field of data testing technologies. Specifically, it relates to a data testing method, device, medium, and equipment. Background Art
[0002] During the software development and testing process, the execution order of test tasks has a significant impact on test efficiency. Suppose there are four different test tasks, namely Task One, Task Two, Task Three, and Task Four. Each test task requires test operations through different combinations of code repositories:
[0003] Task One requires one code repository (denoted as A) for test operations; Task Two requires two code repositories (denoted as AB) for test operations; Task Three requires three code repositories (denoted as ABC) for test operations; Task Four requires four code repositories (denoted as ABCD) for test operations.
[0004] In the above-listed scenario, assume that Task One is executed first, and a test code A1 in code repository A is modified. Then, when performing the test for Task Two, another code A2 in repository A is also modified. Generally, Task Two will perform two test operations during the test, forming two test combinations: A1B and A2B. Next, when performing the test for Task Three, another code A3 in code repository A is modified, and Task Three will form three test combinations during the test: A1BC, A2BC, and A3BC. Finally, when performing the test for Task Four, another code A4 in code repository A is modified, and four test combinations will be formed during the test: A1BCD, A2BCD, A3BCD, and A4BCD.
[0005] If the test operations are performed on the four different test tasks in the above test order, it can be concluded that the total number of tests is ten times. However, if the test operation for Task Four (A1BCD) is completed first at the beginning, and then the tests for Task Three (A2BC), Task Two (A3B), and Task One (A4) are performed in sequence, the actual number of tests can be reduced to four times. This phenomenon indicates that a reasonable test order is crucial in the software testing process. Therefore, how to reasonably determine the test order of test tasks has become a technical problem that urgently needs to be solved. Summary of the Invention
[0006] Embodiments of this application provide a data testing method, device, medium, and equipment. By using the data testing method provided by the embodiments of this application, the test order of test tasks can be reasonably determined, thereby improving the overall test efficiency of the software.
[0007] On the one hand, embodiments of this application provide a data testing method, and the method includes:
[0008] Receive different test tasks belonging to the same test project, where the test tasks carry a description file, and the description file contains storage information for indicating test codes required for testing the test tasks;
[0009] Construct graph structure data for each of the test tasks according to the storage information, where the graph structure data is used to describe the correspondence between the test tasks and their corresponding storage information;
[0010] Determine the test priorities of each of the test tasks according to the graph structure data;
[0011] Perform test operations on each of the test tasks in the order of the test priorities.
[0012] Correspondingly, another aspect of the embodiments of the present application further provides a data testing device, where the data testing device includes:
[0013] A task receiving module, configured to receive different test tasks belonging to the same test project, where the test tasks carry a description file, and the description file contains storage information for indicating test codes required for testing the test tasks;
[0014] A graph construction module, configured to construct graph structure data for each of the test tasks according to the storage information, where the graph structure data is used to describe the correspondence between the test tasks and their corresponding storage information;
[0015] A priority determination module, configured to determine the test priorities of each of the test tasks according to the graph structure data;
[0016] A data testing module, configured to perform test operations on each of the test tasks in the order of the test priorities.
[0017] Correspondingly, another aspect of the embodiments of the present application further provides a computer storage medium, where the computer storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the data testing method as described above.
[0018] Correspondingly, another aspect of the embodiments of the present application further provides an electronic device, including a processor and a memory, where the memory stores multiple instructions, and the processor loads the instructions to execute the data testing method as described above.
[0019] The embodiments of the present application provide a data testing method, apparatus, medium and device. The method receives different test tasks belonging to the same test project. The test tasks carry a description file, and the description file contains storage information for indicating the storage of test codes required for testing the test tasks. Construct the graph structure data of each test task according to the storage information, and the graph structure data is used to describe the correspondence between the test task and its corresponding storage information. Determine the test priorities of each test task according to the graph structure data. Perform test operations on each test task in the order of the test priorities. Using the data testing method provided by the embodiments of the present application, construct the graph structure data of each test task through the storage information carried in the test tasks, and utilize the characteristic of the graph structure data that is convenient for extracting key information to more quickly and reasonably determine the test priorities of each test task, so that the data testing work can be carried out according to the set test priorities, achieving the purpose of reducing the number of tests to improve the data testing efficiency. Description of the Drawings
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0021] Figure 1 It is a schematic flowchart of the data testing method provided by the embodiments of the present application.
[0022] Figure 2 It is another schematic flowchart of the data testing method provided by the embodiments of the present application.
[0023] Figure 3 It is a schematic structural diagram of the data testing apparatus provided by the embodiments of the present application.
[0024] Figure 4 It is another schematic structural diagram of the data testing apparatus provided by the embodiments of the present application.
[0025] Figure 5 It is a schematic structural diagram of the electronic device provided by the embodiments of the present application. Detailed Embodiments
[0026] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the protection scope of the present application.
[0027] An embodiment of the present application provides a data testing method. By constructing the graph structure data of each test task through the storage information carried in the test task, and utilizing the characteristic that the graph structure data is convenient for extracting key information, the test priorities of each test task can be determined more quickly and reasonably, enabling the data testing work to be carried out according to the set test priorities, so as to reduce the number of tests and achieve the purpose of improving the data testing efficiency.
[0028] The term "and / or" appearing in the present application can be an association relationship describing associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in the present application generally represents an "or" relationship between the preceding and following associated objects.
[0029] The terms "first", "second", etc. in the description and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or electronic device including a series of steps or modules does not necessarily have to be limited to those steps or modules clearly listed, but may include other steps or modules not clearly listed or inherent to these processes, methods, products, or electronic devices. The naming or numbering of steps in the present application does not mean that the steps in the method flow must be executed in the time / logical sequence indicated by the naming or numbering. The named or numbered process steps can be changed in the execution order according to the technical purpose to be achieved, as long as the same or similar technical effects can be achieved. The division of modules in the present application is a logical division, and there can be other division methods in actual implementation. For example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the shown or discussed coupling, direct coupling, or communication connection to each other can be through some interfaces. The indirect coupling or communication connection between modules can be electrical or other similar forms, which are not limited in the present application. And the modules or sub-modules described as separate components can be physically separated or not, can be physical modules or not, or can be distributed to multiple circuit modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the present application.
[0030] The data testing method provided by the embodiments of this application is mainly applied to electronic devices, which may be smartphones, tablet computers, laptop computers, desktop computers, servers, etc., and are not limited herein. Optionally, the server may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or an IoT cloud (Internet of Things cloud) that provides the ability to store, process, and manage data generated by Internet of Things electronic devices, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, and are not limited herein.
[0031] For ease of understanding, the specific process in the embodiments of this application will be described below. Please refer to Figure 1 , Figure 1 which is a schematic flowchart of an embodiment of the data testing method provided by the embodiments of this application.
[0032] In Figure 1 the embodiment shown, the method specifically includes the following steps:
[0033] S101, Receive different test tasks belonging to the same test project. The test tasks carry a description file, and the description file contains storage information for indicating the test code required for the test of the test task.
[0034] It should be explained that the test project refers to a system or software that needs to perform performance testing. Taking software as an example, the software can be either a brand-new software that has not been launched yet or an existing software after version update, and is not limited herein. Generally speaking, during the software development process, the same software needs to perform multiple test tasks to determine its performance. Among them, the test tasks can cover multiple aspects to ensure the quality, performance, and security of the software. The following are some common types of test tasks:
[0035] Unit Testing: The goal is to verify the correctness of the smallest testable unit in the software, usually a function or method, and ensure that each unit works as expected by simulating the input and verifying the output.
[0036] Integration Testing: The goal is to test the combination of multiple units or modules to ensure that they can work together and identify interface problems and data transfer errors between modules.
[0037] System Testing: The goal is to verify the functionality and performance of the entire software system to ensure that the system meets all functional and non-functional requirements.
[0038] Performance Testing: The goal is to evaluate the response time, throughput, and resource usage of the software under different load conditions, including load testing, stress testing, and capacity testing.
[0039] Security Testing: The goal is to identify security vulnerabilities and weaknesses in the software, including penetration testing, vulnerability scanning, and security audits.
[0040] User Interface Testing (UI Testing): The goal is to verify the functionality and usability of the user interface to ensure that interface elements work as expected and provide a good user experience.
[0041] It can be understood that the execution process of the test task is essentially the running process of the relevant test code. Therefore, in order to perform test operations on the test task, it is necessary to obtain the storage information of the test code required for the test task. In this embodiment, the storage information can be stored in the description file corresponding to the test task, so that the system can obtain the storage information of the test code required for the test of the test task when receiving the test task, and then run the test code to perform test operations on the test task.
[0042] It should be noted that different test codes may have different implementation methods according to their design purposes and test objectives. Taking the system test task as an example, by writing the system test code corresponding to the system test task in advance, and then using automated test tools (such as Selenium, Cypress) to simulate user operations and system behaviors, analyze whether the system meets the requirements in terms of functionality and performance according to the test results.
[0043] S102. Construct graph structure data for each of the test tasks according to the storage information, where the graph structure data is used to describe the correspondence between the test task and its corresponding storage information.
[0044] It should be explained that the graph structure provides a more flexible and powerful way to represent and operate on the relationship between the test task and the storage information. It can not only help the system better understand and manage the test process, but also support more complex analysis and optimization. Compared with other ways of describing test tasks such as arrays, using the graph structure to describe test tasks has the following advantages:
[0045] 1. Relationship Visualization: The graph-structured data can visually display the relationships between various test tasks and stored information. Each node represents a piece of stored information, and the edges represent the attribution relationships between test tasks and stored information. This visualization can help the system better understand the dependencies between test tasks and stored information.
[0046] 2. Dynamic Nature: The graph-structured data is dynamic, and nodes and edges can be easily added or deleted to reflect changes between test tasks and stored information. This is much more flexible than adding or deleting elements in an array.
[0047] 3. Complex Dependencies: The graph-structured data can represent complex dependencies, such as circular dependencies or multiple dependencies. This is difficult to represent in an array because arrays are usually linear structures.
[0048] 4. Query Efficiency: Graph structures usually provide efficient query languages, such as SPARQL, which can be used to query graph-structured data. This allows developers to quickly find all information related to a specific test task or stored information.
[0049] 5. Pattern Recognition: Graph-structured data can be used to identify and utilize patterns in the data. For example, through graph analysis, it can be found which test tasks frequently involve the same stored information, thereby optimizing the test process.
[0050] 6. Easy to Expand: As the project grows, more test tasks and stored information may be added to the graph-structured data. The graph-structured data can be easily expanded without affecting the existing data structure.
[0051] 7. Multi-dimensional Analysis: Graph-structured data can support multi-dimensional analysis. For example, the relationships between different test tasks can be analyzed, or the interactions between different stored information can be analyzed.
[0052] 8. Support for Reasoning: Graph-structured data can be used for reasoning. For example, based on the existing test results and the relationships between test tasks, potential problems of other test tasks can be inferred.
[0053] S103. Determine the test priorities of each of the test tasks according to the graph-structured data.
[0054] In this embodiment, using the graph-structured data can quickly determine the corresponding relationships between test tasks and their corresponding stored information. Especially when a test task involves multiple different stored information, using the graph-structured data can quickly determine the total number of stored information included in the test task, and then determine the test priorities of each test task based on the total number of stored information.
[0055] S104. Perform test operations on each of the test tasks in the order of the test priorities.
[0056] In this embodiment, the graph structure data of each test task is constructed through the stored information carried in the test task, and by utilizing the characteristic of the graph structure data that facilitates the extraction of key information, the test priorities of each test task can be determined more quickly and reasonably, enabling the data testing work to be carried out according to the set test priorities, so as to achieve the purpose of reducing the number of tests and improving the data testing efficiency.
[0057] In some embodiments, constructing the graph structure data of each test task according to the stored information, where the graph structure data is used to describe the correspondence between the test task and its corresponding stored information, includes:
[0058] Extract the code storage nodes included in the stored information;
[0059] Construct the graph structure data of each test task according to the code storage nodes, where the code storage nodes serve as the node data in the graph structure data.
[0060] In this embodiment, the point data used to construct the graph structure data is the code storage nodes included in the stored information, also known as the Code Repository. A code repository is a place for centralized storage and management of code, which allows developers to store, share, collaborate, and perform version control on the code stored therein. Code repositories are an important part of software development, especially in team collaboration and open-source projects.
[0061] In this embodiment, the graph structure data can be used to visually display the relationship between each test task and the storage nodes. Each node represents a storage node, and the edge represents the attribution relationship between the test task and the storage node. This visualization can help the system better understand the dependency relationship between the test tasks and the storage nodes.
[0062] In some embodiments, determining the test priorities of each test task according to the graph structure data includes:
[0063] Determine the number of nodes included in each graph structure data;
[0064] Divide the test priorities of each test task according to the magnitude of the number of nodes.
[0065] In this embodiment, the test priorities of each test task are divided according to the total number of stored information corresponding to the test task. The more the total number of stored information corresponding to the test task, the higher the corresponding test priority. For the specific reasons, reference can be made to the cases proposed in the background technology, which will not be elaborated here.
[0066] In some embodiments, as Figure 2 shown, before the step S103, the method further includes the following steps:
[0067] S201, input each of the guiding information into a pre-trained test case generation model for test case generation operation to obtain test cases corresponding to each of the test tasks;
[0068] The step S104 specifically includes:
[0069] S1041, perform automated test operations on each of the test tasks according to the test cases in the order of the test priorities.
[0070] In order to improve the test efficiency of test tasks and reduce the work of manually compiling test cases, in this embodiment, by inputting each guiding information into a pre-trained test case generation model for test case generation operation, test cases corresponding to each test task are obtained.
[0071] It should be noted that test cases are used to perform automated test operations on test tasks. Through AI or machine learning, test cases are generated based on guiding information to simulate more abnormal scenarios, including the installation of top applications on the user side and running under stress scenarios; high-frequency triggering of function test cases to check performance loss and system stability. The test case generation model can be implemented based on deep learning, such as conventional large models like recurrent neural network (RNN) or convolutional neural network (CNN). Since this solution does not make substantial improvements to existing large models, the specific training process is not elaborated here.
[0072] After obtaining the trained test case generation model, for example, if the guiding information input into the test case generation model is the voice control of the xx button, then the test case generation model will automatically generate test scenarios, such as operation instructions like continuous button switching, and then construct test cases according to the generated operation instructions.
[0073] In some embodiments, as Figure 2 shown, after the step S104, the method further includes the following steps:
[0074] S105, obtain the test result data corresponding to each of the test tasks;
[0075] S106, generate test reports corresponding to each of the test tasks according to the test result data.
[0076] In this embodiment, problems existing in the testing process can be discovered in a timely manner through the test report. And in some embodiments, it is possible to set that when the test report shows a test anomaly, the test tasks with anomalies are automatically retested. If the test results show anomalies exceeding a preset number of times (for example, 3 times), it indicates that the severity level of the problems existing in the testing process is very high and the number of regression tests is excessive, and it can be directly determined as a test failure. Combining with the Hera SDK (a mature monitoring system for the whole machine anomaly solution in the industry, providing the framework ability foundation for joint diagnosis), the test results are uploaded to the cloud server to generate a visual report of test data.
[0077] In some embodiments, the testing operation on each of the test tasks includes:
[0078] Classifying the test tasks according to a preset classification rule;
[0079] Performing the testing operation on the test tasks belonging to the same category using parallel thread synchronization.
[0080] In this embodiment, in order to improve the testing efficiency, the test tasks belonging to the same category can also be tested using parallel thread synchronization, for example, using multiple testing devices simultaneously.
[0081] In some embodiments, the classifying the test tasks according to a preset classification rule includes:
[0082] Grouping the test tasks in the graph structure data that contain the same storage node into one category.
[0083] In this embodiment, for example, if test task a and test task b both contain storage node a, storage node b, and storage node c, then test task a and test task b can be classified into the same test priority and then transmitted to two testing devices for simultaneous testing operations.
[0084] In some embodiments, after a test task passes the test, all the test codes in the storage node corresponding to the test task need to be merged into the main trunk line, also known as the baseline, of the test project before the test project (such as an application) can be truly put into use.
[0085] In some embodiments, when a test task passes the test, for the test codes that are in the same storage node but have no conflicts, they can be merged into the main trunk line of the test project after intelligent code refactoring.
[0086] It should be noted that if the same file in the same storage node is modified, there will be a conflict situation. A conflict means that two different test tasks modify the same code logic in the same storage node, resulting in a competition relationship. After one party merges into the main trunk line, it will cause the other party to be unable to merge into the main trunk line for use. Currently, the processing cycle of a storage node can reach up to one week at most, and each time a conflict is resolved, it is necessary to manually trigger the pre-compilation (code quality verification) system. For example, for ten test codes in the same storage node, only one can be manually merged each time, and the remaining nine need to trigger the pre-compilation manually again. The pre-compilation usually takes two or three hours to succeed. If a conflict occurs in the middle, it is necessary to modify the test code again and trigger the pre-compilation again. Moreover, generally, a test task involves multiple storage nodes, and it is necessary to resolve conflicts in all storage nodes before merging into the main trunk line of the test project, resulting in an increase in time cost. Therefore, in this embodiment, after intelligent code refactoring, it is merged into the main trunk line of the test project. Specifically, for the situation of modifying the same code logic in the same storage node, it can be completed through an online code modification tool (such as Repl.it). For the situation where it is impossible to modify simultaneously, the platform can automatically issue the command "uploadok!!" to trigger the pre-compilation operation, without the need to trigger one by one manually, thereby improving the test efficiency.
[0087] Any combination of the above all optional technical solutions can form an optional embodiment of the present application, which will not be elaborated one by one here.
[0088] During specific implementation, the present application is not limited by the execution order of the described steps. Without conflict, some steps can also be performed in other orders or simultaneously.
[0089] As can be seen from the above, the data testing method provided by the embodiment of the present application receives different test tasks belonging to the same test project, and the test tasks carry a description file, and the description file contains storage information for indicating the test code required for the test of the test task; constructs graph structure data of each test task according to the storage information, and the graph structure data is used to describe the correspondence between the test task and its corresponding storage information; determines the test priority of each test task according to the graph structure data; and performs test operations on each test task in the order of the test priority. By using the data testing method provided by the embodiment of the present application, the graph structure data of each test task is constructed through the storage information carried in the test task, and the characteristics of the graph structure data that are convenient for extracting key information can be used to more quickly and reasonably determine the test priority of each test task, so that the data testing work can be carried out according to the set test priority, achieving the purpose of reducing the number of tests to improve the data testing efficiency.
[0090] An embodiment of the present application further provides a data testing device, which can be integrated in an electronic device.
[0091] Please refer to Figure 3 , Figure 3 , which is a schematic structural diagram of the data testing device provided by the embodiment of the present application. The data testing device 30 may include:
[0092] A task receiving module 31, configured to receive different test tasks belonging to the same test project, where a description file is carried in the test task, and the description file includes storage information for indicating the storage of test codes required for the test task;
[0093] A graph construction module 32, configured to construct graph structure data of each test task according to the storage information, where the graph structure data is used to describe the correspondence between the test task and its corresponding storage information;
[0094] A priority determination module 33, configured to determine the test priority of each test task according to the graph structure data;
[0095] A data testing module 34, configured to perform test operations on each test task in the order of the test priority.
[0096] In some embodiments, the graph construction module 32 is configured to extract the code storage nodes included in the storage information; construct the graph structure data of each test task according to the code storage nodes, where the code storage nodes are used as node data in the graph structure data.
[0097] In some embodiments, the priority determination module 33 is configured to determine the number of nodes included in each graph structure data; divide the test priority of each test task according to the magnitude of the number of nodes.
[0098] In some embodiments, the device further includes a test case generation module, configured to input each piece of guiding information into a pre-trained test case generation model for test case generation operations to obtain test cases corresponding to each test task; the data testing module 34 is configured to perform automated test operations on each test task according to the test cases in the order of the test priority.
[0099] In some embodiments, the device further includes a report generation module, configured to obtain test result data corresponding to each test task; generate a test report corresponding to each test task according to the test result data.
[0100] In some embodiments, the data testing module 34 is configured to classify the test tasks according to a preset classification rule; and perform test operations on the test tasks belonging to the same class in parallel thread synchronization.
[0101] In some embodiments, the data testing module 34 is configured to classify the test tasks in the atlas structure data that contain the same storage node into one class.
[0102] In specific implementation, each of the above modules may be implemented as an independent entity, or may be combined arbitrarily to be implemented as the same or several entities.
[0103] As can be seen from the above, for the data testing device 30 provided in the embodiments of the present application, the task receiving module 31 is configured to receive different test tasks belonging to the same test project, and the test tasks carry a description file, and the description file contains storage information for indicating the test code required for testing the test tasks; the atlas construction module 32 is configured to construct the atlas structure data of each test task according to the storage information, and the atlas structure data is used to describe the correspondence between the test task and its corresponding storage information; the priority determination module 33 is configured to determine the test priority of each test task according to the atlas structure data; and the data testing module 34 is configured to perform test operations on each test task in the order of the test priorities. The data testing device 30 provided in the embodiments of the present application can construct the atlas structure data of each test task through the storage information carried in the test tasks, and utilize the characteristic that the atlas structure data is convenient for extracting key information to more quickly and reasonably determine the test priorities of each test task, so that the data testing work can be carried out according to the set test priorities, achieving the purpose of reducing the number of tests and improving the data testing efficiency.
[0104] The embodiments of the present application further provide a data testing device, and the data testing device may be integrated in an electronic device.
[0105] In specific implementation, each of the above modules may be implemented as an independent entity, or may be combined arbitrarily to be implemented as the same or several entities.
[0106] Please refer to Figure 4 , Figure 4Another structural schematic diagram of the data testing device provided by the embodiment of the present application. The data testing device 30 includes a memory 120, one or more processors 180, and one or more application programs. The one or more application programs are stored in the memory 120 and configured to be executed by the processor 180. The processor 180 may include a task receiving module 31, a graph construction module 32, a priority determination module 33, and a data testing module 34. For example, the structures and connection relationships of the above components may be as follows:
[0107] The memory 120 can be used to store application programs and data. The application programs stored in the memory 120 contain executable codes. The application programs can form various functional modules. The processor 180 executes various functional applications and data processing by running the application programs stored in the memory 120. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 120 may also include a memory controller to provide the processor 180 with access to the memory 120.
[0108] The processor 180 is the control center of the device, connecting various parts of the entire terminal using various interfaces and lines. By running or executing the application programs stored in the memory 120, and calling the data stored in the memory 120, it executes various functions of the device and processes data, thereby performing overall monitoring of the device. Optionally, the processor 180 may include one or more processing cores; preferably, the processor 180 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, and application programs, etc.
[0109] Specifically in this embodiment, the processor 180 will, according to the following instructions, load the executable codes corresponding to the processes of one or more application programs into the memory 120, and the processor 180 will run the application programs stored in the memory 120 to implement various functions:
[0110] A task receiving instruction, used to receive different test tasks belonging to the same test project. The test tasks carry a description file, and the description file contains storage information for indicating the test codes required for testing the test tasks;
[0111] A graph construction instruction, used to construct graph structure data of each test task according to the storage information. The graph structure data is used to describe the correspondence between the test task and its corresponding storage information;
[0112] A priority determination instruction, used to determine the test priorities of each test task according to the graph structure data;
[0113] A data test instruction for performing test operations on each of the test tasks in the order of the test priorities.
[0114] In some embodiments, the graph construction instruction is used to extract the code storage nodes included in the stored information; and construct graph structure data for each of the test tasks according to the code storage nodes, where the code storage nodes serve as node data in the graph structure data.
[0115] In some embodiments, the priority determination instruction is used to determine the number of nodes included in each of the graph structure data; and divide the test priorities of each of the test tasks according to the magnitudes of the number of nodes.
[0116] In some embodiments, the program further includes a test case generation instruction for inputting each of the guiding information into a pre-trained test case generation model to perform test case generation operations, obtaining test cases corresponding to each of the test tasks; and the data test instruction for performing automated test operations on each of the test tasks according to the test priorities in the order of the test priorities and according to the test cases.
[0117] In some embodiments, the program further includes a report generation instruction for obtaining test result data corresponding to each of the test tasks; and generating a test report corresponding to each of the test tasks according to the test result data.
[0118] In some embodiments, the data test instruction is used to classify the test tasks according to a preset classification rule; and perform test operations on the test tasks belonging to the same class by using parallel thread synchronization.
[0119] In some embodiments, the data test instruction is used to classify the test tasks including the same storage nodes in the graph structure data into one class.
[0120] An embodiment of the present application further provides an electronic device. Please refer to Figure 5 , Figure 5 shows a schematic structural diagram of the electronic device provided by the embodiment of the present application. The electronic device 1200 can be used to implement the data test method provided in the above embodiments. The electronic device 1200 can be a computer.
[0121] As Figure 5As shown, the electronic device 1200 may include an RF (Radio Frequency) circuit 110, a memory 120 including one or more (only one is shown in the figure) computer-readable storage media, an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a transmission module 170, a processor 180 including one or more (only one is shown in the figure) processing cores, a power supply 190, and other components. Those skilled in the art can understand that Figure 5 the structure of the electronic device 1200 shown in does not limit the electronic device 1200, and it may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements. Among them:
[0122] The RF circuit 110 is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, so as to communicate with a communication network or other electronic devices. The RF circuit 110 may include various existing circuit elements for performing these functions. For example, antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, user identity module (SIM) cards, memories, and so on. The RF circuit 110 can communicate with various networks such as the Internet, enterprise intranets, wireless networks, or communicate with other electronic devices through a wireless network.
[0123] The memory 120 can be used to store software programs and modules, such as the program instructions / modules corresponding to the data testing method in the above embodiments. The processor 180 executes various functional applications and data processing by running the software programs and modules stored in the memory 120. It can automatically select a vibration reminder mode for data testing according to the current scenario where the electronic device is located, which can not only ensure that the meeting and other scenarios are not disturbed, but also ensure that the user can perceive incoming calls, improving the intelligence of the electronic device. The memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 120 may further include a memory remotely set relative to the processor 180, and these remote memories can be connected to the electronic device 1200 through a network. Examples of the above networks include, but are not limited to, the Internet, enterprise intranets, local area networks, mobile communication networks, and their combinations.
[0124] The input unit 130 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls. Specifically, the input unit 130 can include a touch-sensitive surface 131 and other input electronic devices 132. The touch-sensitive surface 131, also known as a touch display screen or a touchpad, can collect touch operations of the user on or near it (such as operations of the user using any suitable object or accessory such as a finger, a stylus, etc. on or near the touch-sensitive surface 131), and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface 131 can include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch orientation of the user, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 180, and can receive and execute the commands sent by the processor 180. In addition, various types such as resistive, capacitive, infrared, and surface acoustic wave can be used to implement the touch-sensitive surface 131. In addition to the touch-sensitive surface 131, the input unit 130 can also include other input electronic devices 132. Specifically, the other input electronic devices 132 can include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, power-on keys, etc.), trackballs, mice, joysticks, etc.
[0125] The display unit 140 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the electronic device 1200. These graphical user interfaces can be composed of graphics, text, icons, videos, and any combination thereof. The display unit 140 can include a display panel 141. Optionally, the display panel 141 can be configured in forms such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode). Further, the touch-sensitive surface 131 can cover the display panel 141. When the touch-sensitive surface 131 detects a touch operation on or near it, it is transmitted to the processor 180 to determine the type of touch event. Subsequently, the processor 180 provides a corresponding visual output on the display panel 141 according to the type of touch event. Although in Figure 5 the touch-sensitive surface 131 and the display panel 141 are implemented as two independent components to achieve input and output functions, in some embodiments, the touch-sensitive surface 131 and the display panel 141 can be integrated to achieve input and output functions.
[0126] The electronic device 1200 may further include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. Among them, the ambient light sensor can adjust the brightness of the display panel 141 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 141 and / or the backlight when the electronic device 1200 is moved to the ear. As a kind of motion sensor, the gravity acceleration sensor can detect the magnitude of the acceleration in each direction (generally three axes). When stationary, it can detect the magnitude and direction of gravity, and can be used in applications for identifying the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors that the electronic device 1200 may also be configured with, they will not be elaborated here.
[0127] The audio circuit 160, the speaker 161, and the microphone 162 can provide an audio interface between the user and the electronic device 1200. The audio circuit 160 can transmit the electrical signal converted from the received audio data to the speaker 161, and the speaker 161 converts it into a sound signal for output; on the other hand, the microphone 162 converts the collected sound signal into an electrical signal, which is received by the audio circuit 160 and then converted into audio data. After the audio data is output to the processor 180 for processing, it is sent through the RF circuit 110 to, for example, another terminal, or the audio data is output to the memory 120 for further processing. The audio circuit 160 may also include an earphone jack to provide communication between the peripheral earphone and the electronic device 1200.
[0128] The electronic device 1200 can help the user send and receive emails, browse the web, and access streaming media, etc. through the transmission module 170 (such as a Wi-Fi module), which provides the user with wireless broadband Internet access. Although Figure 5 the transmission module 170 is shown, it can be understood that it does not belong to the essential components of the electronic device 1200 and can be omitted completely according to needs without changing the essence of the invention.
[0129] The processor 180 is the control center of the electronic device 1200, connecting various parts of the entire mobile phone through various interfaces and circuits. By running or executing software programs and / or modules stored in the memory 120, and by invoking the data stored in the memory 120, it performs various functions of the electronic device 1200 and processes data, thereby monitoring the mobile phone as a whole. Optionally, the processor 180 may include one or more processing cores; in some embodiments, the processor 180 may integrate an application processor and a modem processor, where the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 180 either.
[0130] The electronic device 1200 further includes a power supply 190 for powering each component. In some embodiments, the power supply may be logically connected to the processor 180 through a power management system, so as to implement functions such as management of discharging and power consumption management through the power management system. The power supply 190 may also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, a power status indicator, etc.
[0131] Although not shown, the electronic device 1200 may also include a camera (such as a front camera, a rear camera), a Bluetooth module, etc., which will not be elaborated here. Specifically in this embodiment, the display unit 140 of the electronic device 1200 is a touch screen display. The electronic device 1200 also includes a memory 120, and one or more programs, where one or more programs are stored in the memory 120 and are configured to be executed by one or more processors 180. The one or more programs include instructions for performing the following operations:
[0132] Task receiving instructions, for receiving different test tasks belonging to the same test project, where the test tasks carry a description file, and the description file contains storage information for indicating the test code required for testing the test tasks;
[0133] Graph construction instructions, for constructing graph structure data of each of the test tasks according to the storage information, and the graph structure data is used to describe the correspondence between the test tasks and their corresponding storage information;
[0134] Priority determination instructions, for determining the test priorities of each of the test tasks according to the graph structure data;
[0135] Data testing instructions, for performing test operations on each of the test tasks in the order of the test priorities.
[0136] In some embodiments, the graph construction instruction is used to extract the code storage nodes included in the storage information; and construct the graph structure data of each of the test tasks according to the code storage nodes, where the code storage nodes serve as the node data in the graph structure data.
[0137] In some embodiments, the priority determination instruction is used to determine the number of nodes included in each of the graph structure data; and divide the test priorities of each of the test tasks according to the magnitudes of the numbers of nodes.
[0138] In some embodiments, the program further includes a test case generation instruction, which is used to input each of the guiding information into a pre-trained test case generation model for test case generation operations to obtain test cases corresponding to each of the test tasks; and a data testing instruction, which is used to perform automated test operations on each of the test tasks according to the test cases in the order of the test priorities.
[0139] In some embodiments, the program further includes a report generation instruction, which is used to obtain the test result data corresponding to each of the test tasks; and generate a test report corresponding to each of the test tasks according to the test result data.
[0140] In some embodiments, the data testing instruction is used to classify the test tasks according to a preset classification rule; and perform test operations on the test tasks belonging to the same class by using parallel thread synchronization.
[0141] In some embodiments, the data testing instruction is used to classify the test tasks that include the same storage node in the graph structure data into one class.
[0142] An embodiment of the present application further provides an electronic device. The electronic device may be a computer.
[0143] As can be seen from the above, an embodiment of the present application provides an electronic device 1200, and the electronic device 1200 performs the following steps:
[0144] Receive different test tasks belonging to the same test project, where a description file is carried in the test tasks, and the description file includes storage information for indicating the test code required for testing the test tasks;
[0145] Construct the graph structure data of each of the test tasks according to the storage information, where the graph structure data is used to describe the correspondence between the test tasks and their corresponding storage information;
[0146] Determine the test priorities of each of the test tasks according to the graph structure data;
[0147] Perform test operations on each of the test tasks in the order of the test priorities.
[0148] An embodiment of the present application further provides a storage medium, in which a computer program is stored. When the computer program runs on a computer, the computer executes the following steps:
[0149] Receive different test tasks belonging to the same test project. The test tasks carry a description file, and the description file contains storage information for indicating the test code required for testing the test tasks.
[0150] Construct graph structure data for each of the test tasks according to the storage information. The graph structure data is used to describe the correspondence between the test tasks and their corresponding storage information.
[0151] Determine the test priorities of each of the test tasks according to the graph structure data.
[0152] Perform test operations on each of the test tasks in the order of the test priorities.
[0153] It should be noted that for the data testing method of the present application, those of ordinary skill in the art can understand that all or part of the processes for implementing the data testing method described in the embodiments of the present application can be completed by controlling related hardware through a computer program. The computer program can be stored in a computer-readable storage medium, such as stored in the memory of an electronic device and executed by at least one processor in the electronic device. During the execution process, it can include the processes of the embodiments of the data testing method. Among them, the storage medium can be a magnetic disk, an optical disc, a read-only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), etc.
[0154] For the data testing device of the embodiments of the present application, its various functional modules can be integrated in a processing chip, or each module can exist physically alone, or two or more modules can be integrated in one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. When the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium, such as a read-only memory, a magnetic disk, or an optical disc, etc.
[0155] The above has introduced in detail the data testing method, device, medium and equipment provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A data testing method, characterized in that: include: Receiving different test tasks belonging to the same test project, wherein the test tasks carry description files, and the description files contain storage information for indicating test codes required for testing the test tasks; Constructing graph structure data of each of the test tasks according to the storage information, wherein the graph structure data is used to describe the corresponding relationship between the test task and the corresponding storage information; Determine the test priority of each of the test tasks according to the graph structure data; Perform test operations on each of the test tasks in the order of the test priorities.
2. The data testing method according to claim 1, characterized in that: The graph structure data of each test task is constructed according to the storage information, and the graph structure data is used to describe the corresponding relationship between the test task and its corresponding storage information, including: Extracting the code storage node contained in the storage information; The graph structure data of each of the test tasks is constructed according to the code storage nodes, wherein the code storage nodes serve as node data in the graph structure data.
3. The data testing method according to claim 1, characterized in that: Determining the test priority of each of the test tasks according to the graph structure data includes: Determine the number of nodes contained in each of the graph structure data; The test priority of each test task is divided according to the number of nodes.
4. The data testing method according to claim 1, characterized in that: The description file also includes guidance information required for indicating the test task test; Before performing a test operation on each of the test tasks, the method further includes: Inputting each of the guide information into a pre-trained test case generation model to perform a test case generation operation to obtain a test case corresponding to each of the test tasks; The testing operation is performed on each of the test tasks in the order of the test priority, including: According to the order of the test priorities, automated testing operations are performed on each of the test tasks based on the test cases.
5. The data testing method according to claim 1, characterized in that: After performing the test operation on each of the test tasks, the method further includes: Obtaining test result data corresponding to each of the test tasks; A test report corresponding to each of the test tasks is generated according to the test result data.
6. The data testing method according to claim 1, characterized in that: The performing a test operation on each of the test tasks includes: Classifying the test tasks according to preset classification rules; The test tasks belonging to the same category are tested synchronously using parallel threads.
7. The data testing method according to claim 6, characterized in that: The classifying of the test tasks according to the preset classification rules includes: The test tasks containing the same storage nodes in the graph structure data are grouped into one category.
8. A data testing device, characterized in that: The data testing device comprises: A task receiving module, used for receiving different test tasks belonging to the same test project, wherein the test tasks carry description files, and the description files contain storage information for indicating the test codes required for testing the test tasks; A graph construction module, used to construct graph structure data of each of the test tasks according to the storage information, wherein the graph structure data is used to describe the corresponding relationship between the test task and its corresponding storage information; A priority determination module, used to determine the test priority of each of the test tasks according to the graph structure data; The data testing module is used to perform testing operations on each of the test tasks in the order of the test priorities.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the data testing method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a plurality of instructions, and the processor loads the instructions to execute the data testing method according to any one of claims 1 to 7.