Test method, device and equipment and readable storage medium

By obtaining multiple configuration items of the target software, determining the forward and reverse test paths, and combining the association relationship, the problem of low accuracy in traditional software testing is solved, and higher test accuracy and comprehensiveness are achieved.

CN119292935APending Publication Date: 2025-01-10DAWNING NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411442370.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

Due to the lack of reverse test cases, traditional software testing methods have low test accuracy and do not consider the association between configuration items, so the generated test cases are insufficient.

Method used

By acquiring multiple configuration items of the target software, the first test path and the second test path are determined, the first test path is used for forward testing, and the second test path is used for reverse testing, and the two are combined to improve the accuracy of the test, Generate test paths considering the association between configuration items.

Benefits of technology

It improves the accuracy of software testing, avoids the low accuracy problems caused by the lack of reverse test cases in traditional methods, and improves the comprehensiveness and accuracy of the test through the comprehensive correlation relationship generation test path.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292935A_ABST
    Figure CN119292935A_ABST
Patent Text Reader

Abstract

The invention relates to a test method, device and equipment and a readable storage medium. The method comprises the steps that a plurality of configuration items corresponding to target software are obtained, a first test path and a second test path are determined according to the configuration items, the target software can be tested according to the first test path and the second test path, a target test result is obtained, each configuration item comprises effective configuration and invalid configuration, and each configuration item comprises effective configuration and invalid configuration. The first test path comprises a first test node corresponding to the valid configuration, and the second test path comprises the first test node corresponding to the valid configuration and a second test node corresponding to the invalid configuration. By adopting the method, the test accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of software testing, and in particular to a testing method, apparatus, device and readable storage medium. Background Art

[0002] When testing software, it is usually necessary to generate test cases in advance. The test cases may include normal data, edge data, and error data. Using test cases to test software can ensure the effectiveness of the test.

[0003] Traditional testing methods usually generate a test case corresponding to a test item according to the numerical range corresponding to the test item, and then perform software testing based on the test case.

[0004] However, the above test method has the problem of low test accuracy. Summary of the invention

[0005] Based on this, it is necessary to provide a testing method, device, equipment and readable storage medium that can improve the testing accuracy in response to the above technical problems.

[0006] In a first aspect, the present application provides a testing method, comprising:

[0007] Obtain multiple configuration items corresponding to the target software, each configuration item includes a valid configuration and an invalid configuration;

[0008] Determine a first test path and a second test path according to each configuration item, wherein the first test path includes a first test node corresponding to a valid configuration, and the second test path includes a first test node corresponding to a valid configuration and a second test node corresponding to an invalid configuration;

[0009] The target software is tested according to the first test path and the second test path to obtain a target test result.

[0010] In the above embodiment, a valid configuration and an invalid configuration corresponding to each configuration item are generated, and then a test path for testing is generated according to each configuration item, wherein the first test path is used for forward testing, including a first test node corresponding to the valid configuration, and the second test path can be used for reverse testing, including a second test node corresponding to the invalid configuration. When testing the target software, both forward testing based on the first test path and reverse testing based on the second test path can be performed on the software. The testing angle is more comprehensive, avoiding the problem of low test accuracy caused by the lack of reverse test cases in traditional technology. The testing method provided by the present technical solution has higher accuracy.

[0011] In one embodiment, determining the first test path and the second test path according to each configuration item includes:

[0012] Get the relationship between configuration items;

[0013] According to the association relationship and each configuration item, a first test path and a second test path are determined.

[0014] In this way, each test path is obtained by integrating the associations between the configuration items, avoiding the problem of low accuracy of test cases generated by traditional technologies that do not take into account the associations between the configuration items. The test paths generated based on this proposal are more accurate during testing.

[0015] In one embodiment, determining the first test path and the second test path according to the association relationship and each configuration item includes:

[0016] Generate a configuration item flow chart based on the association relationship and each configuration item. The configuration item flow chart includes multiple configuration item nodes and the hierarchical relationship between the configuration item nodes. Each configuration item node corresponds to each configuration item.

[0017] At least one first test path is generated according to the configuration item flowchart, and at least one second test path is generated according to the configuration item flowchart.

[0018] In this way, the configuration item flowchart is first generated according to the association relationship, and then the first test path and the second test path are generated according to the configuration item flowchart, and the generation process is clearer.

[0019] In one embodiment, generating at least one first test path according to a configuration item flow chart includes:

[0020] For each first test path, each configuration item node in the configuration item flow chart is traversed in turn according to a preset traversal order, a first valid configuration is determined from the configuration item node, and a first test path is generated according to each first valid configuration.

[0021] In this way, each configuration item node is traversed to determine the first valid configuration in the first test path, which effectively avoids the omission of configuration items.

[0022] In one embodiment, determining a first valid configuration from a configuration item node includes:

[0023] In the case where the configuration item node includes a valid configuration that is not covered by other test paths, taking the valid configuration as the first valid configuration;

[0024] In the case where the configuration item node includes multiple valid configurations that are not covered by other test paths, any one of the multiple valid configurations is used as the first valid configuration;

[0025] When multiple valid configurations included in the configuration item node are all covered by other test paths, a first valid configuration is determined from the multiple valid configurations according to weights of the multiple valid configurations.

[0026] In this way, the server can avoid the same valid configuration being selected multiple times, which would cause the obtained first test path to be repeated, thereby reducing the waste of test resources.

[0027] In one embodiment, generating a first test path according to each first valid configuration includes:

[0028] The first configuration identifier of each first valid configuration is used as each first test node, and each first test node is sorted according to a first preset sorting order to obtain a first test path. The first preset sorting order is related to the flow order of each first valid configuration in the configuration item flow chart.

[0029] In this way, the obtained first test path integrates the first valid configuration and the association relationship between the configuration items in multiple dimensions, and the accuracy of the test based on the first test path is higher.

[0030] In one embodiment, generating at least one second test path according to the configuration item flow chart includes:

[0031] For each second test path, each configuration item node in the configuration item flow chart is traversed in turn according to a preset traversal order, a target invalid configuration or a second valid configuration is determined from the configuration item node, and a second test path is generated according to the target invalid configuration and each second valid configuration.

[0032] In the above embodiment, each configuration item node is traversed to determine the target invalid configuration or the second valid configuration in the second test path, thereby avoiding omission of configuration items.

[0033] In one embodiment, determining a target invalid configuration or a second valid configuration from a configuration item node includes:

[0034] When a configuration item node includes an invalid configuration that is not covered by other test paths, and the current traversal process does not determine the target invalid configuration, an invalid configuration is used as the target invalid configuration;

[0035] When the configuration item node includes multiple invalid configurations that are not covered by other test paths, and the current traversal process does not determine the target invalid configuration, any invalid configuration among the multiple invalid configurations is used as the target invalid configuration;

[0036] When multiple invalid configurations included in the configuration item node are covered by other test paths, and / or the current traversal process has determined the target invalid configuration, a second valid configuration is determined from the multiple valid configurations according to the weights of the multiple valid configurations included in the configuration item node.

[0037] In this way, the server can ensure that each second test path includes only one test node corresponding to an invalid configuration, so that the expected expectation corresponding to the second test path can be set more conveniently.

[0038] In one embodiment, generating a second test path according to the target invalid configuration and each second valid configuration includes:

[0039] The second configuration identifier of the target invalid configuration and the third configuration identifier of each second valid configuration are used as each second test node, and each second test node is sorted according to a second preset sorting order to obtain a second test path. The second preset sorting order is related to the process order of the target invalid configuration and each second valid configuration in the configuration item flow chart.

[0040] In this way, the obtained second test path integrates the target invalid configuration, the second valid configuration and the association relationship between the configuration items in a multi-dimensional manner, and the accuracy of the test based on the second test path is higher.

[0041] In one embodiment, testing the target software according to the first test path and the second test path to obtain the target test result includes:

[0042] For the target test path in the first test path and the second test path, according to each test node included in the target test path, obtain the target configuration item corresponding to each test node from the configuration item flow chart;

[0043] Generate test cases according to each target configuration item, execute the test cases, and obtain the test results corresponding to the target test path;

[0044] Determine the target test result based on the test results corresponding to each target test path.

[0045] In this way, the test cases are generated based on the forward first test path or the reverse second test path, and the types of test cases are more abundant.

[0046] In one embodiment, determining the target test result according to the test results corresponding to each target test path includes:

[0047] When the target test path is the first test path, comparing the test result corresponding to the target test path with the first expected test result to obtain a first comparison result;

[0048] When the target test path is the second test path, the test result corresponding to the target test path is compared with the second expected test result and the test failure reason to obtain a second comparison result;

[0049] If both the first comparison result and the second comparison result are comparison successes, the target test result is determined to be a test pass.

[0050] In this way, the first test path is used to perform a forward test, and the second test path is used to perform a reverse test. The target test result finally obtained integrates the test results of multiple test directions, and the test accuracy is higher.

[0051] In a second aspect, the present application also provides a testing device, comprising:

[0052] An acquisition module is used to acquire multiple configuration items corresponding to the target software, each configuration item including a valid configuration and an invalid configuration;

[0053] A path determination module, used to determine a first test path and a second test path according to each configuration item, wherein the first test path includes a first test node corresponding to a valid configuration, and the second test path includes a first test node corresponding to a valid configuration and a second test node corresponding to an invalid configuration;

[0054] The test module is used to test the target software according to the first test path and the second test path to obtain the target test result.

[0055] In a third aspect, an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method of the first aspect when executing the computer program.

[0056] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method of the first aspect described above.

[0057] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method in the first aspect are implemented.

[0058] The above-mentioned test method, device, equipment and readable storage medium can test the target software according to the first test path and the second test path by obtaining multiple configuration items corresponding to the target software, and determining the first test path and the second test path according to each configuration item, and obtain the target test result, wherein each configuration item includes a valid configuration and an invalid configuration, the first test path includes a first test node corresponding to the valid configuration, and the second test path includes a first test node corresponding to the valid configuration and a second test node corresponding to the invalid configuration. In this way, the corresponding valid configuration and invalid configuration are generated for each configuration item, and then the test path for testing is generated according to each configuration item, wherein the first test path is used for forward testing, including the first test node corresponding to the valid configuration, and the second test path can be used for reverse testing, including the second test node corresponding to the invalid configuration. When testing the target software, it is possible to obtain a forward test based on the first test path and a reverse test based on the second test path. The test angle is more comprehensive, avoiding the problem of low test accuracy caused by the lack of reverse test cases in the traditional technology of using test cases generated according to the numerical range corresponding to a test item to test software. The test method provided by the technical solution has higher accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0060] Figure 1 An application environment diagram of a test method in an embodiment;

[0061] Figure 2 A schematic diagram of a test method in one embodiment;

[0062] Figure 3 is a flow chart of step 202 in another embodiment;

[0063] Figure 4 is an exemplary configuration item flow chart in another embodiment;

[0064] Figure 5 is an exemplary configuration item flow chart in another embodiment;

[0065] Figure 6 A flowchart diagram of an exemplary process of generating at least one first test path according to a configuration item flowchart in another embodiment;

[0066] Figure 7 A structural diagram for generating a first test path in another embodiment;

[0067] Figure 8 A flowchart diagram of an exemplary process of generating at least one second test path according to a configuration item flowchart in another embodiment;

[0068] Fig. 9 generating a structural diagram of a second test path for another embodiment;

[0069] Fig.10 A schematic flow chart of a process of testing target software according to a first test path and a second test path to obtain a target test result in another embodiment;

[0070] Fig.11 An exemplary test method in one embodiment;

[0071] Fig.12 is a structural block diagram of a testing device in one embodiment;

[0072] Fig.13 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0073] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0074] When testing software, it is usually necessary to generate test cases in advance. The test cases may include normal data, edge data, and error data. Using test cases to test software can ensure the effectiveness of the test.

[0075] Traditional test case generation methods usually target a test item and generate a test case corresponding to the test item based on the numerical range corresponding to the test item, such as equivalence class partitioning method, boundary value analysis method, error conjecture method, etc. However, most of the test cases generated by these methods are positive valid test cases, and lack negative invalid test cases. Testing using test cases generated by these methods will result in low test accuracy.

[0076] In addition, the above test case generation methods usually only generate corresponding test cases for an independent test item. However, in actual usage scenarios, there are certain correlations between the test items. If testing is performed based on the test cases generated by these methods, the accuracy of the test will be further reduced.

[0077] In view of this, the present application provides a testing method, device, equipment and readable storage medium, by obtaining multiple configuration items corresponding to the target software, and determining the first test path and the second test path according to each configuration item, the target software can be tested according to the first test path and the second test path to obtain the target test result, wherein each configuration item includes a valid configuration and an invalid configuration, the first test path includes a first test node corresponding to the valid configuration, and the second test path includes a first test node corresponding to the valid configuration and a second test node corresponding to the invalid configuration. In this way, for each configuration item, its corresponding valid configuration and invalid configuration are generated, and then, a test path for testing is generated according to each configuration item, wherein the first test path is used for forward testing, including the first test node corresponding to the valid configuration, and the second test path can be used for reverse testing, including the second test node corresponding to the invalid configuration. When testing the target software, both forward testing based on the first test path and reverse testing based on the second test path can be obtained, and the test angle is more comprehensive, avoiding the problem of low test accuracy caused by the lack of reverse test cases in the traditional technology of using test cases generated according to the numerical range corresponding to a test item to test software. The test method provided by the technical solution has higher accuracy.

[0078] The test method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the data storage system can store the data that the server 101 needs to process. The data storage system can be integrated on the server 101, or it can be placed on the cloud or other network servers. The server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0079] In an exemplary embodiment, Figure 2 As shown, a test method is provided, which is applied to Figure 1 The server 101 in the example is used as an example to illustrate, including the following steps 201 to 203. Among them:

[0080] Step 201, obtaining multiple configuration items corresponding to the target software.

[0081] The target software can be the software to be tested. In the embodiment of the present application, multiple test items can be set from multiple dimensions to test the target software. The test items can be configuration items. The configuration items can be set according to the actual application scenarios, for example, including connection method, serial port number, baud rate, data bit, parity bit, stop bit, connection mode, server IP, server port, connection timeout, reply timeout, slave address, function code, request address, number of requests, scan time, etc.

[0082] Regarding the acquisition of configuration items, optionally, the server can acquire the configuration items input by the user through an external input device, and optionally, the server can directly obtain the configuration items corresponding to the target software from a database.

[0083] In the embodiment of the present application, each configuration item includes a valid configuration and an invalid configuration. The configuration may be specific data corresponding to each configuration item. For example, when the configuration item is a serial port number, the configuration may be a minimum serial port number of 1, a maximum serial port number of 5, a non-existent serial port number of -1, an exceeded serial port number of 6, etc.

[0084] A valid configuration is correct data that meets the actual application requirements of the configuration item, and an invalid configuration is erroneous data that does not meet the actual application requirements of the configuration item. For example, when the configuration item is a serial port number, a valid configuration may be a minimum serial port number of 1 and a maximum serial port number of 5, and an invalid configuration may be a non-existent serial port number of -1 and an exceeded serial port number of 6.

[0085] In a possible implementation, the valid configuration and invalid configuration corresponding to each configuration item may be set according to an actual application scenario. Optionally, the server may obtain the numerical range corresponding to each configuration item, and then generate the valid configuration (data within the numerical range) and invalid configuration (data outside the numerical range) corresponding to the configuration item based on the numerical range according to a preset method, such as a boundary value method or an equivalence class partitioning method; optionally, the server may input the numerical range corresponding to each configuration item and each configuration item into a pre-trained model, thereby obtaining the valid configuration and invalid configuration corresponding to each configuration item output by the model.

[0086] Step 202: Determine a first test path and a second test path according to each configuration item.

[0087] In an embodiment of the present application, the server can generate a first test path for forward testing based on various configuration items, and the first test path includes a first test node corresponding to the valid configuration; it can also generate a second test path for reverse testing, and the second test path includes a first test node corresponding to the valid configuration and a second test node corresponding to the invalid configuration. The direction of each path can represent the order of the test.

[0088] In a possible implementation, the server may randomly select configurations from various configuration items, and then sort the configurations to obtain corresponding test paths.

[0089] In another possible implementation, the order of testing may be related to the association between the configuration items. In the embodiment of the present application, there may be an association between the configuration items, and the association may be a progressive relationship, for example, when the configuration corresponding to the configuration item connection mode is a serial port, there will be a serial port configuration item; or the association may be a parallel relationship, such as a serial port number and a baud rate; the configurations included in the same configuration item also have an association, that is, a parallel relationship.

[0090] In order to improve the accuracy of the test, in an embodiment of the present application, the server can use the valid configuration as the first test stage and the invalid configuration as the second test node. Then, the server can determine the association between the configuration items and determine the test direction according to the association between the configuration items, that is, the sequence between the test nodes, and finally obtain the test path.

[0091] Optionally, the server may first generate a configuration item flowchart according to the association relationship between the configuration items, and then generate a configuration flowchart corresponding to each configuration based on the configuration item flowchart. According to the configuration flowchart, the server may determine the sequence between the test nodes.

[0092] Step 203: Test the target software according to the first test path and the second test path to obtain a target test result.

[0093] In an embodiment of the present application, the server may perform software testing according to the configuration corresponding to the test nodes included in each test path, thereby obtaining a target test result.

[0094] Optionally, each test node may include a configuration identifier corresponding to each configuration. After obtaining the test path, the server may determine the configuration corresponding to the test node based on the configuration identifier included in each test node, and then perform testing based on the configuration; optionally, each test node may directly include its corresponding configuration. After obtaining the test path, the server may perform testing based on the configuration included in each test node.

[0095] In one possible implementation, the server may set different expected results for different test paths. For example, since the first test path includes a first test node corresponding to a valid configuration, the server may set the expected result corresponding to the first test path to test pass. Correspondingly, since the second test path also includes a second test node corresponding to an invalid configuration, the server may set the expected result corresponding to the second test path to test failure. In addition, the server may also include the invalid configuration corresponding to the second test node in the second test path as the cause of failure in the expected result.

[0096] In an embodiment of the present application, the target test result can be used to characterize whether the target software has successfully passed the test. If the test result obtained by the server when testing based on the first test path is a passed test, and the test result obtained when testing based on the second test path is a failed test, then the server can determine that the target test result is that the software has successfully passed the test; otherwise, the server can determine that the target test result is that the software has failed the test.

[0097] In the above embodiment, a valid configuration and an invalid configuration corresponding to each configuration item are generated, and then a test path for testing is generated according to each configuration item, wherein the first test path is used for forward testing, including a first test node corresponding to the valid configuration, and the second test path can be used for reverse testing, including a second test node corresponding to the invalid configuration. When testing the target software, both forward testing based on the first test path and reverse testing based on the second test path can be performed on the software. The testing angle is more comprehensive, avoiding the problem of low test accuracy caused by the lack of reverse test cases in traditional technology. The testing method provided by the present technical solution has higher accuracy.

[0098] In one embodiment, based on the above embodiment, see Figure 3 This embodiment relates to a process of determining a first test path and a second test path according to each configuration item. Figure 3 As shown, step 202 may include step 301 and step 302.

[0099] Step 301: Obtain the association relationship between configuration items.

[0100] Step 302: Determine a first test path and a second test path according to the association relationship and each configuration item.

[0101] In the embodiment of the present application, there may be an association relationship between the configuration items. The association relationship may include a hierarchical relationship, a parallel relationship, and a progressive relationship. The association relationship can be said to be set according to the actual application scenario.

[0102] Optionally, the server may obtain the association relationship corresponding to each input configuration item through an external device; optionally, the server may directly obtain the association relationship corresponding to each configuration item from a database.

[0103] In the embodiments of the present application, each configuration item may be at a different level due to the actual application scenario. For example, the level may be a data link layer, a transport layer, and an application layer, etc. Therefore, there is a hierarchical relationship between the configuration items.

[0104] There may be a parallel relationship between configuration items at the same level, which may be a coexistence parallel relationship or an opposition parallel relationship, and there may be a progressive relationship between configuration items at different levels.

[0105] Exemplarily, the configuration items may include connection mode, serial port number, baud rate, data bit, parity bit, stop bit, connection mode, server IP, server port, connection timeout, reply timeout, slave address, function code, request address, request quantity, and scan time.

[0106] These configuration items can be divided into different levels according to the TCP / IP model. The data link layer includes the connection mode, the transport layer includes the serial port number, baud rate, data bit, parity bit, stop bit, connection mode, server IP, server port, and the application layer may include connection timeout, reply timeout, slave address, function code, request address, request quantity, and scan time.

[0107] There is a natural progressive relationship between different layers. For example, the configuration items included in the data link layer may be followed by configuration items included in the transport layer, and the postscript configuration items corresponding to the configuration items included in the transport layer may be configuration items included in the application layer.

[0108] For each level, there is a coexistence and parallel relationship, or an opposition and parallel relationship between the configuration items. For example, in the transport layer, the serial port number, baud rate, data bit, parity bit, stop bit, and connection mode are in a coexistence and parallel relationship, and the server IP and server port are in a coexistence and parallel relationship, while the serial port number, baud rate, data bit, parity bit, stop bit, connection mode and the server IP and server port are in an opposition and coexistence relationship.

[0109] There may also be a progressive relationship between the configuration items corresponding to different levels, that is, some configuration items may exist based on the configuration corresponding to certain configuration items of the previous level, for example, the serial port number, baud rate, data bit, parity bit, stop bit, and connection mode in the transport layer exist only when the connection mode in the data link layer is a serial port, while some configuration items are irrelevant to the configuration of the configuration items of the previous level, for example, the connection timeout, reply timeout, slave address, function code, request address, request quantity, and scan time in the application layer have no progressive relationship with any configuration item in the transport layer. In the same level, there may be configuration items that exist based on the configuration corresponding to certain configuration items of the previous level and configuration items that are irrelevant to the configuration of the configuration items of the previous level. In order to facilitate distinction, the configuration items that exist based on the configuration corresponding to certain configuration items of the previous level are marked as unique configuration items, and the configuration items that are irrelevant to the configuration of the configuration items of the previous level are marked as shared configuration items.

[0110] After the server obtains the association relationship corresponding to each configuration item, the server can determine the first test path and the second test path according to the association relationship and each configuration item. In a possible implementation, the server can generate a configuration item flowchart according to the association relationship and each configuration item, and then generate at least one first test path according to the configuration item flowchart, and generate at least one second test path according to the configuration item flowchart, wherein the configuration item flowchart includes multiple configuration item nodes and a hierarchical relationship between each configuration item node, and each configuration item node corresponds to each configuration item.

[0111] In the embodiment of the present application, a configuration item node can be generated according to each configuration item, and then a configuration item flow chart can be generated according to the association relationship between the configuration items. For example, refer to Figure 4 , which is a configuration item flow chart generated by taking the configuration items including connection mode, serial port number, baud rate, data bit, parity bit, stop bit, connection mode, server IP, server port, connection timeout, reply timeout, slave address, function code, request address, request quantity, and scan time as an example.

[0112] In a possible implementation, each configuration item node may include valid configurations and invalid configurations corresponding to the configuration item, and the configuration item flow chart may refer to Figure 5 .

[0113] After obtaining the configuration item flowchart, the server can generate a first test path that only includes valid configurations and a second test path that includes invalid configurations according to the configuration item flowchart. In this way, the configuration item flowchart is first generated according to the association relationship, and then the first test path and the second test path are generated according to the configuration item flowchart, and the generation process is clearer.

[0114] In the above embodiment, each test path is obtained by integrating the association relationship between each configuration item, avoiding the problem of low accuracy of test cases generated by traditional technology without considering the association relationship between each configuration item. The test path generated based on this proposal is more accurate during testing.

[0115] In one embodiment, based on the above embodiment, see Figure 6 This embodiment relates to a process of generating at least one first test path according to a configuration item flow chart. Figure 6 As shown, the process may include step 601 and step 602 .

[0116] Step 601: for each first test path, traverse each configuration item node in the configuration item flow chart in turn according to a preset traversal order, and determine a first valid configuration from the configuration item nodes.

[0117] Since the first test path is a path used for forward testing, which only includes valid configurations, in a possible implementation, the server can traverse each configuration item node according to the direction indicated by the flowchart. In the embodiment of the present application, the configuration item node includes valid configurations and invalid configurations corresponding to the configuration item. Therefore, for a configuration item node, the server can select the first valid configuration that constitutes the current first test path.

[0118] Regarding the process of the server determining the first valid configuration, optionally, when the configuration item node includes a valid configuration that is not covered by other test paths, the server may use a valid configuration as the first valid configuration; optionally, when the configuration item node includes multiple valid configurations that are not covered by other test paths, the server may use any one of the multiple valid configurations as the first valid configuration; optionally, when the multiple valid configurations included in the configuration item node are all covered by other test paths, the server determines the first valid configuration from the multiple valid configurations according to the weights of the multiple valid configurations.

[0119] Reference Figure 7 , which is a schematic diagram of generating the first test path, wherein the numbers in the boxes (such as 1.1, 2.1, etc.) are identifiers of each configuration, wherein the same ones place represents the same configuration item, such as 2.2 and 2.3 are different configurations corresponding to the same configuration item, the solid line box corresponds to the valid configuration, and the dotted line box corresponds to the invalid configuration.

[0120] Exemplarily, the server traverses to configuration item 2 and can detect whether 2.1 and 2.2 are covered by other first test paths. If neither is covered, the server can randomly select 2.1 or 2.2 as the first valid configuration corresponding to the current configuration item. If 2.2 is not covered, 2.2 can be selected as the first valid configuration. If both are covered, the server can select one of them as the first valid configuration based on the preset weights corresponding to 2.1 and 2.2. Optionally, the server can directly select the valid configuration with the largest weight as the first valid configuration; optionally, the server can determine the selected first valid configuration based on the ratio of the number of other generated first test paths including 2.1 or 2.2, and then based on whether the ratio of the number satisfies the ratio of the preset weights corresponding to 2.1 and 2.2.

[0121] In this way, the server can avoid the same valid configuration being selected multiple times, which would cause the obtained first test path to be repeated, thereby reducing the waste of test resources.

[0122] Step 602: Generate a first test path according to each first valid configuration.

[0123] After obtaining the first valid configuration corresponding to each configuration item, the server can generate a corresponding first test path. In a possible implementation, the server can use the first configuration identifier of each first valid configuration as each first test node, and sort each first test node according to a first preset sorting order to obtain the first test path.

[0124] In the embodiment of the present application, the first preset sorting order is related to the process order of each first valid configuration in the configuration item flowchart, that is, the server can sort the first valid configurations corresponding to each configuration item according to the process order of each configuration item in the configuration item flowchart, referring to Figure 7 , exemplarily, the first test path obtained includes 5 paths, namely:

[0125] Article 1: 1.1->2.1->3.1->4.1->5.1->6.1->7.1->10.1->11.1->12.1->13.1->14.1->15.1->16.1; Article 2: 1.1->2.2->3.2->4.2->5.2->6.2->7.2->10.1->11.1->12.2->13.2->14.1->15.1->16.2; Article 3: 1.1->2.2->3.2->4 .2->5.3->6.2->7.2->10.1->11.1->12.1->13.1->14.1->15.1->16.1; Article 4: 1.2->8.1->9.1->10.1->11.1->12.1->13.1->14.1->15.1->16.1; Article 5: 1.3->8.1->9.1->10.1->11.1->12.2->13.2->14.1->15.1->16.2.

[0126] In this way, the obtained first test path integrates the first valid configuration and the association relationship between the configuration items in multiple dimensions, and the accuracy of the test based on the first test path is higher.

[0127] In the above embodiment, each configuration item node is traversed to determine the first valid configuration in the first test path, thereby avoiding omission of configuration items.

[0128] In one embodiment, based on the above embodiment, see Figure 8 This embodiment relates to a process of generating at least one second test path according to a configuration item flow chart. Figure 8 As shown, the process may include step 801 and step 802.

[0129] Step 801: for each second test path, traverse each configuration item node in the configuration item flow chart in turn according to a preset traversal order, and determine a target invalid configuration or a second valid configuration from the configuration item nodes.

[0130] Since the second test path is a path used for reverse testing, which includes the first test phase corresponding to the valid configuration and the second test node corresponding to the invalid configuration, in a possible implementation, the server can traverse each configuration item node according to the direction indicated by the flowchart. Since the configuration item node includes the valid configuration and invalid configuration corresponding to the configuration item, for a configuration item node, the server can select the second valid configuration or the target invalid configuration that constitutes the current second test path.

[0131] In a possible implementation, in order to facilitate setting the expected expectation corresponding to the second test path, the second test path only includes a node corresponding to an invalid configuration. Regarding the process of the server determining the target invalid configuration or the second valid configuration from the configuration item node, optionally, when the configuration item node includes an invalid configuration that is not covered by other test paths and the current traversal process has not determined the target invalid configuration, the server may use an invalid configuration as the target invalid configuration; optionally, when the configuration item node includes multiple invalid configurations that are not covered by other test paths and the current traversal process has not determined the target invalid configuration, the server may use any one of the multiple invalid configurations as the target invalid configuration; optionally, when the multiple invalid configurations included in the configuration item node are all covered by other test paths, and / or the current traversal process has determined the target invalid configuration, the server may determine the second valid configuration from the multiple valid configurations according to the weights of the multiple valid configurations included in the configuration item node.

[0132] In an embodiment of the present application, when the server traverses to a certain configuration item, it will first detect whether the target invalid configuration has been determined in the current second test path. If not, it will detect whether there is an uncovered invalid configuration in the current configuration item. If so, any invalid configuration will be selected as the target invalid configuration. If not, the server can determine the second valid configuration from multiple valid configurations based on the weights of the multiple valid configurations included in the configuration item node, and traverse the next configuration item node.

[0133] Reference Fig. 9 , which is a schematic diagram of generating the second test path, wherein the numbers in the boxes (such as 1.1, 2.1, etc.) are identifiers of each configuration, wherein the same ones place represents the same configuration item, such as 2.2 and 2.3 are different configurations corresponding to the same configuration item, the solid line box corresponds to the valid configuration, and the dotted line box corresponds to the invalid configuration.

[0134] Exemplarily, the server traverses to configuration item No. 3 and can detect whether the target invalid configuration, such as 2.3 or 2.4, already exists in the current path. If not, the server can determine the target invalid configuration from 3.3, 3.4, and 3.5. At this time, the server can detect whether 3.3, 3.4, and 3.5 are covered by other second test paths. If not, the server can select one of them as the target invalid configuration. If all are covered, the server can select 3.1 or 3.2 as the second valid configuration corresponding to configuration item No. 3 based on the corresponding weights of 3.1 and 3.2, and then traverse configuration item No. 4.

[0135] In this way, the server can ensure that each second test path includes only one test node corresponding to an invalid configuration, so that the expected expectation corresponding to the second test path can be set more conveniently.

[0136] This avoids the same valid configuration being selected multiple times, resulting in duplication of the first test path obtained, thereby reducing the waste of test resources.

[0137] Step 802: Generate a second test path according to the target invalid configuration and each second valid configuration.

[0138] After obtaining the second valid configuration or the target invalid configuration corresponding to each configuration item, the server can generate a corresponding second test path. In one possible implementation, the server can use the second configuration identifier of the target invalid configuration as each second test node, and the third configuration identifier of each second valid configuration as the first test node, sort the first test nodes and the second test nodes according to the second preset sorting order, and obtain the second test path.

[0139] In the embodiment of the present application, the second preset sorting order is related to the process order of the target invalid configuration and each second valid configuration in the configuration item flowchart, that is, the server can sort the corresponding second valid configuration or target invalid configuration according to the process order of each configuration item in the configuration item flowchart, referring to Fig. 9 , exemplarily, the obtained second test paths include 28 paths, namely:

[0140] [1]:1.1->2.3->3.1->4.1->5.1->6.1->7.1->10.1->11.1->12.1->13.1->14.1->15.1->16.1;

[0141] [2]:1.1->2.4->3.1->4.1->5.1->6.1->7.1->10.1->11.1->12.1->13.1->14.1->15.1->16.1;

[0142] [3]:1.1->2.1->3.3->4.1->5.1->6.1->7.1->10.1->11.1->12.1->13.1->14.1->15.1->16.1;

[0143] [4]:1.1->2.1->3.4->4.1->5.1->6.1->7.1->10.1->11.1->12.1->13.1->14.1->15.1->16.1;

[0144] [5]:1.1->2.1->3.5->4.1->5.1->6.1->7.1->10.1->11.1->12.1->13.1->14.1->15.1->16.1;

[0145] [6]:1.1->2.1->3.1->4.3->5.1->6.1->7.1->10.1->11.1->12.1->13.1->14.1->15.1->16.1;

[0146] [7]:1.1->2.1->3.1->4.4->5.1->6.1->7.1->10.1->11.1->12.1->13.1->14.1->15.1->16.1;

[0147] [8]:1.1->2.1->3.1->4.1->5.4->6.1->7.1->10.1->11.1->12.1->13.1->14.1->15.1->16.1;

[0148] [9]:1.1->2.1->3.1->4.1->5.5->6.1->7.1->10.1->11.1->12.1->13.1->14.1->15.1->16.1;

[0149]

[10] :1.1->2.1->3.1->4.1->5.6->6.1->7.1->10.1->11.1->12.1->13.1->14.1->15.1->16.1;

[0150]

[11] :1.1->2.1->3.1->4.1->5.1->6.3->7.1->10.1->11.1->12.1->13.1->14.1->15.1->16.1;

[0151]

[12] :1.1->2.1->3.1->4.1->5.1->6.4->7.1->10.1->11.1->12.1->13.1->14.1->15.1->16.1;

[0152]

[13] :1.1->2.1->3.1->4.1->5.1->6.1->7.3->10.1->11.1->12.1->13.1->14.1->15.1->16.1;

[0153]

[14] :1.1->2.1->3.1->4.1->5.1->6.1->7.4->10.1->11.1->12.1->13.1->14.1->15.1->16.1;

[0154]

[15] :1.2->8.2->9.1->10.1->11.1->12.1->13.1->14.1->15.1->16.1;

[0155]

[16] :1.2->8.1->9.2->10.1->11.1->12.1->13.1->14.1->15.1->16.1;

[0156]

[17] :1.2->8.1->9.1->10.2->11.1->12.1->13.1->14.1->15.1->16.1;

[0157]

[18] :1.2->8.1->9.1->10.3->11.1->12.1->13.1->14.1->15.1->16.1;

[0158]

[19] :1.2->8.1->9.1->10.1->11.2->12.1->13.1->14.1->15.1->16.1;

[0159]

[20] :1.2->8.1->9.1->10.1->11.3->12.1->13.1->14.1->15.1->16.1;

[0160]

[21] :1.2->8.1->9.1->10.1->11.1->12.3->13.1->14.1->15.1->16.1;

[0161]

[22] :1.2->8.1->9.1->10.1->11.1->12.4->13.1->14.1->15.1->16.1;

[0162]

[23] :1.2->8.1->9.1->10.1->11.1->12.5->13.1->14.1->15.1->16.1;

[0163]

[24] :1.2->8.1->9.1->10.1->11.1->12.1->13.3->14.1->15.1->16.1;

[0164]

[25] :1.2->8.1->9.1->10.1->11.1->12.1->13.4->14.1->15.1->16.1;

[0165]

[26] :1.2->8.1->9.1->10.1->11.1->12.1->13.1->14.2->15.1->16.1;

[0166]

[27] :1.2->8.1->9.1->10.1->11.1->12.1->13.1->14.1->15.2->16.1;

[0167]

[28] :1.2->8.1->9.1->10.1->11.1->12.1->13.1->14.1->15.1->16.3.

[0168] In this way, the obtained second test path integrates the target invalid configuration, the second valid configuration and the association relationship between the configuration items in a multi-dimensional manner, and the accuracy of the test based on the second test path is higher.

[0169] In the above embodiment, each configuration item node is traversed to determine the target invalid configuration or the second valid configuration in the second test path, thereby avoiding omission of configuration items.

[0170] In one embodiment, based on the above embodiment, see Fig.10 This embodiment involves a process of testing the target software according to the first test path and the second test path to obtain the target test result. Fig.10 As shown, the process may include steps 1001 to 1003.

[0171] Step 1001: for a target test path in a first test path and a second test path, according to each test node included in the target test path, a target configuration item corresponding to each test node is obtained from a configuration item flow chart.

[0172] Step 1002, generating a test case according to each target configuration item, and executing the test case to obtain a test result corresponding to the target test path.

[0173] Step 1003: Determine the target test result according to the test results corresponding to each target test path.

[0174] The target test path can be any first test path or second test path. The target test path includes multiple test nodes. The server can determine the configuration under the target configuration item corresponding to the test node based on the test node, and generate the test case finally used for testing based on the configuration corresponding to the target configuration item.

[0175] In a possible implementation, each test node corresponds to the identifier of the configuration under the target configuration item. The server can determine the target configuration item and the corresponding configuration from the configuration item flow chart according to the identifier included in the test node, and then use the flow direction of the target test path as the test order of each target configuration item, and generate the final test case based on the configuration corresponding to each target configuration item in turn.

[0176] In an embodiment of the present application, the server can execute the test case to obtain the test results corresponding to each target test path, and then the server can determine the target test results based on the test results corresponding to each target test path.

[0177] Optionally, when the target test path is the first test path, the server compares the test result corresponding to the target test path with the first expected test result to obtain a first comparison result; optionally, when the target test path is the second test path, the server compares the test result corresponding to the target test path with the second expected test result and the reason for the test failure to obtain a second comparison result; if both the first comparison result and the second comparison result are successful, the server determines that the target test result is a passed test.

[0178] In an embodiment of the present application, different target test paths correspond to different expected results. Optionally, a first expected test result corresponding to a first test path is a test pass. Optionally, a second expected test result corresponding to a second test path is a test failure. In one possible implementation, the cause of the test failure corresponding to the second test path may be an invalid configuration included in the second test path.

[0179] In this way, the first test path is used to perform a forward test, and the second test path is used to perform a reverse test. The target test result finally obtained integrates the test results of multiple test directions, and the test accuracy is higher.

[0180] In one embodiment, please refer to Fig.11 , which shows a flowchart of an exemplary testing method provided in an embodiment of the present application, which can be applied to Figure 1 In the implementation environment shown.

[0181] Step 1101, obtaining multiple configuration items corresponding to the target software.

[0182] Each configuration item includes a valid configuration and an invalid configuration.

[0183] Step 1102, obtaining the association relationship between the configuration items.

[0184] Step 1103: Generate a configuration item flow chart based on the association relationship and each configuration item.

[0185] The configuration item flow chart includes multiple configuration item nodes and the hierarchical relationship between the configuration item nodes, and each configuration item node corresponds to each configuration item.

[0186] Step 1104: for each first test path, traverse each configuration item node in the configuration item flow chart in turn according to a preset traversal order. If the configuration item node includes a valid configuration that is not covered by other test paths, take the valid configuration as the first valid configuration.

[0187] Step 1105: When the configuration item node includes multiple valid configurations that are not covered by other test paths, any one of the multiple valid configurations is used as a first valid configuration.

[0188] Step 1106: When multiple valid configurations included in the configuration item node are all covered by other test paths, determine a first valid configuration from the multiple valid configurations according to the weights of the multiple valid configurations.

[0189] Step 1107: Use the first configuration identifier of each first valid configuration as each first test node, and sort each first test node according to a first preset sorting order to obtain a first test path.

[0190] The first preset sorting order is related to the process order of each first valid configuration in the configuration item flow chart.

[0191] Step 1108, for each second test path, traverse each configuration item node in the configuration item flow chart in turn according to the preset traversal order. When the configuration item node includes an invalid configuration that is not covered by other test paths and the current traversal process has not determined the target invalid configuration, take an invalid configuration as the target invalid configuration.

[0192] Step 1109: when the configuration item node includes multiple invalid configurations that are not covered by other test paths, and the current traversal process does not determine the target invalid configuration, any invalid configuration among the multiple invalid configurations is used as the target invalid configuration.

[0193] Step 1110, when multiple invalid configurations included in the configuration item node are covered by other test paths, and / or the current traversal process has determined the target invalid configuration, determine a second valid configuration from the multiple valid configurations according to the weights of the multiple valid configurations included in the configuration item node.

[0194] Step 1111: Use the second configuration identifier of the target invalid configuration as each second test node, and use the third configuration identifier of each second valid configuration as the first test node, sort each first test node and second test node according to a second preset sorting order to obtain a second test path.

[0195] The second preset sorting order is related to the target invalid configuration and the process order of each second valid configuration in the configuration item flow chart.

[0196] The first test path includes a first test node corresponding to a valid configuration, and the second test path includes a first test node corresponding to a valid configuration and a second test node corresponding to an invalid configuration.

[0197] Step 1112: for the target test path in the first test path and the second test path, according to each test node included in the target test path, obtain the target configuration item corresponding to each test node from the configuration item flow chart.

[0198] Step 1113, generating a test case according to each target configuration item, and executing the test case to obtain a test result corresponding to the target test path.

[0199] Step 1114: when the target test path is the first test path, compare the test result corresponding to the target test path with the first expected test result to obtain a first comparison result.

[0200] Step 1115 , when the target test path is the second test path, the test result corresponding to the target test path is compared with the second expected test result and the test failure reason to obtain a second comparison result.

[0201] Step 1116: If both the first comparison result and the second comparison result are successful, the target test result is determined to be a test pass.

[0202] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0203] Based on the same inventive concept, the embodiment of the present application also provides a test device for implementing the test method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more test device embodiments provided below can refer to the limitations on the test method above, and will not be repeated here.

[0204] In an exemplary embodiment, Fig.12 As shown, a testing device is provided, including: an acquisition module 1201, a path determination module 1202 and a testing module 1203, wherein:

[0205] The acquisition module 1201 is used to acquire multiple configuration items corresponding to the target software, each of which includes a valid configuration and an invalid configuration;

[0206] A path determination module 1202 is used to determine a first test path and a second test path according to each of the configuration items, wherein the first test path includes a first test node corresponding to a valid configuration, and the second test path includes a first test node corresponding to a valid configuration and a second test node corresponding to an invalid configuration;

[0207] The testing module 1203 is used to test the target software according to the first testing path and the second testing path to obtain a target testing result.

[0208] In one embodiment, the path determination module 1202 includes:

[0209] A relationship acquisition unit, used to acquire the association relationship between the configuration items;

[0210] A determining unit is used to determine the first test path and the second test path according to the association relationship and each of the configuration items.

[0211] In one embodiment, the determining unit is further configured to perform:

[0212] Generate a configuration item flow chart according to the association relationship and each of the configuration items, wherein the configuration item flow chart includes a plurality of configuration item nodes and a hierarchical relationship between the configuration item nodes, and each of the configuration item nodes corresponds to each of the configuration items;

[0213] At least one first test path is generated according to the configuration item flowchart, and at least one second test path is generated according to the configuration item flowchart.

[0214] In one embodiment, the determining unit is further configured to perform:

[0215] For each of the first test paths, each of the configuration item nodes in the configuration item flowchart is traversed in sequence according to a preset traversal order, a first valid configuration is determined from the configuration item nodes, and the first test path is generated according to each of the first valid configurations.

[0216] In one embodiment, the determining unit is further configured to perform:

[0217] In the case where the configuration item node includes a valid configuration that is not covered by other test paths, taking the valid configuration as the first valid configuration;

[0218] In a case where the configuration item node includes multiple valid configurations that are not covered by other test paths, taking any one of the multiple valid configurations as the first valid configuration;

[0219] In a case where multiple valid configurations included in the configuration item node are all covered by other test paths, the first valid configuration is determined from the multiple valid configurations according to weights of the multiple valid configurations.

[0220] In one embodiment, the determining unit is further configured to perform:

[0221] The first configuration identifier of each first valid configuration is used as each first test node, and each first test node is sorted according to a first preset sorting order to obtain the first test path, and the first preset sorting order is related to the process order of each first valid configuration in the configuration item flowchart.

[0222] In one embodiment, the determining unit is further configured to perform:

[0223] For each of the second test paths, each of the configuration item nodes in the configuration item flowchart is traversed in turn according to a preset traversal order, a target invalid configuration or a second valid configuration is determined from the configuration item nodes, and the second test path is generated according to the target invalid configuration and each of the second valid configurations.

[0224] In one embodiment, the determining unit is further configured to perform:

[0225] When the configuration item node includes an invalid configuration that is not covered by other test paths, and the current traversal process does not determine the target invalid configuration, taking the invalid configuration as the target invalid configuration;

[0226] When the configuration item node includes multiple invalid configurations that are not covered by other test paths, and the current traversal process does not determine the target invalid configuration, any one of the multiple invalid configurations is used as the target invalid configuration;

[0227] When multiple invalid configurations included in the configuration item node are all covered by other test paths, and / or the current traversal process has determined the target invalid configuration, the second valid configuration is determined from the multiple valid configurations according to the weights of the multiple valid configurations included in the configuration item node.

[0228] In one embodiment, the determining unit is further configured to perform:

[0229] The second configuration identifier of the target invalid configuration is used as each second test node, and the third configuration identifier of each second valid configuration is used as the first test node, and each first test node and the second test node are sorted according to a second preset sorting order to obtain the second test path. The second preset sorting order is related to the process order of the target invalid configuration and each second valid configuration in the configuration item flow chart.

[0230] In one embodiment, the testing module 1203 includes:

[0231] a target configuration item acquisition unit, configured to acquire, for a target test path in the first test path and the second test path, a target configuration item corresponding to each test node from the configuration item flow chart according to each test node included in the target test path;

[0232] A test case generation unit, configured to generate a test case according to each of the target configuration items, and execute the test case to obtain a test result corresponding to the target test path;

[0233] The target result determination unit is used to determine the target test result according to the test results corresponding to each of the target test paths.

[0234] In one embodiment, the target result determination unit is specifically configured to perform:

[0235] In a case where the target test path is the first test path, comparing the test result corresponding to the target test path with the first expected test result to obtain a first comparison result;

[0236] In the case where the target test path is the second test path, comparing the test result corresponding to the target test path with the second expected test result and the test failure reason to obtain a second comparison result;

[0237] If both the first comparison result and the second comparison result are comparison successes, the target test result is determined to be a test pass.

[0238] Each module in the above-mentioned test device can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.

[0239] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.13 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store test data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a test method is implemented.

[0240] Those skilled in the art will understand that Fig.13 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0241] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0242] Acquire multiple configuration items corresponding to the target software, each of the configuration items including a valid configuration and an invalid configuration;

[0243] Determine a first test path and a second test path according to each of the configuration items, wherein the first test path includes a first test node corresponding to a valid configuration, and the second test path includes a first test node corresponding to a valid configuration and a second test node corresponding to an invalid configuration;

[0244] The target software is tested according to the first test path and the second test path to obtain a target test result.

[0245] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0246] Obtaining the association relationship between the configuration items;

[0247] The first test path and the second test path are determined according to the association relationship and each of the configuration items.

[0248] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0249] Generate a configuration item flow chart according to the association relationship and each of the configuration items, wherein the configuration item flow chart includes a plurality of configuration item nodes and a hierarchical relationship between the configuration item nodes, and each of the configuration item nodes corresponds to each of the configuration items;

[0250] At least one first test path is generated according to the configuration item flowchart, and at least one second test path is generated according to the configuration item flowchart.

[0251] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0252] For each of the first test paths, each of the configuration item nodes in the configuration item flowchart is traversed in sequence according to a preset traversal order, a first valid configuration is determined from the configuration item nodes, and the first test path is generated according to each of the first valid configurations.

[0253] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0254] In the case where the configuration item node includes a valid configuration that is not covered by other test paths, taking the valid configuration as the first valid configuration;

[0255] In a case where the configuration item node includes multiple valid configurations that are not covered by other test paths, taking any one of the multiple valid configurations as the first valid configuration;

[0256] In a case where multiple valid configurations included in the configuration item node are all covered by other test paths, the first valid configuration is determined from the multiple valid configurations according to weights of the multiple valid configurations.

[0257] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0258] The first configuration identifier of each first valid configuration is used as each first test node, and each first test node is sorted according to a first preset sorting order to obtain the first test path, and the first preset sorting order is related to the process order of each first valid configuration in the configuration item flowchart.

[0259] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0260] For each of the second test paths, each of the configuration item nodes in the configuration item flowchart is traversed in turn according to a preset traversal order, a target invalid configuration or a second valid configuration is determined from the configuration item nodes, and the second test path is generated according to the target invalid configuration and each of the second valid configurations.

[0261] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0262] When the configuration item node includes an invalid configuration that is not covered by other test paths, and the current traversal process does not determine the target invalid configuration, taking the invalid configuration as the target invalid configuration;

[0263] When the configuration item node includes multiple invalid configurations that are not covered by other test paths, and the current traversal process does not determine the target invalid configuration, any one of the multiple invalid configurations is used as the target invalid configuration;

[0264] When multiple invalid configurations included in the configuration item node are all covered by other test paths, and / or the current traversal process has determined the target invalid configuration, the second valid configuration is determined from the multiple valid configurations according to the weights of the multiple valid configurations included in the configuration item node.

[0265] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0266] The second configuration identifier of the target invalid configuration is used as each second test node, and the third configuration identifier of each second valid configuration is used as the first test node, and each first test node and the second test node are sorted according to a second preset sorting order to obtain the second test path. The second preset sorting order is related to the process order of the target invalid configuration and each second valid configuration in the configuration item flow chart.

[0267] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0268] For a target test path in the first test path and the second test path, according to each test node included in the target test path, obtaining a target configuration item corresponding to each test node from the configuration item flow chart;

[0269] Generate test cases according to each of the target configuration items, and execute the test cases to obtain test results corresponding to the target test paths;

[0270] The target test result is determined according to the test results corresponding to each of the target test paths.

[0271] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0272] In a case where the target test path is the first test path, comparing the test result corresponding to the target test path with the first expected test result to obtain a first comparison result;

[0273] In the case where the target test path is the second test path, comparing the test result corresponding to the target test path with the second expected test result and the test failure reason to obtain a second comparison result;

[0274] If both the first comparison result and the second comparison result are comparison successes, the target test result is determined to be a test pass.

[0275] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0276] Acquire multiple configuration items corresponding to the target software, each of the configuration items including a valid configuration and an invalid configuration;

[0277] Determine a first test path and a second test path according to each of the configuration items, wherein the first test path includes a first test node corresponding to a valid configuration, and the second test path includes a first test node corresponding to a valid configuration and a second test node corresponding to an invalid configuration;

[0278] The target software is tested according to the first test path and the second test path to obtain a target test result.

[0279] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0280] Obtaining the association relationship between the configuration items;

[0281] The first test path and the second test path are determined according to the association relationship and each of the configuration items.

[0282] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0283] Generate a configuration item flow chart according to the association relationship and each of the configuration items, wherein the configuration item flow chart includes a plurality of configuration item nodes and a hierarchical relationship between the configuration item nodes, and each of the configuration item nodes corresponds to each of the configuration items;

[0284] At least one first test path is generated according to the configuration item flowchart, and at least one second test path is generated according to the configuration item flowchart.

[0285] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0286] For each of the first test paths, each of the configuration item nodes in the configuration item flowchart is traversed in sequence according to a preset traversal order, a first valid configuration is determined from the configuration item nodes, and the first test path is generated according to each of the first valid configurations.

[0287] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0288] In the case where the configuration item node includes a valid configuration that is not covered by other test paths, taking the valid configuration as the first valid configuration;

[0289] In a case where the configuration item node includes multiple valid configurations that are not covered by other test paths, taking any one of the multiple valid configurations as the first valid configuration;

[0290] In a case where multiple valid configurations included in the configuration item node are all covered by other test paths, the first valid configuration is determined from the multiple valid configurations according to weights of the multiple valid configurations.

[0291] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0292] The first configuration identifier of each first valid configuration is used as each first test node, and each first test node is sorted according to a first preset sorting order to obtain the first test path, and the first preset sorting order is related to the process order of each first valid configuration in the configuration item flowchart.

[0293] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0294] For each of the second test paths, each of the configuration item nodes in the configuration item flowchart is traversed in turn according to a preset traversal order, a target invalid configuration or a second valid configuration is determined from the configuration item nodes, and the second test path is generated according to the target invalid configuration and each of the second valid configurations.

[0295] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0296] When the configuration item node includes an invalid configuration that is not covered by other test paths, and the current traversal process does not determine the target invalid configuration, taking the invalid configuration as the target invalid configuration;

[0297] When the configuration item node includes multiple invalid configurations that are not covered by other test paths, and the current traversal process does not determine the target invalid configuration, any one of the multiple invalid configurations is used as the target invalid configuration;

[0298] When multiple invalid configurations included in the configuration item node are all covered by other test paths, and / or the current traversal process has determined the target invalid configuration, the second valid configuration is determined from the multiple valid configurations according to the weights of the multiple valid configurations included in the configuration item node.

[0299] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0300] The second configuration identifier of the target invalid configuration is used as each second test node, and the third configuration identifier of each second valid configuration is used as the first test node, and each first test node and the second test node are sorted according to a second preset sorting order to obtain the second test path. The second preset sorting order is related to the process order of the target invalid configuration and each second valid configuration in the configuration item flow chart.

[0301] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0302] For a target test path in the first test path and the second test path, according to each test node included in the target test path, obtaining a target configuration item corresponding to each test node from the configuration item flow chart;

[0303] Generate test cases according to each of the target configuration items, and execute the test cases to obtain test results corresponding to the target test paths;

[0304] The target test result is determined according to the test results corresponding to each of the target test paths.

[0305] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0306] In a case where the target test path is the first test path, comparing the test result corresponding to the target test path with the first expected test result to obtain a first comparison result;

[0307] In the case where the target test path is the second test path, comparing the test result corresponding to the target test path with the second expected test result and the test failure reason to obtain a second comparison result;

[0308] If both the first comparison result and the second comparison result are comparison successes, the target test result is determined to be a test pass.

[0309] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0310] Acquire multiple configuration items corresponding to the target software, each of the configuration items including a valid configuration and an invalid configuration;

[0311] Determine a first test path and a second test path according to each of the configuration items, wherein the first test path includes a first test node corresponding to a valid configuration, and the second test path includes a first test node corresponding to a valid configuration and a second test node corresponding to an invalid configuration;

[0312] The target software is tested according to the first test path and the second test path to obtain a target test result.

[0313] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0314] Obtaining the association relationship between the configuration items;

[0315] The first test path and the second test path are determined according to the association relationship and each of the configuration items.

[0316] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0317] Generate a configuration item flow chart according to the association relationship and each of the configuration items, wherein the configuration item flow chart includes a plurality of configuration item nodes and a hierarchical relationship between the configuration item nodes, and each of the configuration item nodes corresponds to each of the configuration items;

[0318] At least one first test path is generated according to the configuration item flowchart, and at least one second test path is generated according to the configuration item flowchart.

[0319] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0320] For each of the first test paths, each of the configuration item nodes in the configuration item flowchart is traversed in sequence according to a preset traversal order, a first valid configuration is determined from the configuration item nodes, and the first test path is generated according to each of the first valid configurations.

[0321] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0322] In the case where the configuration item node includes a valid configuration that is not covered by other test paths, taking the valid configuration as the first valid configuration;

[0323] In a case where the configuration item node includes multiple valid configurations that are not covered by other test paths, taking any one of the multiple valid configurations as the first valid configuration;

[0324] In a case where multiple valid configurations included in the configuration item node are all covered by other test paths, the first valid configuration is determined from the multiple valid configurations according to weights of the multiple valid configurations.

[0325] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0326] The first configuration identifier of each first valid configuration is used as each first test node, and each first test node is sorted according to a first preset sorting order to obtain the first test path, and the first preset sorting order is related to the process order of each first valid configuration in the configuration item flowchart.

[0327] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0328] For each of the second test paths, each of the configuration item nodes in the configuration item flowchart is traversed in turn according to a preset traversal order, a target invalid configuration or a second valid configuration is determined from the configuration item nodes, and the second test path is generated according to the target invalid configuration and each of the second valid configurations.

[0329] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0330] When the configuration item node includes an invalid configuration that is not covered by other test paths, and the current traversal process does not determine the target invalid configuration, taking the invalid configuration as the target invalid configuration;

[0331] When the configuration item node includes multiple invalid configurations that are not covered by other test paths, and the current traversal process does not determine the target invalid configuration, any one of the multiple invalid configurations is used as the target invalid configuration;

[0332] When multiple invalid configurations included in the configuration item node are all covered by other test paths, and / or the current traversal process has determined the target invalid configuration, the second valid configuration is determined from the multiple valid configurations according to the weights of the multiple valid configurations included in the configuration item node.

[0333] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0334] The second configuration identifier of the target invalid configuration is used as each second test node, and the third configuration identifier of each second valid configuration is used as the first test node, and each first test node and the second test node are sorted according to a second preset sorting order to obtain the second test path. The second preset sorting order is related to the process order of the target invalid configuration and each second valid configuration in the configuration item flow chart.

[0335] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0336] For a target test path in the first test path and the second test path, according to each test node included in the target test path, obtaining a target configuration item corresponding to each test node from the configuration item flow chart;

[0337] Generate test cases according to each of the target configuration items, and execute the test cases to obtain test results corresponding to the target test paths;

[0338] The target test result is determined according to the test results corresponding to each of the target test paths.

[0339] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0340] In a case where the target test path is the first test path, comparing the test result corresponding to the target test path with the first expected test result to obtain a first comparison result;

[0341] In the case where the target test path is the second test path, comparing the test result corresponding to the target test path with the second expected test result and the test failure reason to obtain a second comparison result;

[0342] If both the first comparison result and the second comparison result are comparison successes, the target test result is determined to be a test pass.

[0343] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0344] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0345] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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 application.

[0346] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A testing method, characterized in that: The method comprises: Acquire multiple configuration items corresponding to the target software, each of the configuration items including a valid configuration and an invalid configuration; Determine a first test path and a second test path according to each of the configuration items, wherein the first test path includes a first test node corresponding to a valid configuration, and the second test path includes a first test node corresponding to a valid configuration and a second test node corresponding to an invalid configuration; The target software is tested according to the first test path and the second test path to obtain a target test result.

2. The method according to claim 1, characterized in that Determining the first test path and the second test path according to each of the configuration items includes: Obtaining the association relationship between the configuration items; Generate a configuration item flow chart according to the association relationship and each of the configuration items, wherein the configuration item flow chart includes a plurality of configuration item nodes and a hierarchical relationship between the configuration item nodes, and each of the configuration item nodes corresponds to each of the configuration items; At least one first test path is generated according to the configuration item flowchart, and at least one second test path is generated according to the configuration item flowchart.

3. The method according to claim 2, characterized in that Generating at least one of the first test paths according to the configuration item flow chart includes: For each of the first test paths, each of the configuration item nodes in the configuration item flowchart is traversed in sequence according to a preset traversal order, a first valid configuration is determined from the configuration item nodes, and the first test path is generated according to each of the first valid configurations.

4. The method according to claim 3, characterized in that The determining a first valid configuration from the configuration item node includes: In the case where the configuration item node includes a valid configuration that is not covered by other test paths, taking the valid configuration as the first valid configuration; In a case where the configuration item node includes multiple valid configurations that are not covered by other test paths, taking any one of the multiple valid configurations as the first valid configuration; In a case where multiple valid configurations included in the configuration item node are all covered by other test paths, the first valid configuration is determined from the multiple valid configurations according to weights of the multiple valid configurations.

5. The method according to claim 3, characterized in that: The step of generating the first test path according to each of the first valid configurations includes: The first configuration identifier of each first valid configuration is used as each first test node, and each first test node is sorted according to a first preset sorting order to obtain the first test path, and the first preset sorting order is related to the process order of each first valid configuration in the configuration item flowchart.

6. The method according to any one of claims 2 to 5, characterized in that: Generating at least one of the second test paths according to the configuration item flow chart includes: For each of the second test paths, each of the configuration item nodes in the configuration item flowchart is traversed in turn according to a preset traversal order, a target invalid configuration or a second valid configuration is determined from the configuration item nodes, and the second test path is generated according to the target invalid configuration and each of the second valid configurations.

7. The method according to claim 6, characterized in that The determining a target invalid configuration or a second valid configuration from the configuration item node includes: When the configuration item node includes an invalid configuration that is not covered by other test paths, and the current traversal process does not determine the target invalid configuration, taking the invalid configuration as the target invalid configuration; When the configuration item node includes multiple invalid configurations that are not covered by other test paths, and the current traversal process does not determine the target invalid configuration, any one of the multiple invalid configurations is used as the target invalid configuration; When multiple invalid configurations included in the configuration item node are all covered by other test paths, and / or the current traversal process has determined the target invalid configuration, the second valid configuration is determined from the multiple valid configurations according to the weights of the multiple valid configurations included in the configuration item node.

8. The method according to claim 6, characterized in that The step of generating the second test path according to the target invalid configuration and each of the second valid configurations includes: The second configuration identifier of the target invalid configuration is used as each second test node, and the third configuration identifier of each second valid configuration is used as the first test node, and each first test node and the second test node are sorted according to a second preset sorting order to obtain the second test path. The second preset sorting order is related to the process order of the target invalid configuration and each second valid configuration in the configuration item flow chart.

9. A testing device, characterized in that: The device comprises: An acquisition module, used to acquire multiple configuration items corresponding to the target software, each of which includes a valid configuration and an invalid configuration; a path determination module, for determining a first test path and a second test path according to each of the configuration items, wherein the first test path includes a first test node corresponding to a valid configuration, and the second test path includes a first test node corresponding to a valid configuration and a second test node corresponding to an invalid configuration; A testing module is used to test the target software according to the first test path and the second test path to obtain a target test result.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.