System testing method and apparatus, computer device, and storage medium
By dividing the system under test into test business modules and adopting fully automatic or semi-automatic testing modes, the test process groups and test case links are automatically determined, which solves the problems of incomplete testing and low efficiency in existing technologies and achieves efficient and comprehensive system testing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2023-01-10
- Publication Date
- 2026-04-17
AI Technical Summary
Existing automated testing technologies suffer from incomplete and insufficient testing when updating business systems. Furthermore, due to frequent version updates, it is difficult to identify affected system functions, resulting in high testing costs and low efficiency.
The system under test is divided into multiple test business modules. Depending on the importance of the modules, fully automatic or semi-automatic testing modes are adopted. The target test process group and test case chain are determined, and the test is carried out automatically without the need for manual test script writing.
It enables comprehensive and thorough testing of the system under test, improves testing efficiency, reduces testing costs, and enhances the flexibility and comprehensiveness of testing.
Smart Images

Figure CN116166542B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a system testing method, apparatus, computer equipment, and storage medium. Background Technology
[0002] As business needs continue to expand, the speed of business system updates and iterations is constantly increasing. In order to prevent problems caused by code changes affecting the old functions of the system during the business system update process, a large number of repeated regression tests are required on the updated business system.
[0003] Existing automated testing technologies typically involve developing independent, specialized automated test scripts for each functionality of the business system under test (i.e., the system under test). This means one test script corresponds to one test scenario. If the business logic or parameters change, the existing scripts become ineffective, requiring a complete modification. This is inconvenient for testers to maintain the test scripts and may lead to incomplete or insufficient testing. Furthermore, because the system under test undergoes frequent version updates, existing functions may be affected by these updates, and such issues are difficult to detect in previous automated tests. This necessitates introducing new test scripts within the existing automated test scripts, resulting in high costs and low testing efficiency. Summary of the Invention
[0004] Therefore, it is necessary to provide a system testing method, apparatus, computer equipment, and storage medium that can improve the comprehensiveness, accuracy, and efficiency of testing in response to the above-mentioned technical problems.
[0005] Firstly, this application provides a system testing method. The method includes:
[0006] Based on the functional type of the system under test, the system under test is divided into at least one test business module;
[0007] Based on the importance of each test business module, the test mode for each test business module is determined; among them, the test modes include fully automatic test mode and semi-automatic test mode.
[0008] Based on the test process acquisition strategy corresponding to the test mode of each test business module, determine at least one target test process group for each test business module, and determine the test case link and process group execution order of at least one target test process group;
[0009] Based on the execution order of the process groups of each target test process group corresponding to each test business module, the test case links of the corresponding target test process group are called to test the system under test.
[0010] In one embodiment, based on the test process acquisition strategy corresponding to the test mode of each test business module, at least one target test process group corresponding to each test business module is determined, and the test case chain and process group execution order of at least one target test process group are determined, including:
[0011] Based on the test process acquisition strategy corresponding to the test mode of each test business module, determine at least one target test process group and the execution order of the process group of at least one target test process group for each test business module.
[0012] From the process group use case relationship table, find the test case links for each target test process group corresponding to each test business module.
[0013] In one embodiment, based on the test process acquisition strategy corresponding to the test mode of each test business module, at least one target test process group and the execution order of the process groups of at least one target test process group corresponding to each test business module are determined, including:
[0014] For test business modules in semi-automatic testing mode, candidate test process groups are displayed to the user, and the user obtains at least one target test process group corresponding to the test business module selected by the user based on the candidate test process groups, as well as the execution order of the process groups of at least one target test process group.
[0015] In one embodiment, based on the test process acquisition strategy corresponding to the test mode of each test business module, at least one target test process group and the execution order of the process groups of at least one target test process group corresponding to each test business module are determined, including:
[0016] For test business modules in fully automated testing mode, find at least one target test process group and the execution order of the process group corresponding to the test business module from the module process group relationship table.
[0017] In one embodiment, the method further includes:
[0018] By using a content parsing model, the test process content in the candidate test process group is parsed to obtain the test case link corresponding to the candidate test process group;
[0019] Based on the test case links corresponding to the candidate test process groups, construct a test case relationship table for the process groups.
[0020] In one embodiment, before testing the system under test, the test case chain of the corresponding target test process group is invoked according to the execution order of the process groups of each target test process group corresponding to each test business module.
[0021] For test business modules in semi-automatic testing mode, if the number of target test process groups corresponding to the test business module is at least two, then determine the correlation between each target test process group corresponding to the test business module.
[0022] Based on the relevance, adjust the number of target test process groups and / or the execution order of the processes corresponding to the test business modules.
[0023] In one embodiment, determining the correlation between the target test process groups corresponding to the test business module includes:
[0024] Obtain the test code for each target test process group corresponding to the test business module; where the test code is the test case code corresponding to the test case chain of the target test process group;
[0025] Determine the degree of redundancy between test code in different target test process groups, as the correlation between different target test process groups.
[0026] In one embodiment, the method further includes:
[0027] Obtain test logs of the test cases that call each test business module to test the system under test;
[0028] The test logs are cleaned and integrated to generate a test report for the system under test.
[0029] Secondly, this application also provides a system testing apparatus. The apparatus includes:
[0030] The business segmentation module is used to divide the system under test into at least one test business module based on the functional type of the system under test;
[0031] The mode determination module is used to determine the test mode for each test business module based on the importance of each test business module; among which, the test modes include fully automatic test mode and semi-automatic test mode;
[0032] The strategy determination module is used to obtain the strategy based on the test process corresponding to the test mode of each test business module, determine at least one target test process group for each test business module, and determine the test case link and process group execution order of at least one target test process group.
[0033] The testing module is used to call the test case chain of the corresponding target test process group according to the execution order of the process group of each target test process group corresponding to each test business module, and to test the system under test.
[0034] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0035] Based on the functional type of the system under test, the system under test is divided into at least one test business module;
[0036] Based on the importance of each test business module, the test mode for each test business module is determined; among them, the test modes include fully automatic test mode and semi-automatic test mode.
[0037] Based on the test process acquisition strategy corresponding to the test mode of each test business module, determine at least one target test process group for each test business module, and determine the test case link and process group execution order of at least one target test process group;
[0038] Based on the execution order of the process groups of each target test process group corresponding to each test business module, the test case links of the corresponding target test process group are called to test the system under test.
[0039] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0040] Based on the functional type of the system under test, the system under test is divided into at least one test business module;
[0041] Based on the importance of each test business module, the test mode for each test business module is determined; among them, the test modes include fully automatic test mode and semi-automatic test mode.
[0042] Based on the test process acquisition strategy corresponding to the test mode of each test business module, determine at least one target test process group for each test business module, and determine the test case link and process group execution order of at least one target test process group;
[0043] Based on the execution order of the process groups of each target test process group corresponding to each test business module, the test case links of the corresponding target test process group are called to test the system under test.
[0044] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0045] Based on the functional type of the system under test, the system under test is divided into at least one test business module;
[0046] Based on the importance of each test business module, the test mode for each test business module is determined; among them, the test modes include fully automatic test mode and semi-automatic test mode.
[0047] Based on the test process acquisition strategy corresponding to the test mode of each test business module, determine at least one target test process group for each test business module, and determine the test case link and process group execution order of at least one target test process group;
[0048] Based on the execution order of the process groups of each target test process group corresponding to each test business module, the test case links of the corresponding target test process group are called to test the system under test.
[0049] The aforementioned system testing methods, devices, computer equipment, and storage media, according to the functional type of the system under test, divide the system under test into at least one test business module. For each test business module, based on its importance, different test mode-corresponding test process acquisition strategies are adopted to determine at least one target test process group for each test business module, as well as the test case links and process group execution order for each target test process group. Then, based on the determined process group execution order and test case links for each target test process group corresponding to each test business module, the system under test is tested. This solution can automatically determine the corresponding test process groups and test case links for the system under test, eliminating the need for testers to manually write test scripts, and thus automatically performing comprehensive and thorough testing of the system under test. This improves testing efficiency and reduces testing costs. In addition, according to the functional type of the system under test, the system under test is divided into multiple test business modules for testing, which makes the testing of business modules more comprehensive and thorough. At the same time, this solution determines different test modes according to the importance of the test modules, and adopts different test mode strategies to obtain test process groups and test case links, which improves the flexibility, rationality and comprehensiveness of the results obtained, and provides a guarantee for accurate, efficient and comprehensive testing of the system. Attached Figure Description
[0050] Figure 1 This is an application environment diagram of a system testing method provided in this embodiment;
[0051] Figure 2 This is a flowchart illustrating the first system testing method provided in this embodiment;
[0052] Figure 3 This embodiment provides a schematic diagram illustrating the principle of dividing test service modules.
[0053] Figure 4 This is a flowchart illustrating a test process acquisition strategy provided in this embodiment;
[0054] Figure 5 This is a schematic diagram illustrating the process of a test switching tool module provided in this embodiment;
[0055] Figure 6 This embodiment provides a flowchart illustrating the construction of a process group use case relationship table.
[0056] Figure 7 This is a schematic diagram of a test process group adjustment provided in this embodiment;
[0057] Figure 8 This is a schematic diagram illustrating a process for determining the correlation degree of a test process group, as provided in this embodiment.
[0058] Figure 9 This is a flowchart illustrating the second system testing method provided in this embodiment;
[0059] Figure 10 This is a structural block diagram of the first system testing device provided in this embodiment;
[0060] Figure 11 This is a structural block diagram of the second system testing device provided in this embodiment;
[0061] Figure 12 This is a structural block diagram of the third system testing device provided in this embodiment;
[0062] Figure 13 This is a structural block diagram of the fourth system testing device provided in this embodiment;
[0063] Figure 14 This is a structural block diagram of the fifth system testing device provided in this embodiment;
[0064] Figure 15 This is a structural block diagram of the sixth system testing device provided in this embodiment;
[0065] Figure 16 This is an internal structural diagram of a computer device provided in this embodiment. Detailed Implementation
[0066] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0067] The system testing method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, in one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows. Figure 1As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores test business modules, test process groups, and test case links. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a system testing method.
[0068] The aforementioned system testing methods, apparatus, computer equipment, and storage media, based on the functional type of the system under test, divide the system under test into at least one test business module. Then, based on the importance of each test business module, a test mode is determined for each test business module. Simultaneously, based on the test process acquisition strategy corresponding to the test mode of each test business module, at least one target test process group is determined for each test business module. Furthermore, the test case links and execution order of the process groups for at least one target test process group are determined. Finally, based on the execution order of the process groups for each target test process group corresponding to each test business module, the test case links for the corresponding target test process groups are invoked to test the system under test.
[0069] In one embodiment, such as Figure 2 As shown, a system testing method is provided, which is applied to... Figure 1 Taking the server in the example, the following steps are included:
[0070] S201 divides the system under test into at least one test business module based on the functional type of the system under test.
[0071] The system under test can be a software product system that needs to be tested.
[0072] The function type can be the application function of the system under test. For example, if the system under test is an operation and maintenance emergency tool, the function type can be the switching tool function or the switching instance function.
[0073] Among them, the test business module can be a module to be tested based on a certain function of the system under test.
[0074] Optionally, there are multiple ways to divide the system under test into at least one test business module based on its functional type, and this application does not limit this approach. One possible implementation is to parse the system under test to extract at least one corresponding functional type, and based on each extracted functional type, to divide the system under test into a corresponding test business module, whereby each test business module tests only one function of the system under test. Another possible implementation is to parse the test requirements to determine the functional types that need to be tested in the system under test, and to use the extracted functional types as the functional types of the system under test, thus dividing the system under test into a corresponding test business module.
[0075] S202 determines the test mode for each test service module based on its importance.
[0076] The testing modes include fully automated testing and semi-automated testing. Fully automated testing automatically completes testing for each business module and obtains the results. Semi-automated testing requires manual assistance to select data and obtain the results.
[0077] Optionally, there are several ways to determine the importance of a test business module. One approach is to manually assess the importance of each test business module and label the test business module with a corresponding importance tag. Another approach is to calculate the importance index of the test business module based on a pre-set importance judgment logic and compare the importance index with a pre-set importance index threshold. If the importance index exceeds the importance index threshold, the test business module corresponding to the importance index is determined to be important; otherwise, it is not important.
[0078] Optionally, after obtaining the importance of each test business module, if the importance of the test business module is important, then the test business module is determined to execute the fully automatic test mode; if the importance of the test business module is not important, then the test business module is determined to execute the semi-automatic test mode.
[0079] S203 determines at least one target test process group for each test business module based on the test process acquisition strategy corresponding to the test mode of each test business module, and determines the test case link and process group execution order of at least one target test process group.
[0080] Among them, the test process acquisition strategy can be a strategy for acquiring test process groups.
[0081] The target test process group can be a test group set up based on the content of the test business modules, used to test the system under test. For example, such as... Figure 3As shown, taking the system under test, the Operation and Maintenance Emergency Automation Tool, as an example, the tool is divided into a switch instance module and a switch tool module based on its functional type. The switch instance module includes a switch progress query process test group, a switch failure reason analysis process test group, and a switch breakpoint operation process test group. The switch tool module includes a trigger debugging process test group, a parameter self-discovery process test group, and a tool development process test group.
[0082] A test case chain can be a link formed by connecting test cases that test the business module in the order of execution. In other words, a test case chain includes at least one test case and the execution order of the test cases.
[0083] Optionally, for test business modules in fully automated testing mode, the target test process group, test case links, and execution order of the process groups can be automatically determined through fully automated acquisition methods, such as table lookup or model lookup. For example, based on the test process acquisition strategy corresponding to the fully automated testing model, the target test process group corresponding to the business module is found from a pre-set module process group relationship table, where the mapping relationship between the test business module and the test process group is recorded. Then, based on the test business module and the target test process group, the execution order of the target test process group is determined. At the same time, based on the determined target test process group, it is input into a pre-set test case link model. This test case link model analyzes the input target test process group to obtain the test case links corresponding to the target test process group.
[0084] Optionally, for test business modules in semi-automatic testing mode, the target test process group, the test case chain of the target test process group, and the execution order of the process group can be obtained through human-computer interaction. For example, taking the acquisition of the target test process group as an example, candidate test process groups can be displayed to the user, and the user can select one or more candidate test process groups as the target test process group.
[0085] It should be noted that, for the semi-automatic testing mode, one or more of the following can be determined through human-computer interaction: the target test process group, the test case chain of the target test process group, and the execution order of the process group; while other items are determined through automatic analysis.
[0086] S204 calls the test case chain of the corresponding target test process group according to the execution order of the process group of each target test process group corresponding to each test business module, and tests the system under test.
[0087] Optionally, based on the execution order of the process groups of each target test process group corresponding to each test business module, the test case link of the corresponding target test process group is executed, and test data for testing the system under test is obtained from the pre-set test database, and the system under test is tested based on the test data through the test case link.
[0088] The aforementioned system testing method divides the system under test into at least one test business module according to its functional type. For each test business module, different test mode corresponding to the test process acquisition strategy is adopted according to its importance. At least one target test process group, test case links, and execution order of each target test process group are determined for each test business module. Then, based on the determined execution order and test case links of each target test process group for each test business module, the system under test is tested. This solution can automatically determine the corresponding test process groups and test case links for the system under test, eliminating the need for testers to manually write test scripts, and achieving automatic and comprehensive testing of the system under test. This improves testing efficiency and reduces testing costs. Furthermore, dividing the system under test into multiple test business modules according to its functional type makes the testing of business modules more comprehensive and thorough. At the same time, this solution determines different test modes according to the importance of the test modules and adopts different test mode strategies to acquire test process groups and test case links, improving the flexibility, rationality, and comprehensiveness of the obtained results, ensuring accurate, efficient, and comprehensive testing of the system.
[0089] It should be noted that after testing the system under test, the process also includes obtaining test logs from the test case chains corresponding to each test business module, cleaning and integrating the test logs, and generating a test report for the system under test. The test logs can be log data recording the entire testing process and results during the testing of the system under test, and the test report can be a report generated based on the test results. Optionally, the test logs from the test case chains are processed using a pre-set cleaning and integration mechanism to generate the test report for the system under test. The advantage of this setup is that the generated test report can be presented to the user more concisely, allowing the user to effectively understand the test results of the system under test.
[0090] Figure 4 This is a flowchart illustrating a test process acquisition strategy in one embodiment. The accuracy of the test case link lookup directly affects the accuracy of subsequent testing of the business modules. Therefore, to ensure the accuracy of business module testing, this embodiment provides an optional method for acquiring the test process, including the following steps:
[0091] S401 determines at least one target test process group and the execution order of the process groups of at least one target test process group for each test business module based on the test process acquisition strategy corresponding to the test mode of each test business module.
[0092] Optionally, for test business modules in semi-automatic testing mode, candidate test process groups are displayed to the user, and at least one target test process group and the execution order of the process groups of the at least one target test process group are obtained based on the candidate test process groups and the test business module selected by the user.
[0093] Specifically, for the test business module in semi-automatic testing mode, users are shown pre-set candidate test process groups that can be selected. Users can select one or more candidate test process groups as target test process groups according to their needs. At the same time, the process groups are manually sorted based on the obtained target test process groups to obtain the execution order of the process groups of the target test process groups.
[0094] Optionally, for test business modules in fully automated testing mode, the system retrieves at least one target test process group and the execution order of the process groups corresponding to the test business module from the module process group relationship table. The process group relationship table records the mapping relationship between the test business module and at least one process test group, as well as the execution order of the process groups corresponding to the test business module.
[0095] Specifically, for test business modules in fully automated testing mode, at least one test process group corresponding to the test business module is found from the pre-set module process group relationship table, and the execution order of the process group corresponding to the test process group is obtained.
[0096] S402 retrieves the test case links for each target test process group corresponding to each test business module from the process group test case relationship table.
[0097] The process group test case relationship table can be a table that records the mapping relationship between test process groups and test case links.
[0098] Optionally, based on the determined test process group, the test case link corresponding to the test process group is found from the pre-set process group test case relationship table.
[0099] For example, such as Figure 5As shown, taking the testing business module as an example of the switching tool module, this switching tool module includes three process test groups: the trigger debugging test process group, the parameter self-discovery test process group, and the tool compilation test process group. The trigger debugging test process group, as described in this embodiment, includes test case links ①②⑤③, which sequentially execute the switching tool obtaining test cases, parameter compliance check test cases, pre-trigger process check test cases, and execution of the switching tool test cases. The parameter self-discovery test process group includes test case links ①④②, which sequentially execute the switching tool obtaining test cases, self-discovery strategy editing test cases, and parameter compliance check test cases. The tool compilation test process group includes test case links ⑥①⑧⑦④②, which sequentially execute the switching tool adding test cases, switching tool obtaining test cases, switching tool modifying test cases, parameter filling test cases, self-discovery strategy editing test cases, and parameter compliance check test cases.
[0100] The aforementioned test process acquisition strategy determines at least one target test process group and the execution order of at least one target test process group for each test business module based on the test process acquisition strategy corresponding to the test mode of each test business module. It then searches the test case link for each target test process group corresponding to each test business module from the process group test case relationship table. This method acquires the target test process group and the execution order of the process group, and further obtains the test case link. Compared with existing technologies, it eliminates the need to write a test script for each test process group, thus improving the testing efficiency and comprehensiveness of automated testing.
[0101] Figure 6 This is a flowchart illustrating the process of constructing a process group test case relationship table in one embodiment. The completeness of the constructed process group test case relationship table affects the accuracy of subsequent test case link retrieval based on the table. Therefore, to further ensure the accuracy of business module testing, this embodiment provides an optional method for constructing the process group test case relationship table, including the following steps:
[0102] S601 uses a content parsing model to parse the test process content in the candidate test process group and obtain the test case link corresponding to the candidate test process group.
[0103] The content parsing model can be a pre-trained model that can parse the content of the test process group and output the corresponding test case link of the test process group.
[0104] Optionally, each candidate test process group is input into a pre-set content parsing model, which parses the content of the input candidate test process group and outputs the test case link corresponding to the candidate test process group.
[0105] S602 constructs a test case relationship table for the process group based on the test case links corresponding to the candidate test process group.
[0106] Optionally, the test case link of each candidate test process group determined in S601 and its corresponding candidate test process group are taken as a set of process group test case mapping relationships, and the obtained mapping relationships are combined to form a process group test case table.
[0107] The method described above for constructing a process group test case relationship table uses a content parsing model to analyze the test process content in candidate test process groups, obtaining the test case links corresponding to the candidate test process groups. Based on these test case links, a process group test case relationship table is constructed. Since the test case links recorded in the process group test case relationship table are the test scripts used when testing the system under test, this solution records the test scripts for various system function tests through the process group test case relationship table. This facilitates the quick and comprehensive retrieval of the test case links corresponding to the target test process group during subsequent testing of the system under test, thereby improving the convenience and efficiency of testing. Furthermore, it also improves the readability and maintainability of the test scripts.
[0108] Figure 7 This is a flowchart illustrating the adjustment of test process groups in one embodiment. To ensure testing efficiency for business modules, this embodiment can adjust the number and / or execution order of test process groups determined based on the above embodiments. This embodiment provides an optional method for adjusting test process groups, including the following steps:
[0109] For test business modules in semi-automatic testing mode, if the number of target test process groups corresponding to the test business module is at least two, S701 determines the correlation between the target test process groups corresponding to the test business module.
[0110] Among them, the correlation degree can be the degree of code duplication between the test code of each target test process group, and this correlation degree represents the relevance between each target test process group.
[0111] For test business modules in semi-automatic testing mode, due to human factors, the number of manually selected test process groups may be large or inaccurate. In this embodiment, after determining the target test process groups corresponding to the test business module, the target test process groups of the test business module in semi-automatic testing mode can be further adjusted individually.
[0112] Optionally, the test code for each target test process group corresponding to the test business module of the semi-automatic test model can be obtained first. The redundancy between the test codes of different target test process groups can be determined as the correlation between different target test process groups. The test code refers to the corresponding test case code in the test case chain of the target test process group. Specifically, each target test process group corresponding to the test business module is obtained, and based on the test code of each test case in the test case chain corresponding to that target test process group, the code redundancy between the test codes of each target test process group is calculated through pre-set calculation logic. This code redundancy is then used as the correlation between different target test process groups.
[0113] S702 adjusts the number of target test process groups and / or the execution order of processes corresponding to the test business modules based on the degree of relevance.
[0114] Optionally, based on the correlation between different target test process groups, a comparison is made with a pre-set correlation threshold. Test process group pairs with a correlation exceeding the threshold are selected, and the number of target test process groups corresponding to the test business module is adjusted. For example, for a test business module containing only two test process groups, if the correlation between the two test process groups exceeds the correlation threshold, the two test process groups are executed sequentially according to the pre-obtained execution order of the test process groups; if the correlation between the two test process groups does not exceed the correlation threshold, only the first test process group in the pre-obtained execution order of the test process groups is executed. For a test business module containing at least three test process groups, only test process group pairs with a correlation exceeding the correlation threshold are retained, and the retained test process groups are executed sequentially according to the pre-obtained execution order of the test process groups. Finally, the execution order of the target test process groups is adjusted based on the correlation between the test process group pairs.
[0115] For example, such as Figure 8As shown, Module 1 is a test business module containing three test process groups. Test process group 1 includes test case ①, test case ②, and test case ④; test process group 2 includes test case ② and test case ③; and test process group 3 includes test case ②, test case ③, and test case ④. The correlation between test process group 1 and test process group 2 is 50%, the correlation between test process group 2 and test process group 3 is 80%, and the correlation between test process group 1 and test process group 3 is 90%. If the correlation threshold is set to 85%, then the test process pairs of test process group 1 and test process group 3 are selected, and the number and execution order of the existing target test process groups are adjusted. That is, only test process group 1 and test process group 3 are executed sequentially, and step process group 2 is not required. If the correlation threshold is set to 75%, then since the correlation between test process group 1 and test process group 3 is greater than the correlation between test process group 2 and test process group 3, the execution order of the existing target test process groups is adjusted. That is, the original order of executing test process group 1, test process group 2 and test process group 3 is changed to the order of executing test process group 1, test process group 3 and test process group 2.
[0116] Module 2 is a test business module containing only two test process groups. Test process group 4 includes test case 6 and test case 7, and test process group 5 includes test case 5 and test case 6. The correlation between test process group 4 and test process group 5 is 30%. If the correlation between test process group 4 and test process group 5 exceeds the preset correlation threshold, test process group 4 and test process group 5 are executed sequentially; if the correlation between test process group 4 and test process group 5 does not exceed the preset correlation threshold, only test process group 4 is executed.
[0117] The above-described test process group adjustment method, for test business modules in semi-automatic testing mode, determines the correlation between the target test process groups corresponding to the test business module if the number of target test process groups corresponding to the test business module is at least two. Based on the correlation, the number of target test process groups and / or the execution order of the processes are adjusted. This method determines the correlation between each target test process group and adjusts the number of target test process groups and / or the execution order of the processes based on this correlation, effectively reducing the problem of low testing efficiency caused by large test process group data.
[0118] In one embodiment, this embodiment provides an optional method for system testing, using the application of this method to a server as an example for illustration. For example... Figure 9 As shown, the method includes the following steps:
[0119] S901 uses a content parsing model to parse the test process content in the candidate test process group and obtain the test case link corresponding to the candidate test process group.
[0120] S902 constructs a test case relationship table for the process group based on the test case links corresponding to the candidate test process group.
[0121] S903 divides the system under test into at least one test business module based on the functional type of the system under test.
[0122] S904 Determines the test mode for each test service module based on its importance. If it is a semi-automatic test mode, proceed to step S905; if it is a fully automatic test mode, proceed to step S910.
[0123] For test business modules in semi-automatic testing mode, S905 displays candidate test process groups to the user, obtains at least one target test process group and the execution order of the process groups of at least one target test process group corresponding to the test business module selected by the user based on the candidate test process groups, and finds the test case links of each target test process group corresponding to each test business module from the process group test case relationship table.
[0124] S906 determines whether the number of target test process groups corresponding to the test business module is greater than two. If yes, then execute 907; otherwise, execute 911.
[0125] S907 If the number of target test process groups corresponding to the test business module is at least two, then obtain the test code for each target test process group corresponding to the test business module. The test code is the corresponding test case code for the test case chain of the target test process group.
[0126] S908 determines the degree of redundancy between test codes in different target test process groups, which is used as the correlation between different target test process groups.
[0127] S909 adjusts the number and / or execution order of the target test process groups corresponding to the test business modules based on the relevance, and continues to execute step S911.
[0128] S910, for test business modules in fully automated test mode, finds at least one target test process group and the execution order of the process group corresponding to the test business module from the module process group relationship table, and finds the test case link of each target test process group corresponding to each test business module from the process group test case relationship table, and continues to execute S911.
[0129] S911 calls the test case chain of the corresponding target test process group according to the execution order of the process group of each target test process group corresponding to each test business module, and tests the system under test.
[0130] S912 retrieves test logs from the test cases linked to each test business module used to test the system under test.
[0131] The S913 cleans and integrates the test logs to generate a test report for the system under test.
[0132] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0133] Based on the same inventive concept, this application also provides a system testing apparatus for implementing the system testing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more system testing apparatus embodiments provided below can be found in the limitations of the system testing method described above, and will not be repeated here.
[0134] In one embodiment, such as Figure 10 As shown, a system testing device 1 is provided, including: a service partitioning module 10, a pattern determination module 11, a strategy determination module 12, and a testing module 13, wherein:
[0135] The business segmentation module 10 is used to divide the system under test into at least one test business module according to the functional type of the system under test.
[0136] The mode determination module 11 is used to determine the test mode for each test business module based on its importance. The test modes include a fully automatic test mode and a semi-automatic test mode.
[0137] The strategy determination module 12 is used to obtain the strategy according to the test process corresponding to the test mode of each test business module, determine at least one target test process group corresponding to each test business module, and determine the test case link and process group execution order of at least one target test process group.
[0138] Test module 13 is used to call the test case chain of the corresponding target test process group according to the execution order of the process group of each target test process group corresponding to each test business module, and to test the system under test.
[0139] In one embodiment, such as Figure 11 As shown, Figure 10 The strategy determination module 12 in the middle includes:
[0140] The strategy determination unit 120 is used to obtain the strategy according to the test process corresponding to the test mode of each test business module, and determine at least one target test process group and the execution order of the process group of at least one target test process group corresponding to each test business module.
[0141] Link lookup unit 121 is used to look up the test case links of each target test process group corresponding to each test business module from the process group test case relationship table.
[0142] In one embodiment, Figure 11 The strategy determination unit 120 is also used to display candidate test process groups to the user for test business modules in semi-automatic test mode, and to obtain at least one target test process group and the execution order of the process groups of at least one target test process group corresponding to the test business module selected by the user based on the candidate test process groups.
[0143] In one embodiment, Figure 11 The strategy determination unit 120 is also used to find, from the module process group relationship table, at least one target test process group and the process group execution order of the at least one target test process group corresponding to the test business module in the fully automatic test mode.
[0144] In one embodiment, such as Figure 12 As shown, Figure 10 The system testing device 1 in the middle also includes:
[0145] Link acquisition module 14 is used to parse the test process content in the candidate test process group through the content parsing model to obtain the test case link corresponding to the candidate test process group.
[0146] The relationship table construction module 15 is used to construct a process group test case relationship table based on the test case links corresponding to the candidate test process group.
[0147] In one embodiment, such as Figure 13 As shown, Figure 10 The system testing device 1 in the middle also includes:
[0148] The correlation determination module 16 is used to determine the correlation between the target test process groups corresponding to the test business modules in the semi-automatic test mode if the number of target test process groups corresponding to the test business modules is at least two.
[0149] The process group adjustment module 17 is used to adjust the number and / or execution order of the target test process groups corresponding to the test business modules based on the degree of relevance.
[0150] In one embodiment, such as Figure 14 As shown, Figure 13 The correlation determination module 16 in the middle also includes:
[0151] Test code acquisition unit 160 is used to acquire the test code for each target test process group corresponding to the test business module. The test code is the corresponding test case code for the test case chain of the target test process group.
[0152] The correlation determination unit 161 is used to determine the degree of redundancy between test codes of different target test process groups, as the correlation between different target test process groups.
[0153] In one embodiment, such as Figure 15 As shown, Figure 10 The system testing device 1 in the middle also includes:
[0154] The log acquisition module 18 is used to acquire test logs of the test cases that call the test business modules to test the system under test.
[0155] The report generation module 19 is used to clean and integrate the test logs to generate a test report for the system under test.
[0156] Each module in the aforementioned system testing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0157] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 16As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a system testing method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0158] Those skilled in the art will understand that Figure 16 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0159] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0160] Based on the functional type of the system under test, the system under test is divided into at least one test business module.
[0161] Based on the importance of each test business module, the test mode for each test business module is determined. These test modes include fully automated test mode and semi-automated test mode.
[0162] Based on the test process acquisition strategy corresponding to the test mode of each test business module, determine at least one target test process group for each test business module, and determine the test case link and process group execution order for at least one target test process group.
[0163] Based on the execution order of the process groups of each target test process group corresponding to each test business module, the test case links of the corresponding target test process group are called to test the system under test.
[0164] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0165] Based on the test process acquisition strategy corresponding to the test mode of each test business module, determine at least one target test process group and the execution order of the process group of at least one target test process group for each test business module.
[0166] From the process group use case relationship table, find the test case links for each target test process group corresponding to each test business module.
[0167] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0168] For test business modules in semi-automatic testing mode, candidate test process groups are displayed to the user, and the user obtains at least one target test process group corresponding to the test business module selected by the user based on the candidate test process groups, as well as the execution order of the process groups of at least one target test process group.
[0169] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0170] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0171] For test business modules in fully automated testing mode, find at least one target test process group and the execution order of the process group corresponding to the test business module from the module process group relationship table.
[0172] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0173] By using a content parsing model, the test process content in the candidate test process group is parsed to obtain the test case link corresponding to the candidate test process group.
[0174] Based on the test case links corresponding to the candidate test process groups, construct a test case relationship table for the process groups.
[0175] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0176] For test business modules in semi-automatic testing mode, if the number of target test process groups corresponding to the test business module is at least two, then the correlation between each target test process group corresponding to the test business module is determined.
[0177] Based on the relevance, adjust the number of target test process groups and / or the execution order of the processes corresponding to the test business modules.
[0178] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0179] Obtain the test code for each target test process group corresponding to the test business module. The test code is the corresponding test case code for the test case chain of the target test process group.
[0180] Determine the degree of redundancy between test code in different target test process groups, as the correlation between different target test process groups.
[0181] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0182] Obtain test logs of the test cases that are invoked for each test business module to test the system under test.
[0183] The test logs are cleaned and integrated to generate a test report for the system under test.
[0184] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0185] Based on the functional type of the system under test, the system under test is divided into at least one test business module.
[0186] Based on the importance of each test business module, the test mode for each test business module is determined. These test modes include fully automated test mode and semi-automated test mode.
[0187] Based on the test process acquisition strategy corresponding to the test mode of each test business module, determine at least one target test process group for each test business module, and determine the test case link and process group execution order for at least one target test process group.
[0188] Based on the execution order of the process groups of each target test process group corresponding to each test business module, the test case links of the corresponding target test process group are called to test the system under test.
[0189] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0190] Based on the functional type of the system under test, the system under test is divided into at least one test business module.
[0191] Based on the importance of each test business module, the test mode for each test business module is determined. These test modes include fully automated test mode and semi-automated test mode.
[0192] Based on the test process acquisition strategy corresponding to the test mode of each test business module, determine at least one target test process group for each test business module, and determine the test case link and process group execution order for at least one target test process group.
[0193] Based on the execution order of the process groups of each target test process group corresponding to each test business module, the test case links of the corresponding target test process group are called to test the system under test.
[0194] It should be noted that the data involved in this application (including but not limited to data used for analysis, data stored, data displayed, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0195] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0196] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0197] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A system testing method, characterized by, The method includes: Based on the functional type of the system under test, the system under test is divided into at least one test business module; Based on the importance of each test business module, the test mode for each test business module is determined; wherein, the test mode includes a fully automatic test mode and a semi-automatic test mode; Based on the test process acquisition strategy corresponding to the test mode of each test business module, determine at least one target test process group corresponding to each test business module, and determine the test case link and process group execution order of the at least one target test process group; Based on the execution order of the process groups of each target test process group corresponding to each test business module, the test case chain of the corresponding target test process group is invoked to test the system under test. Before testing the system under test by invoking the test case chain of the corresponding target test process group according to the execution order of each target test process group corresponding to each test business module, the method further includes: For a test business module in semi-automatic testing mode, if the number of target test process groups corresponding to the test business module is at least two, then obtain each target test process group corresponding to the test business module. Based on the test code of each test case in the test case chain corresponding to the target test process group, the code duplication between the test codes of each target test process group is calculated through pre-set calculation logic, and the code duplication is used as the correlation between different target test process groups. For a test business module containing only two test process groups, if the correlation between the two test process groups exceeds the correlation threshold, the two test process groups will be executed sequentially according to the pre-obtained process execution order; if the correlation between the two test process groups does not exceed the correlation threshold, only the first test process group in the pre-obtained process execution order will be executed. For test business modules containing at least three test process groups, only test process group pairs with a correlation degree exceeding the correlation degree threshold are retained, and the retained test process groups are executed sequentially according to the pre-obtained process execution order of the test process groups. The execution order of the target test process group is adjusted based on the degree of correlation between the test process groups.
2. The method of claim 1, wherein, The step of determining at least one target test process group for each test business module based on the test process acquisition strategy corresponding to the test mode of each test business module, and determining the test case chain and process group execution order of the at least one target test process group, includes: Based on the test process acquisition strategy corresponding to the test mode of each test business module, determine at least one target test process group and the execution order of the process group of the at least one target test process group for each test business module. From the process group use case relationship table, find the test case links for each target test process group corresponding to each test business module.
3. The method of claim 2, wherein, The step of determining at least one target test process group and the execution order of the process groups corresponding to each test business module based on the test process acquisition strategy corresponding to the test mode of each test business module includes: For test business modules in semi-automatic testing mode, candidate test process groups are displayed to the user, and at least one target test process group corresponding to the test business module selected by the user based on the candidate test process groups and the execution order of the process groups of the at least one target test process group are obtained.
4. The method of claim 2, wherein, The step of determining at least one target test process group and the execution order of the process groups corresponding to each test business module based on the test process acquisition strategy corresponding to the test mode of each test business module includes: For test business modules in fully automated testing mode, find at least one target test process group and the execution order of the process group corresponding to the test business module from the module process group relationship table.
5. The method of claim 2, wherein, The method further includes: The test process content in the candidate test process group is parsed using a content parsing model to obtain the test case link corresponding to the candidate test process group. Based on the test case links corresponding to the candidate test process groups, construct a test case relationship table for the process groups.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: Obtain test logs of the test cases that call each test business module to test the system under test; The test logs are cleaned and integrated to generate a test report for the system under test.
7. A system test apparatus, characterized by, The device includes: The business segmentation module is used to divide the system under test into at least one test business module based on the functional type of the system under test; The mode determination module is used to determine the test mode for each test business module based on the importance of each test business module; among which, the test modes include fully automatic test mode and semi-automatic test mode; The strategy determination module is used to obtain the strategy based on the test process corresponding to the test mode of each test business module, determine at least one target test process group for each test business module, and determine the test case link and process group execution order of at least one target test process group. The testing module is used to call the test case chain of the corresponding target test process group according to the execution order of the process group of each target test process group corresponding to each test business module, and to test the system under test. The correlation determination module is used for testing business modules in semi-automatic testing mode. If the number of target test process groups corresponding to the test business module is at least two, then the module obtains each target test process group corresponding to the test business module. Based on the test code of each test case in the test case chain corresponding to the target test process group, the code duplication between the test codes of each target test process group is calculated through pre-set calculation logic, and the code duplication is used as the correlation between different target test process groups. The process group adjustment module is used for test business modules that contain only two test process groups. If the correlation between the two test process groups exceeds the correlation threshold, the two test process groups will be executed sequentially according to the pre-obtained process execution order. If the correlation between the two test process groups does not exceed the correlation threshold, only the first test process group in the pre-obtained process execution order will be executed. For test business modules containing at least three test process groups, only test process group pairs with a correlation degree exceeding the correlation degree threshold are retained, and the retained test process groups are executed sequentially according to the pre-obtained process execution order of the test process groups. The execution order of the target test process group is adjusted based on the degree of correlation between the test process groups.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The steps of implementing the method of any one of claims 1 to 6 when the processor executes a computer program.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, When a computer program is executed by a processor, it implements the steps of the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Method for rapidly selecting automatic test case
CN103605612A
Software system testing method and device, terminal equipment and storage medium
CN113238930A