Decision Tree-Based Information System Defect Testing Method, Apparatus, and Electronic Equipment
By generating linked test cases based on decision trees, the problem of undiscovered defects caused by abnormal feature linkage in information system testing is solved, thereby improving test coverage and system stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AGRICULTURAL BANK OF CHINA
- Filing Date
- 2022-09-29
- Publication Date
- 2026-05-26
AI Technical Summary
In information system testing, defects caused by abnormal feature linkages are easily missed during testing, leading to production incidents after deployment and affecting system stability.
By employing a decision tree-based approach, a feature set and associated test cases are generated by identifying test features and their associated features, thereby expanding the testing scope to discover potential defects.
This improved the coverage of information system testing, reduced the risk of defect escape, and ensured the stable operation of the system after it was put into production.
Smart Images

Figure CN115374008B_ABST
Abstract
Description
Technical Field
[0001] This application relates to machine learning technology, and more particularly to a method, apparatus and electronic device for testing defects in information systems based on decision trees. Background Technology
[0002] Information systems are becoming increasingly numerous, massive in scale, and complex in their interrelationships. Large-scale projects typically involve numerous changes, where a change in one can have far-reaching consequences. Under conditions of frequent requirement iterations, tight project deadlines, and limited human resources, defects are easily generated.
[0003] Therefore, information systems need to be tested after development, and also after upgrades or repairs following deployment. The purpose of testing is to discover as many defects as possible. During testing, with comprehensive design and execution of test cases, most defects are easily discovered, a few are discovered accidentally, and some defects are not discovered during testing. For example, defects caused by abnormal feature linkages may only become known after deployment or re-deployment, triggering production events in the production environment, which is detrimental to the stable operation of the information system. Summary of the Invention
[0004] This application provides a method, apparatus, and electronic device for testing information system defects based on decision trees, which reduces the risk of defects escaping due to abnormal linkage of some features during information system testing, thereby improving the stability of the information system.
[0005] On the one hand, this application provides a method for testing defects in information systems based on decision trees, the method comprising:
[0006] Based on the original test cases, test characteristics are determined, wherein the original test cases are used to represent cases of information system requirements testing, and the test characteristics are used to represent the reasons that affect whether defects occur in the original test cases;
[0007] Based on the test features and the trained decision tree model, linkage features are determined, including associated features and / or superior features; wherein, the number of decision tree branches where the associated features and the test features coexist exceeds a preset number, and the superior features and the test features are located on the same decision tree branch.
[0008] Based on the test features and the linkage features, a feature set is generated, and at least one linkage test case different from the original test case is generated based on the feature set; the testing of the information system is based on the original test case and the linkage test case.
[0009] In another possible implementation, generating a feature set based on the test features and the linkage features includes:
[0010] If the associated feature and the superior feature exist, then for each test feature, the feature set is generated based on the test feature and any associated feature and the superior feature;
[0011] If the associated features exist, then for each test feature, the feature set is generated based on the test feature and the associated features;
[0012] If the superior feature exists, then for each test feature, the feature set is generated based on the test feature and the superior feature.
[0013] In another possible implementation, generating the feature set based on the test features, any associated features, and the parent features includes:
[0014] If the associated feature and the parent feature are different features, then a first feature set is generated based on the test feature and the associated feature, a second feature set is generated based on the test feature and the parent feature, and a third feature set is generated based on the test feature, the associated feature, and the parent feature.
[0015] If the associated feature and the parent feature are the same, then the feature set is generated based on the test feature and the parent feature.
[0016] In another possible implementation, generating at least one linked test case different from the original test case based on the feature set includes:
[0017] Based on the features included in the feature set, a preset environment corresponding to each feature is obtained; the preset environment includes the hardware, software, network, and data required to complete the information system test;
[0018] The linkage test cases are generated based on the preset environment corresponding to each feature.
[0019] In another possible implementation, the decision tree model is trained as follows:
[0020] Acquire test defect cases and production defect cases, and establish a test defect library based on the test defect cases and a production defect library based on the production defect cases; wherein, the test defect cases are generated during the testing process and the production defect cases are generated during historical applications;
[0021] Based on the test defect library and the production defect library, the original decision tree model is trained.
[0022] In another possible implementation, training the original decision tree model based on the test defect library and the production defect library includes:
[0023] Based on the test defect library and the production defect library, a training set is established, which includes the test defect cases and test defect types, as well as the production defect cases and production defect types.
[0024] Based on pre-defined defect characteristics, the test defect cases and the production defect cases are analyzed respectively to obtain a first defect characteristic included in each test defect case and a second defect characteristic included in each production defect case; wherein, the defect characteristics are used to indicate the reasons affecting whether the test defect case or the production defect case has a defect, and the first defect characteristics and the second defect characteristics are features in the pre-defined defect characteristics;
[0025] The original decision tree model is trained based on the defect features and test defect types included in each test defect case, and the defect features and production defect types included in each production defect case.
[0026] In another possible implementation, training the original decision tree model based on the defect features and test defect type included in each test defect case, and the defect features and production defect type included in each production defect case, includes:
[0027] A defect matrix is constructed based on the defect characteristics and test defect types included in each test defect case, and the defect characteristics and production defect types included in each production defect case.
[0028] The defect matrix is used as input to the decision tree model to train the original decision tree model;
[0029] In this process, each row of the defect matrix corresponds to a test defect case or a production defect case. The defect features included in the test defect case or production defect case correspond to a first value, and the defect features not included in the test defect case correspond to a second value. The production defect type corresponds to the first value, and the test defect type corresponds to the second value.
[0030] On the other hand, this application provides an information system defect testing device based on a decision tree, including a first determining module, a second determining module, and a generating module, wherein...
[0031] The first determining module is used to determine test characteristics based on the original test cases, wherein the original test cases are used to represent cases of information system requirement testing, and the test characteristics are used to represent the reasons affecting whether the original test cases have defects;
[0032] The second determining module is used to determine linkage features based on the test features and the trained decision tree model. The linkage features include associated features and / or superior features. Wherein, the number of decision tree branches where the associated features and the test features coexist exceeds a preset number, and the superior features and the test features are located on the same decision tree branch.
[0033] The generation module is used to generate a feature set based on the test features and the linkage features, and to generate at least one linkage test case different from the original test case based on the feature set; the testing of the information system is based on the original test case and the linkage test case.
[0034] In another possible implementation, the generation module is specifically used for:
[0035] If the associated feature and the superior feature exist, then for each test feature, the feature set is generated based on the test feature and any associated feature and the superior feature;
[0036] If the associated features exist, then for each test feature, the feature set is generated based on the test feature and the associated features;
[0037] If the superior feature exists, then for each test feature, the feature set is generated based on the test feature and the superior feature.
[0038] In another possible implementation, generating the feature set based on the defect features, any associated features, and the parent features includes:
[0039] If the associated feature and the parent feature are different features, then a first feature set is generated based on the test feature and the associated feature, a second feature set is generated based on the test feature and the parent feature, and a third feature set is generated based on the test feature, the associated feature, and the parent feature.
[0040] If the associated feature and the parent feature are the same, then the feature set is generated based on the test feature and the parent feature.
[0041] In another possible implementation, the generation module is also used for:
[0042] Based on the features included in the feature set, a preset environment corresponding to each feature is obtained; the preset environment includes the hardware, software, network, and data required to complete the information system test;
[0043] The linkage test cases are generated based on the preset environment corresponding to each feature.
[0044] In another possible implementation, the decision tree model is trained as follows:
[0045] Acquire test defect cases and production defect cases, and establish a test defect library based on the test defect cases and a production defect library based on the production defect cases; wherein, the test defect cases are generated during the testing process and the production defect cases are generated during historical applications;
[0046] Based on the test defect library and the production defect library, the original decision tree model is trained.
[0047] In another possible implementation, training the original decision tree model based on the test defect library and the production defect library includes:
[0048] Based on the test defect library and the production defect library, a training set is established, which includes the test defect cases and test defect types, as well as the production defect cases and production defect types.
[0049] Based on pre-defined defect characteristics, the test defect cases and the production defect cases are analyzed respectively to obtain a first defect characteristic included in each test defect case and a second defect characteristic included in each production defect case; wherein, the defect characteristics are used to indicate the reasons affecting whether the test defect case or the production defect case has a defect, and the first defect characteristics and the second defect characteristics are features in the pre-defined defect characteristics;
[0050] The original decision tree model is trained based on the defect features and test defect types included in each test defect case, and the defect features and production defect types included in each production defect case.
[0051] In another possible implementation, training the original decision tree model based on the defect features and test defect type included in each test defect case, and the defect features and production defect type included in each production defect case, includes:
[0052] A defect matrix is constructed based on the defect characteristics and test defect types included in each test defect case, and the defect characteristics and production defect types included in each production defect case.
[0053] The defect matrix is used as input to the decision tree model to train the original decision tree model;
[0054] In this process, each row of the defect matrix corresponds to a test defect case or a production defect case. The defect features included in the test defect case or production defect case correspond to a first value, and the defect features not included in the test defect case correspond to a second value. The production defect type corresponds to the first value, and the test defect type corresponds to the second value.
[0055] Thirdly, the present invention provides an electronic device, comprising:
[0056] At least one processor and memory;
[0057] The memory stores computer-executed instructions;
[0058] The at least one processor executes the computer execution instructions stored in the memory, causing the at least one processor to perform the decision tree-based information system defect testing method as described in any of the first aspects above.
[0059] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions, wherein when a processor executes the computer-executable instructions, the information system defect testing method based on decision tree as described in any of the first aspects above is implemented.
[0060] This application provides a method, apparatus, and electronic device for testing information system defects based on decision trees. Using this method, when testing an information system, for any given original test case, the electronic device first determines its included test features. For each test feature, the electronic device first determines its associated features based on a trained decision tree model; then, based on the test features and associated features, it generates a feature set. Finally, it obtains at least one associated test case different from the original test case based on the feature set. The operator then tests the information system based on the original test case and its corresponding associated test cases to ultimately obtain the defect test results of the information system.
[0061] In the above process, based on the test characteristics and the linkage characteristics obtained from the test characteristics, linkage test cases are generated. This allows staff to test the information system based on the original test cases and then test it again based on the linkage test cases. This helps to discover some defect events caused by different linkage anomalies that are not easily discovered during the testing process, and thus helps to further ensure the stable operation of the information system after it is put into production. Attached Figure Description
[0062] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0063] Figure 1A flowchart of a defect testing process for an information system provided in this application embodiment;
[0064] Figure 2 A flowchart illustrating a decision tree-based information system defect testing method provided in this application embodiment. Figure 1 ;
[0065] Figure 3 A flowchart illustrating a decision tree-based information system defect testing method provided in this application embodiment. Figure 2 ;
[0066] Figure 4 This is a schematic diagram illustrating a method for training a decision tree model provided in an embodiment of this application;
[0067] Figure 5 A schematic diagram of the structure of an information system defect testing device based on a decision tree, provided in an embodiment of this application;
[0068] Figure 6 An electronic device provided in an embodiment of this application.
[0069] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0070] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0071] An information system is a human-machine integrated system composed of computer hardware, network and communication equipment, computer software, information resources, information users, and regulations, designed to process information flow. It primarily has five basic functions: information input, storage, processing, output, and control. To ensure the stable operation of an information system after its deployment, system testing is required after development or upgrades to identify as many defects as possible before deployment, thus facilitating timely improvements.
[0072] Information system testing generally includes recovery testing, security testing, and stress testing. Recovery testing primarily focuses on the various conditions that could cause the information system to fail and verifies whether its recovery process can be executed correctly. Security testing verifies the internal protection mechanisms of the information system to prevent unauthorized intrusion. Stress testing involves running the information system under abnormal access volumes, frequencies, or data volumes under normal resource conditions.
[0073] Figure 1 This is a flowchart illustrating a defect testing process for an information system, as provided in an embodiment of this application. Figure 1 As shown, the testing process for the information system includes steps S101, S102, S103, and S104, wherein...
[0074] Step S101: Develop a test plan for the information system; the test plan includes test characteristics, test methods, test environment and auxiliary tools, test completion criteria, and personnel and task list.
[0075] The testing environment includes the hardware, software, network, and data required to complete the information system testing.
[0076] Step S102: Design test cases for the information system according to the test plan.
[0077] For example, when the test feature is the code specifications of an information system, the test instances are a series of scenario instances generated around the code design.
[0078] Step S103: Based on the test plan and test cases, perform information system testing.
[0079] Step S104: Use the specified defect management tool to record the status information of all defects and generate a defect management report.
[0080] In some known technologies, workers complete tasks such as Figure 1 Following the testing process shown, based on the defect management report obtained after the test, the discovered defects are eliminated.
[0081] As a type of information system, bank information systems are becoming increasingly large in scale, and the relationships between their various parts are intricate. This makes it easy for a defect in one part of the system to trigger a chain reaction of abnormalities in other parts. In this situation, if the system is still based on... Figure 1 The testing process shown is used to test the bank's information system. If test cases are designed based on only one test feature, it will be impossible to find some defective events that occur due to linkage anomalies during testing, which will be detrimental to the stable operation of the information system after it is put into production.
[0082] The embodiments of this application are as follows: Figure 1Based on the illustrated embodiment, when designing test cases for the information system according to the test plan, some hidden defect cases that may lead to defects are analyzed based on the test characteristics contained in the initial test cases. These are linked test cases obtained from the test characteristics and their linkage characteristics, so as to discover defect cases in a timely manner during testing, reduce the risk of defect escape, and thus help improve the stability of the information system.
[0083] Figure 2 A flowchart illustrating a decision tree-based information system defect testing method provided in this application embodiment. Figure 1 .like Figure 2 As shown, the method in this embodiment may include steps S201, S202, and S203, wherein,
[0084] Step S201: Determine test features based on the original test cases.
[0085] Here, the original test case represents a test case for information system requirements testing, corresponding to the test cases designed according to the test plan in the aforementioned embodiments. Test features represent the reasons affecting whether a defect occurs in the original test case, and test features may include modification features or defect features.
[0086] Specifically, when an information system undergoes transformation or upgrade, or when a production incident occurs, it is necessary to test the transformed or repaired information system. Therefore, the original test cases can be designed based on the transformed feature after the information system has undergone a transformation or upgrade; or they can be designed based on the defect feature after a defect has occurred in the information system.
[0087] Step S202: Based on the test features and the trained decision tree model, determine the linkage features, which include related features and / or parent features.
[0088] Specifically, the number of decision tree branches where both the associated feature and the test feature coexist exceeds a preset limit, and the parent feature and the test feature are located on the same decision tree branch. The associated feature and the parent feature may be the same feature.
[0089] For example, the preset number is set to 3, and the test feature is any feature C, which is a second-level splitting attribute of the decision tree. If a certain feature B and feature C coexist on more than 3 branches of the decision tree, then feature B is an associated feature of feature C. If a certain feature A is a first-level splitting attribute of the decision tree and is located on the same branch as feature C, then feature A is a superior feature of feature C. The first-level splitting attribute is the optimal splitting attribute obtained during the first calculation of information gain, and the second-level splitting attribute is the optimal splitting attribute obtained during the second calculation of information gain based on the first-level splitting attribute.
[0090] Step S203: Based on the test features and linkage features, generate a feature set, and obtain at least one linkage test case that is different from the original test case based on the feature set. The information system performs tests based on the original test case and the linkage test case.
[0091] Specifically, in this embodiment, after determining the linkage features, the electronic device can perform combined operations on the test features and the linkage features to obtain at least two feature sets that are different from the sets corresponding to the original test cases. Hereinafter, the set corresponding to the original test cases is referred to as the original set, and the original set = (test features).
[0092] For example, when two linked features are obtained based on the test features, the test features and the two linked features are combined to obtain a total of six feature sets that are different from the original set: set 1 = (linked feature 1), set 2 = (linked feature 2), set 3 = (test feature, linked feature 1), set 4 = (test feature, linked feature 2), set 5 = (linked feature 1, test feature 2), and set 6 = (test feature, linked feature 1, test feature 2).
[0093] The method provided in this embodiment involves the following steps: When testing original test cases, the operator first inputs the original test cases into an electronic device. The electronic device first determines the test features included in the original test cases and, based on the test features and a trained decision tree model, determines the associated features of the test features. Next, the electronic device performs combination operations on the test features and associated features to obtain at least two feature sets different from the original combination. Finally, based on at least two feature sets, the electronic device generates associated test cases different from the original test cases. The operator then tests the information system using the associated test cases generated by the electronic device and promptly resolves any defects that occur in the information system.
[0094] The method provided in this embodiment enables staff to generate linkage test cases based on the original test cases before testing the information system. Based on these linkage test cases, the information system is tested, which makes it possible to discover some hidden linkage anomalies during the testing process. This allows staff to fix these problems before the information system is put into production, which is conducive to the stable operation of the information system after it is put into production.
[0095] Figure 3 This is a flowchart illustrating a decision tree-based information system defect testing method provided in an embodiment of this application. Figure 2 The following is combined with Figure 3The specific implementation process of the embodiments of this application will be described in detail. Specifically, based on the above embodiments, this embodiment specifies in detail the method for generating linkage test cases.
[0096] like Figure 3 As shown, the method includes steps S301 to S308, wherein,
[0097] Step S301: Determine test features based on the original test cases.
[0098] Step S302: Based on the test features and the trained decision tree model, determine the linkage features, which include related features and / or parent features. Specifically, the number of decision tree branches where related features and defect features coexist exceeds a preset limit, and the parent features and defect features are located on the same decision tree branch.
[0099] Specifically, for the limitations of steps S301 and S302, please refer to the detailed description of steps S201 and S202 in the foregoing embodiments, which will not be repeated here.
[0100] As can be seen from the limitations on associated features and parent features in the foregoing embodiments, there may be cases where associated features and parent features are the same feature. Therefore, in this embodiment, when generating a feature set based on test features and linkage features, the specific generation method needs to be discussed on a case-by-case basis, including the following four cases: step S303, step S304, step S305, and step S306, as follows:
[0101] Step S303: If there are different related features and superior features, then generate a first feature set based on the test features and related features, generate a second feature set based on the test features and superior features, and generate a third feature set based on the test features, related features, and superior features.
[0102] Step S304: If there are identical related features and parent features, then generate a feature set based on the test features and parent features.
[0103] Step S305: If there are associated features, generate a feature set for each test feature based on the test feature and associated features.
[0104] Step S306: If there is a parent feature, then for each test feature, generate a feature set based on the test feature and the parent feature.
[0105] Specifically, for different related features and superior features, a first feature set that is only related to the related features, a second feature set that is only related to the superior features, and a third feature set that is related to both the related features and the superior features can be generated respectively, so as to classify the linkage test cases in advance and facilitate the staff to test the information system by category.
[0106] For the same related features and parent features, feature sets are generated only based on the same related features or parent features, thereby avoiding the occurrence of the same linkage test cases and effectively saving staff time spent testing information systems.
[0107] Step S307: Based on the features included in the feature set, obtain the preset environment corresponding to each feature.
[0108] The pre-configured environment includes the hardware, software, network, and data required to complete the information system testing. The pre-configured environment can be pre-entered by staff into electronic devices, or it can be a pre-configured environment used for a specific feature when electronic devices generate linked test cases in the past.
[0109] Specifically, hardware refers to the necessary auxiliary equipment such as servers, clients, and network connections for testing information systems; software refers to the operating system, database, and other application software used to run the information system; network refers to the environment consisting of the network system, network structure, and other network devices used to run the information system; and data is used to verify the functions of the information system.
[0110] Step S308: Generate linkage test cases based on the preset environment corresponding to each feature.
[0111] Specifically, based on each feature in each feature set and its corresponding preset environment, corresponding linkage test cases are generated.
[0112] The method provided in this embodiment involves an electronic device generating a feature set based on test features and linkage features, obtaining the preset environment corresponding to each feature in each feature set, and generating a linkage test case corresponding to the feature set based on each feature and its corresponding preset environment, which is also the linkage test case corresponding to the original test case.
[0113] Figure 4 This is a schematic diagram illustrating a method for training a decision tree model provided in an embodiment of this application. The following is in conjunction with… Figure 4 The specific implementation process of the embodiments of this application will be further described in detail. Specifically, this embodiment provides a detailed explanation of how the trained decision tree model is obtained.
[0114] like Figure 4As shown, the method may include steps S401, S402, S403, S404, and S405, wherein,
[0115] Step S401: Obtain test defect cases and production defect cases, and establish a test defect library based on the test defect cases and a production defect library based on the production defect cases.
[0116] Among them, test defect cases are generated during the testing process, while production defect cases are generated during historical applications.
[0117] Step S402: Based on the test defect library and the production defect library, establish a training set. The training set includes test defect cases and test defect types, as well as production defect cases and production defect types.
[0118] For example, the training set is represented as: training set = {(test defect case 1, test defect), (test defect case 2, test defect) ..., (test defect case n, test defect), (production defect case 1, production defect) ..., (production defect case n, production defect)}.
[0119] Step S403: Based on the pre-defined defect characteristics, analyze the test defect cases and production defect cases respectively, and obtain the first defect characteristics included in each test defect case and the second defect characteristics included in each production defect case.
[0120] Among them, the defect feature is used to indicate the reason why a defect occurs in a test defect case or a production defect case. The first defect feature and the second defect feature are features among the pre-defined defect features.
[0121] Specifically, the pre-defined defect characteristics can include code design, code style, system design, rule conflicts, special data, related interfaces, UI experience, system performance, parameter configuration, and production operation. These defect characteristics are extracted after analyzing a large number of defect cases.
[0122] Step S404: Construct a defect matrix based on the defect characteristics and test defect types included in each test defect case, and the defect characteristics and production defect types included in each production defect case.
[0123] Specifically, each row of the defect matrix corresponds to a test defect case or a production defect case. The defect features included in the test defect case or production defect case correspond to a first value, and the defect features not included in the test defect case correspond to a second value. The production defect type corresponds to the first value, and the test defect type corresponds to the second value. The first value can be 1, and the second value can be 0.
[0124] Step S405: Use the defect matrix as input to the decision tree model to train the original decision tree model.
[0125] Specifically, based on the defect matrix, the original decision tree model is trained to obtain a trained decision tree model. Based on the trained decision tree model, the partitioning attributes at each level and each branch can be determined, thereby obtaining the associated features or superior features of a specific test feature.
[0126] In this embodiment, the electronic device records the relationships between various features based on the trained decision tree model, so as to call them when generating linked test cases.
[0127] The above embodiments introduce a decision tree-based information system defect testing method from the perspective of methodology and process. The following embodiments introduce a decision tree-based information system defect testing device from the perspective of virtual modules or virtual units. For details, please refer to the following embodiments.
[0128] This application provides an information system defect testing device based on a decision tree, such as... Figure 5 As shown, the device includes a first determining module 51, a second determining module 52, and a generating module 53, wherein,
[0129] The first determining module 51 is used to determine test characteristics based on the original test cases, wherein the original test cases are used to represent cases of information system requirement testing, and the test characteristics are used to represent the reasons that affect whether defects occur in the original test cases;
[0130] The second determining module 52 is used to determine the linkage features based on the test features and the trained decision tree model. The linkage features include related features and / or superior features. Where the number of decision tree branches where related features and test features coexist exceeds a preset number, and the superior features and test features are located on the same decision tree branch.
[0131] The generation module 53 is used to generate a feature set based on test features and linkage features, and generate at least one linkage test case different from the original test case based on the feature set; the information system is tested based on the original test case and the linkage test case.
[0132] In another possible implementation of this application embodiment, the generation module 53 is specifically used for:
[0133] If there are related features and parent features, then for each test feature, generate a feature set based on the test feature and any related features and parent features.
[0134] If associated features exist, then for each test feature, generate a feature set based on the test feature and associated features;
[0135] If there are parent features, then for each test feature, a feature set is generated based on the test feature and the parent feature.
[0136] Another possible implementation of this application embodiment involves generating a feature set based on test features and any associated and parent features, including:
[0137] If the associated feature and the parent feature are different features, then a first feature set is generated based on the test feature and the associated feature, a second feature set is generated based on the test feature and the parent feature, and a third feature set is generated based on the test feature, the associated feature, and the parent feature.
[0138] If the related feature and the parent feature are the same, then a feature set is generated based on the test feature and the parent feature.
[0139] In another possible implementation of this application embodiment, the generation module 53 is further configured to:
[0140] Based on the features included in the feature set, obtain the pre-set environment corresponding to each feature; the pre-set environment includes the hardware, software, network and data required to complete the information system test;
[0141] Based on the pre-defined environment corresponding to each feature, generate linkage test cases.
[0142] Another possible implementation of this application embodiment is that the decision tree model is trained in the following manner:
[0143] Acquire test defect cases and production defect cases, and build a test defect library based on test defect cases and a production defect library based on production defect cases; test defect cases are generated during the testing process, and production defect cases are generated during historical applications;
[0144] The original decision tree model is trained based on the test defect library and the production defect library.
[0145] Another possible implementation of this application embodiment involves training the original decision tree model based on the test defect library and the production defect library, including:
[0146] Based on the test defect library and the production defect library, a training set is established. The training set includes test defect cases and test defect types, as well as production defect cases and production defect types.
[0147] Based on the pre-defined defect characteristics, test defect cases and production defect cases are analyzed separately to obtain the first defect characteristic included in each test defect case and the second defect characteristic included in each production defect case; wherein, the defect characteristics are used to indicate the reasons that affect whether a test defect case or a production defect case has a defect, and the first defect characteristics and the second defect characteristics are features in the pre-defined defect characteristics.
[0148] The original decision tree model is trained based on the defect characteristics and test defect type included in each test defect case, and the defect characteristics and production defect type included in each production defect case.
[0149] In another possible implementation of this application embodiment, the original decision tree model is trained based on the defect features and test defect types included in each test defect case, and the defect features and production defect types included in each production defect case, including:
[0150] Construct a defect matrix based on the defect characteristics and test defect types included in each test defect case, and the defect characteristics and production defect types included in each production defect case;
[0151] The defect matrix is used as input to the decision tree model to train the original decision tree model;
[0152] In this defect matrix, each row corresponds to a test defect case or a production defect case. The defect features included in the test defect case or production defect case correspond to the first value, and the defect features not included in the test defect case correspond to the second value. The production defect type corresponds to the first value, and the test defect type corresponds to the second value.
[0153] The information system defect testing device based on decision tree provided in this application embodiment is applicable to the above method embodiment, and will not be described again here.
[0154] This application provides an electronic device, such as... Figure 6 As shown, Figure 6 The illustrated electronic device includes a processor 61 and a memory 62. The processor 61 and the memory 62 are connected, for example, via a bus 63. Optionally, the electronic device may also include a transceiver 64. It should be noted that in practical applications, the transceiver 64 is not limited to one type, and the structure of this electronic device does not constitute a limitation on the embodiments of this application.
[0155] Processor 61 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), a FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 61 may also be a combination that implements computational functions, such as a combination of one or more microprocessors 61, a combination of a DSP and a microprocessor 61, etc.
[0156] Bus 63 may include a pathway for transmitting information between the aforementioned components. Bus 631002 may be a PCI (Peripheral Component Interconnect) bus 63 or an EISA (Extended Industry Standard Architecture) bus 63, etc. Bus 63 can be divided into address bus 63, data bus 63, control bus 63, etc. For ease of representation, Figure 6 The bus 63 is represented by only one thick line, but this does not mean that there is only one bus 63 or one type of bus 63.
[0157] The memory 62 may be a ROM (Read Only Memory) or other type of static storage device capable of storing static information and instructions, RAM (Random Access Memory) or other type of dynamic storage device capable of storing information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0158] The memory 62 is used to store application code that executes the solution of this application, and its execution is controlled by the processor 61. The processor 61 is used to execute the application code stored in the memory 62 to implement the content shown in the foregoing method embodiments.
[0159] Electronic devices include, but are not limited to: mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (such as in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Servers can also be included. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0160] This application provides a computer-readable storage medium storing a computer program that, when run on a computer, enables the computer to execute the corresponding content in the aforementioned method embodiments.
[0161] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims.
[0162] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for testing defects in information systems based on decision trees, characterized in that, include: Based on the original test cases, test characteristics are determined, wherein the original test cases are used to represent cases of information system requirements testing, and the test characteristics are used to represent the reasons that affect whether defects occur in the original test cases; Based on the test features and the trained decision tree model, linkage features are determined. The linkage features include associated features and / or superior features. Where the number of decision tree branches where the associated features and the test features coexist exceeds a preset number, and the superior features and the test features are located on the same decision tree branch. When the preset number is set to 3, the test feature is any feature C, which is a secondary partitioning attribute of the decision tree. If a feature B and feature C coexist on more than 3 decision tree branches, then feature B is an associated feature of feature C. If a feature A is a primary partitioning attribute of the decision tree and is located on the same branch as feature C, then feature A is a superior feature of feature C. The primary partitioning attribute is the optimal partitioning attribute obtained during the first calculation of information gain, and the secondary partitioning attribute is the optimal partitioning attribute obtained during the second calculation of information gain based on the primary partitioning attribute. Based on the test features and the linkage features, a feature set is generated, and at least one linkage test case different from the original test case is generated based on the feature set; the testing of the information system is based on the original test case and the linkage test case.
2. The method according to claim 1, characterized in that, The generation of a feature set based on the test features and the linkage features includes: If the associated feature and the superior feature exist, then for each test feature, the feature set is generated based on the test feature and any associated feature and the superior feature; If the associated features exist, then for each test feature, the feature set is generated based on the test feature and the associated features; If the superior feature exists, then for each test feature, the feature set is generated based on the test feature and the superior feature.
3. The method according to claim 2, characterized in that, The step of generating the feature set based on the test features, any associated features, and the parent features includes: If the associated feature and the parent feature are different features, then a first feature set is generated based on the test feature and the associated feature, a second feature set is generated based on the test feature and the parent feature, and a third feature set is generated based on the test feature, the associated feature, and the parent feature. If the associated feature and the parent feature are the same, then the feature set is generated based on the test feature and the parent feature.
4. The method according to any one of claims 1 to 3, characterized in that, The generation of at least one linked test case different from the original test case based on the feature set includes: Based on the features included in the feature set, a preset environment corresponding to each feature is obtained; the preset environment includes the hardware, software, network, and data required to complete the information system test; The linkage test cases are generated based on the preset environment corresponding to each feature.
5. The method according to claim 1, characterized in that, The decision tree model was trained in the following way: Acquire test defect cases and production defect cases, and establish a test defect library based on the test defect cases and a production defect library based on the production defect cases; wherein, the test defect cases are generated during the testing process and the production defect cases are generated during historical applications; Based on the test defect library and the production defect library, the original decision tree model is trained.
6. The method according to claim 5, characterized in that, The step of training the original decision tree model based on the test defect library and the production defect library includes: Based on the test defect library and the production defect library, a training set is established, which includes the test defect cases and test defect types, as well as the production defect cases and production defect types. Based on pre-defined defect characteristics, the test defect cases and the production defect cases are analyzed respectively to obtain a first defect characteristic included in each test defect case and a second defect characteristic included in each production defect case; wherein, the defect characteristics are used to indicate the reasons affecting whether the test defect case or the production defect case has a defect, and the first defect characteristics and the second defect characteristics are features in the pre-defined defect characteristics; The original decision tree model is trained based on the defect characteristics and test defect types included in each test defect case, and the defect characteristics and production defect types included in each production defect case.
7. The method according to claim 6, characterized in that, The step of training the original decision tree model based on the defect features and test defect types included in each test defect case, and the defect features and production defect types included in each production defect case, includes: A defect matrix is constructed based on the defect characteristics and test defect types included in each test defect case, and the defect characteristics and production defect types included in each production defect case. The defect matrix is used as input to the decision tree model to train the original decision tree model; In this process, each row of the defect matrix corresponds to a test defect case or a production defect case. The defect features included in the test defect case or production defect case correspond to a first value, and the defect features not included in the test defect case correspond to a second value. The production defect type corresponds to the first value, and the test defect type corresponds to the second value.
8. A decision tree-based information system defect testing device, characterized in that, include: The first determining module is used to determine test characteristics based on the original test cases, wherein the original test cases are used to represent cases of information system requirement testing, and the test characteristics are used to represent the reasons affecting whether the original test cases have defects; The second determining module is used to determine the linkage features based on the test features and the trained decision tree model. The linkage features include associated features and / or superior features. Wherein, the number of decision tree branches where the associated features and the test features coexist exceeds a preset number, and the superior features and the test features are located on the same decision tree branch. When the preset number is set to 3, the test feature is any feature C, which is a secondary partitioning attribute of the decision tree. If a feature B and feature C coexist on more than 3 decision tree branches, then feature B is an associated feature of feature C. If a feature A is a primary partitioning attribute of the decision tree and is located on the same branch as feature C, then feature A is a superior feature of feature C. The primary partitioning attribute is the optimal partitioning attribute obtained during the first calculation of information gain, and the secondary partitioning attribute is the optimal partitioning attribute obtained during the second calculation of information gain based on the primary partitioning attribute. The generation module is used to generate a feature set based on the test features and the linkage features, and to generate at least one linkage test case different from the original test case based on the feature set; the testing of the information system is based on the original test case and the linkage test case.
9. An electronic device, characterized in that, It includes: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications being configured to: execute the decision tree-based information system defect testing method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the decision tree-based information system defect testing method as described in any one of claims 1-7.