A method, device and equipment for determining the cause of test failure
By obtaining and classifying the transaction codes and error codes of test failure cases, and combining the data desensitization rule base to determine the cause of test failure, the test failure problem caused by improper data desensitization in the test of commercial bank system is solved, and rapid positioning and improvement of test success rate is achieved.
Patent Information
- Application Number
- CN202210087312.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-25
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-01-25
AI Technical Summary
In the system test of commercial banks, when using desensitized production data for log replay, the test success rate is low and it is difficult to accurately locate the cause of test failure, which cannot effectively solve the test failure problem caused by improper data desensitization.
By obtaining test failure cases, determining transaction codes and error codes, combining and classifications to obtain error code types, selecting pending combinations and determining the cause of test failure based on the target transaction code combined with a predefined data desensitization rule base.
It realizes rapid positioning of the causes of test failure, accurately determine whether the test failure cases are related to data desensitization, and improves the success rate of log playback.
Smart Images

Figure CN114416581B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of testing technology, and in particular to a method, device and equipment for determining the cause of a test failure. Background Art
[0002] Commercial banks are increasingly using production transaction log playback technology in system testing. For data security reasons, the test environment needs to use desensitized production data as the base data, and the production transaction logs used for playback must also be desensitized accordingly. Data desensitization refers to the deformation of certain sensitive information through desensitization rules to achieve reliable protection of sensitive privacy data. If non-desensitized production data is used completely, and the test environment program version is consistent with the T+1 day production program version, the test success rate can reach 98%. However, when using desensitized data for log playback, the test success rate depends on the desensitization situation and the transaction ratio. In extreme cases, it will drop to less than 60%.
[0003] For data security reasons, if production data is needed for testing, it must be desensitized. At present, the business system architecture of commercial banks is complex, the subsystems are highly correlated, and the data is stored in multiple platforms and different types of databases; the production log structure is diverse, and some types of logs are not easy to identify sensitive fields; the verification of data standardization is becoming more and more stringent during business execution; different systems have different password encryption methods, etc., all of which make it difficult to desensitize data and logs. With the current desensitization technology, it is impossible to guarantee that the desensitized data and logs can completely eliminate data sensitivity without affecting the correctness of the business. Improper desensitization may cause the destruction of the correlation between the underlying data and the inconsistency between the underlying data and the corresponding log data, which will reduce the success rate of log playback and fail to achieve the purpose of testing. Therefore, improper handling during the data desensitization process will lead to test failure. How to locate whether the cause of the test failure is caused by data desensitization has become a technical problem to be solved. Summary of the invention
[0004] The present invention provides a method, device and equipment for determining the cause of a test failure, so as to realize rapid positioning of the cause of a test failure.
[0005] In a first aspect, an embodiment of the present invention provides a method for determining a test failure cause, the method comprising:
[0006] Get at least one test failure case;
[0007] Determine the transaction code and error code of each of the test failure cases, and combine and classify each of the transaction code and error code to obtain an error code type;
[0008] Selecting a combination to be processed from each combination, wherein the combination to be processed includes a target error code and a target transaction code;
[0009] When the error code type of the target error code is a preset type, the reason for the test failure is determined according to the target transaction code in combination with a predetermined data desensitization rule library.
[0010] In a second aspect, an embodiment of the present invention further provides a device for determining a test failure cause, the device for determining a test failure cause comprising:
[0011] A case acquisition module, used to acquire at least one test failure case;
[0012] A classification module, used to determine the transaction code and error code of each test failure case, and combine and classify each transaction code and error code to obtain an error code type;
[0013] A combination selection module, used for selecting a combination to be processed from various combinations, wherein the combination to be processed includes a target error code and a target transaction code;
[0014] The cause determination module is used to determine the cause of the test failure according to the target transaction code in combination with a predetermined data desensitization rule library when the error code type of the target error code is a preset type.
[0015] In a third aspect, an embodiment of the present invention further provides a computer device, the device comprising:
[0016] one or more processors;
[0017] a memory for storing one or more programs,
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement a method for determining a test failure cause as described in any one of the embodiments of the present invention.
[0019] The embodiment of the present invention provides a method, device and equipment for determining the cause of test failure, which obtains at least one test failure case; determines the transaction code and error code of each test failure case, and combines and classifies each transaction code and error code to obtain an error code type; selects a combination to be processed from each combination, and the combination to be processed includes a target error code and a target transaction code; when the error code type of the target error code is a preset type, the cause of the test failure is determined according to the target transaction code combined with a predetermined data desensitization rule library. The problem that the cause of the test failure cannot be accurately located when the test fails is solved, the test failure cases are combined and classified by transaction code and error code, the combination to be processed for the current failure cause analysis is determined, the test failure cause is determined according to the target transaction code combined with the data desensitization rule library, and whether the test failure case is related to data desensitization is accurately judged. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a flow chart of a method for determining a test failure cause in Embodiment 1 of the present invention;
[0021] Figure 2 is a flow chart of a method for determining a test failure cause in Embodiment 2 of the present invention;
[0022] Figure 3 It is a structural schematic diagram of a device for determining a test failure cause in Embodiment 3 of the present invention;
[0023] Figure 4 It is a structural diagram of a computer device in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings. It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0025] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0026] In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.
[0027] Embodiment 1
[0028] Figure 1 A flow chart of a method for determining the cause of a test failure provided in the first embodiment of the present application is provided. The method is applicable to the case where the cause of the test failure is analyzed and located when the test fails. The method can be executed by a computer device, which can be composed of two or more physical entities or one physical entity. Generally speaking, the computer device can be a notebook, a desktop computer, a smart tablet, etc.
[0029] like Figure 1 As shown, a method for testing failure causes provided in this embodiment includes the following steps:
[0030] S101. Obtain at least one test failure case.
[0031] In this embodiment, a test failure case can be specifically understood as a case that was not successfully executed during the test. For example, if the test case is to call a database to obtain device data, and the database is not successfully called to obtain device data during the test process, the test fails, and this test case is a test failure case. The test failure case in this application refers to the test case obtained by replaying the production log in the test environment.
[0032] Specifically, the cases to be tested are acquired in advance, and replayed in the test environment. After the test is completed, the test success cases and test failure cases are counted, and the test failure cases are determined and acquired from each test case to locate and analyze the cause of the test failure. Alternatively, after the test is completed, the test failure cases are counted and saved, and the test failure cases are acquired when locating and analyzing the cause of the test failure.
[0033] S102: Determine the transaction code and error code of each test failure case, and combine and classify each transaction code and error code to obtain an error code type.
[0034] In this embodiment, the transaction code can be specifically understood as information identifying an operation, which can be a combination of numbers, letters, etc. For example, I3164 is a transaction code identifying a transfer operation, that is, the transaction code of all transfer operations is I3164. The error code can be specifically understood as information identifying an error, which can also be composed of numbers, letters, etc. For example, E6801 is an error code indicating that the user does not exist. The error code type can be specifically understood as the error type of the error code.
[0035] Specifically, analyze each test failure case, and determine the transaction code and error code of the test failure case based on the relevant information of the test failure case. Since the transaction code and error code both identify a type of data (an operation or error), the transaction code or error code corresponding to different test failure cases may be the same. Count all transaction codes and error codes, combine each transaction code and error code, combine each transaction code and each error code, and classify them according to the error code to determine the type of the error code.
[0036] S103. Select a combination to be processed from each combination, where the combination to be processed includes a target error code and a target transaction code.
[0037] In this embodiment, the combination to be processed can be specifically understood as the transaction code and error code combination for locating the cause of the current test failure. The target transaction code can be specifically understood as the transaction code in the combination to be processed; the target error code can be specifically understood as the error code in the combination to be processed.
[0038] Specifically, the test failure cases corresponding to each error code type are counted, and for each combination, the number of test failure cases is determined according to the error code type, and sorted according to certain rules, and a combination is selected from various combinations according to the sorting result, that is, a combination to be processed is determined according to the error code type. Alternatively, any combination is selected from each combination as the combination to be processed.
[0039] S104. When the error code type of the target error code is a preset type, determine the cause of the test failure according to the target transaction code in combination with a predetermined data desensitization rule library.
[0040] In this embodiment, the preset type can be specifically understood as a pre-set error code type. The data desensitization rule library can be specifically understood as a database that stores the data types that need to be desensitized and the corresponding desensitization rules, and can also be stored in other forms such as data tables. The reason for the test failure may be a data desensitization error, that is, the test failure caused by an incorrect data desensitization process. The reason for the test failure may be related to data desensitization, or it may not be related to data desensitization.
[0041] Specifically, determine whether the error code type of the target error code is a preset type. If the error code type of the target error code is a preset type, the cause of the test failure may be related to data masking; otherwise, the cause of the test failure is not related to data masking. Determine the target transaction code corresponding to the test case to be processed, and determine the associated field information based on the target transaction code. The field information is used to indicate some information of the test failure case, such as user account, mobile phone number, etc. Query the database masking rule base based on the field information to determine whether it is in the database masking rule base. If so, the cause of the test failure is related to data masking, otherwise, the cause of the test failure is not related to data masking.
[0042] The embodiment of the present invention provides a method for determining the cause of test failure, which includes obtaining at least one test failure case; determining the transaction code and error code of each test failure case, and combining and classifying each transaction code and error code to obtain an error code type; selecting a combination to be processed from each combination, wherein the combination to be processed includes a target error code and a target transaction code; when the error code type of the target error code is a preset type, determining the cause of the test failure according to the target transaction code combined with a predetermined data desensitization rule library. The problem that the cause of the test failure cannot be accurately located when the test fails is solved, the test failure cases are combined and classified by transaction code and error code, the combination to be processed for the current failure cause analysis is determined, the test failure cause is determined according to the target transaction code combined with the data desensitization rule library, and whether the test failure case is related to data desensitization is accurately judged.
[0043] Embodiment 2
[0044] Figure 2 This is a flow chart of a method for determining the cause of a test failure provided in Embodiment 2 of the present invention. The technical solution of this embodiment is further refined on the basis of the above technical solution, and specifically mainly includes the following steps:
[0045] S201. Obtain log data.
[0046] In this embodiment, log data can be specifically understood as data generated by operations under normal working conditions. Taking a banking system as an example, when the system is working normally, it performs corresponding business operations and records them in the operation log. When analyzing and locating the cause of a test failure, log data is obtained from the operation log.
[0047] S202: Play back the data according to the log data.
[0048] During the test, the test environment prepares standardized desensitized production data for day T, desensitized production logs for day T+1, and supporting programs. After initializing the test environment, use the log playback tool to play back the log data and complete the playback of the logs in the test environment. The base data refers to the large amount of data stored in the database in advance according to the business logic before the test.
[0049] S203: Generate a test report according to the data playback result, where the test report includes test failure cases and test success cases.
[0050] In this embodiment, the data playback result can be specifically understood as the result obtained after the log data is played back. The data playback result can be a test execution success, a test execution failure, etc. A test report is generated according to the data playback result to record the test results. The test report includes a test failure case and a test success case, as well as relevant information of each test case, such as a transaction code and an error code.
[0051] S204: Obtain at least one test failure case.
[0052] S205. Determine the transaction code and error code of each test failure case.
[0053] S206. Combine each transaction code with each error code respectively.
[0054] Combine each transaction code with each error code. The transaction codes are n1 and n2, and the error codes are m1, m2, and m3. The combinations include n1 and m1, n1 and m2, n1 and m3, n2 and m1, n2 and m2, and n2 and m3. That is, the number of combinations = the number of transaction codes × the number of error codes.
[0055] S207. For each error code in the combination, determine the error code type according to the error code information of the error code.
[0056] In this embodiment, the error code information can be specifically understood as information used to describe the error code. For each combination, the error code type is determined according to the error code. The error code information of the error code is obtained from the test report, and keywords are extracted from the error code information to determine the error code type. Taking the transaction system as an example, the error code type can be user device type, serial key type, certificate type, name type, telephone and mobile phone number type, password type, amount type, other type, etc.
[0057] S208. Determine the total error quantity according to the error code type and sort it, and determine the arrangement order of each combination of transaction code and error code.
[0058] In this embodiment, the total error amount can be specifically understood as the total number of failure cases of each error code type.
[0059] Calculate the number of transaction codes corresponding to each error code type, and count the total number of errors. Sort each error code type according to the total number of errors. You can also sort the transaction codes corresponding to each error code, and sort each error code and transaction code combination. The sorting method can be from large to small according to the total number of errors, or from small to large.
[0060] As an optional embodiment of this embodiment, this optional embodiment further determines the total error amount according to the error code type and performs sorting optimization as follows:
[0061] A1. For each error code type, count the error amount of each transaction code corresponding to the error code type, and determine the total error amount based on each error amount.
[0062] Specifically, determine the transaction code corresponding to each error code type, count the error amount of each transaction code, and add up the error amounts to get the total error amount, that is, the total error amount of each error code type.
[0063] A2. Sort the transaction codes corresponding to the same error code type according to the error amount.
[0064] For an error code type, the corresponding transaction codes are sorted, for example, the transaction codes are sorted from large to small according to the error amount, or from small to large.
[0065] A3. Compare the total error amounts and sort the error code types.
[0066] After sorting the transaction codes corresponding to the error code types in each combination, sort each error code type according to the total error amount, and the sorting method can be from large to small or from small to large. Preferably, the transaction code sorting method and the error code type sorting method adopt the same method, for example, both are sorted from large to small. When sorting, it is also possible to filter according to the total error amount of each error code type. Error code types with a total error amount less than a certain threshold are not sorted, and the cause of test failure is not analyzed.
[0067] For example, Table 1 provides a statistical table of error codes and transaction codes, in which the error codes and transaction codes are sorted from high to low according to the error amount. The explanation is the error cause explanation of each error code, which can be used as error code information to determine the error code type. The sequence number can be understood as the sequence number of the error code and transaction code combination.
[0068] Table 1: Statistics of error codes and transaction codes
[0069]
[0070]
[0071] S209: Determine the combination to be processed according to the arrangement order.
[0072] Specifically, different sorting methods may lead to different sorting orders. For example, when sorting from large to small, the error code type with a large amount of errors is in front, and in an error code type, the error code and transaction code combination with a large amount of errors is in front. The combination to be processed can be determined according to different priorities. For example, the error code and transaction code combination arranged in the front has a large amount of errors and a higher priority, so it is processed first and determined as the combination to be processed. Each combination corresponds to one or more test failure cases.
[0073] S210. When the error code type of the target error code is a preset type, determine interface information according to the target transaction code, where the interface information includes at least one field.
[0074] In this embodiment, the interface information can be specifically understood as request information for describing the transaction code.
[0075] Specifically, when the error code type of the target error code is a preset type, the interface information corresponding to the target transaction code is obtained, and the interface information is preset or generated. The interface information contains one or more fields, such as user name, ID number, mobile phone number, field length, document type and other fields. When the error code type of the target error code is not a preset type, the reason for the test failure is not related to data desensitization, and processing suggestions can be uniformly output. For example, when the error code type of the target error code is a user device error, the user device error is not a preset type, so a unified processing suggestion of "the teller equipment table needs to be updated in the public environment" is given.
[0076] S211. Filter out a target field from each field according to the target error code.
[0077] In this embodiment, the target field can be specifically understood as a field used for data desensitization judgment.
[0078] Specifically, there may be multiple fields corresponding to the target transaction code. When analyzing the cause of test failure, different error codes may correspond to different error types, and the error type may be related to a certain field. Therefore, each field is screened according to the target error code to obtain the target field related to the target error code. For example, if the error code type of the target error code is related to the user account, the user account is analyzed accordingly when analyzing the cause of test failure. When there are multiple types of fields, the field containing the user name can be used as the target field.
[0079] S212. If the data desensitization rule library contains the target field, determine that the test failure cause of each test failure case corresponding to the combination to be processed is a data desensitization error.
[0080] Determine the fields included in the data masking rule library and judge whether the target field exists. If so, determine that the test failure cause of each test failure case corresponding to the combination to be processed is a data masking error. Data masking error refers to an error in the data masking process, which may be caused by inconsistent masking rules or data processing errors during data masking. If not, it can be determined that the cause of the test failure is not related to data masking.
[0081] As an optional embodiment of this embodiment, this optional embodiment is further optimized to include:
[0082] B1. Select a test case to be processed from each test failure case corresponding to the combination to be processed.
[0083] In this embodiment, the test case to be processed may be specifically understood as a test failure case for which the cause of the test failure is currently being analyzed and located.
[0084] Specifically, the test failure cases corresponding to the combination to be processed are determined, and any one or more of them are selected as the test cases to be processed to analyze the cause of the test failure. When multiple test cases to be processed are selected, each test case to be processed is further analyzed and the cause of the test failure is located in the same way.
[0085] B2. Obtain the log data to be processed corresponding to the test case to be processed.
[0086] In this embodiment, the log data to be processed can be specifically understood as the log data of the test case to be processed. The log data to be processed of the test case to be processed is extracted from the log data.
[0087] B3. Parse the log data to be processed and determine the start and end positions of the target field.
[0088] Call the message parsing tool to parse and split the log data to be processed and locate the fields, and determine the start and end positions of the target field in the log data to be processed. For example, the start and end positions of the target field in the log data to be processed are bytes 13-15.
[0089] B4. Determine the preset position of the target field according to the predetermined log desensitization rule library.
[0090] In this embodiment, the log desensitization rule base can be specifically understood as a database including log desensitization rules, and can also be stored in the form of a data table.
[0091] Specifically, the log desensitization rules are determined in advance. For example, type A log data is desensitized by desensitization rule (function) 1, and the positions of different fields in the log data are recorded. A log desensitization rule library is constructed based on the above information. The log desensitization rule library is queried based on the target field to determine the preset position corresponding to the target field.
[0092] B5. Determine the target log desensitization rule corresponding to the target field in the log desensitization rule library.
[0093] In this embodiment, the target log desensitization rule can be specifically understood as the log desensitization rule corresponding to the target field. Since the log desensitization rule library stores different fields and their corresponding log desensitization rules, after determining the target field, the log desensitization rule library is queried according to the target field, and the log desensitization rule of the field matching the target field is determined as the target log desensitization rule.
[0094] B6. Determine whether the start and end positions are consistent with the preset positions and whether the target log desensitization rule is the latest rule. If so, determine the update status of the data desensitization rule library based on the error information of the test case to be processed; otherwise, determine that the log desensitization rule library is in a state to be updated.
[0095] In this embodiment, the error information can be specifically understood as relevant information of the test failure case, which can include the cause of the error, the data table accessed when the error is reported, and other related information. The update status can be a pending update status or a non-update status. Among them, the pending update status can be specifically understood as a status indicating that the data needs to be updated, and the non-update status means that the data does not need to be updated and no update processing is required.
[0096] Determine whether the start and end positions are consistent with the preset positions, and at the same time determine whether the target log desensitization rule is the latest version of the rule. If the start and end positions are consistent with the preset positions and the target log desensitization rule is the latest rule, query the data, interface, etc. that were accessed when the case test failed according to the error information of the test case to be processed. Determine whether the data desensitization rule is consistent with the log desensitization rule, and determine the update status of the data desensitization rule according to the matching result. If the start and end positions are inconsistent with the preset positions, and / or the target log desensitization rule is not the latest rule, determine that the log desensitization rule base is missing or incorrect, and needs to be updated, and modify the log desensitization rule base to the state to be updated. The staff or system automatically detects the state of the log desensitization rule base, and when it is detected that the log desensitization rule base is in the state to be updated, control the log desensitization rule base to be updated. The way to determine whether the target log desensitization rule is the latest version of the rule can be to determine the version, latest update time and other information of the target log desensitization rule, and compare it with the latest version. If it is inconsistent, it is determined that the target log desensitization rule is not the latest rule. If it is consistent, it is determined that the target log desensitization rule is the latest rule.
[0097] As an optional embodiment of this embodiment, this optional embodiment further optimizes the update state of the data desensitization rule base determined according to the error information of the test case to be processed as follows:
[0098] C1. Determine the access data table information according to the error information of the test case to be processed.
[0099] In this embodiment, the access data table information can be specifically understood as the data table information accessed when the test case to be processed fails to execute and reports an error. During testing, executing a test case may access multiple data tables, and the data tables accessed by executing different test cases may also be different. The data table accessed by each test case is recorded in the error information.
[0100] After the test case to be processed is determined, the error information of the test case to be processed is obtained from a database or other storage space, the error information is parsed, and the access data table information is determined.
[0101] C2. Determine the data desensitization rules corresponding to the access data table information.
[0102] The table structure of the access data table information is queried to determine the data desensitization rules corresponding to the access data table information. The data desensitization rules are stored in the data desensitization rule library. The data desensitization rules are usually desensitization rules for each field in the data table, for example, defining how to desensitize each field.
[0103] C3. If the data desensitization rule is inconsistent with the target log desensitization rule, the data desensitization rule library is determined to be in a state to be updated.
[0104] Determine whether the data desensitization rules are consistent with the target log desensitization rules. If not, the data desensitization rule base needs to be updated, and the status of the data desensitization rule base is changed to a pending update status so that the staff can manually update the data desensitization rule base or the system can automatically update the data desensitization rule base. If they are consistent, the data desensitization rule base does not need to be updated. It can also be determined whether the data desensitization rules are consistent in the same type of data in each subsystem (that is, the data desensitization rules are in the same field in different tables). If not, the data desensitization rule base is determined to be in a pending update status.
[0105] It can be known that if the number of test cases to be processed is multiple for each error code type in each combination, the update status of the data desensitization rule base and the log desensitization rule base will also be multiple. The multiple results may be the same or different. You can choose the result with the largest number as the final result, that is, the update status of the data desensitization rule base and the log desensitization rule base. You can also re-analyze and locate the cause of the test failure. The specific implementation method can be set according to the needs.
[0106] In this application, it is determined to be an error unrelated to data desensitization, and is printed as a list of pending cases, including transaction code, error code, error count, error code explanation, error detailed information, etc., which is only recorded or used for analysis by testers, and is not processed for the time being. After the investigation is completed (i.e., the cause of the test failure is determined, and the update status of the data desensitization rule base and the log desensitization rule base is determined), the bottom data and log data are desensitized again, the test environment is initialized, and log playback is performed again, and the overall test success rate is significantly improved. If the success rate has not yet reached the expected target, the method provided by this application can be repeatedly executed, the cause of the test failure is analyzed and located, and the data desensitization rule base and the log desensitization rule base are updated.
[0107] Exemplarily, data from the customer information subsystem is selected for verification, taking the transaction system as an example.
[0108] (1) Prepare data for the test environment, prepare transaction logs, initialize the test environment, and select customer information subsystem transactions from the full-volume production transaction logs that have been desensitized for transaction log playback.
[0109] (2) A total of 7,782,264 transactions were executed, with a transaction success rate of 79.35% and 1,607,038 failed transactions. There were 859 different combinations of transaction codes and error codes, and combinations with error counts of more than 10,000 (a total of 20) were selected for processing, involving 1,339,203 transactions.
[0110] (3) By searching the keywords (i.e., error code information) in the "Explanation" column of the test report, the error codes are classified according to the pre-set rules to obtain the error code types. The error codes and transaction codes are combined and the combinations are sorted as shown in Table 1. The combination to be processed is selected from each combination.
[0111] (4) Traverse the combination of transaction code and error code, and directly give the handling opinion of "the teller equipment table needs to be updated in the public environment" for user equipment errors such as "the user does not exist" or "the user's institution does not have such equipment" (that is, the error code type is not the preset type).
[0112] (5) Process the certificate errors in order, connect to the interface management system, and obtain the transaction interface information of I316, I331, I343, I322, and I037 in turn. Match the above interface information to find that all of them contain the certificate type and certificate number fields, which match the certificate number fields in the data desensitization rule library, and the desensitization rules for different types of certificate numbers are different. Therefore, it is determined that the transaction failed due to data desensitization. Through the dual query conditions of transaction code and error code, 10 transaction messages for each transaction are obtained as the test cases to be processed, and the message parsing tool is called to perform field parsing and field position positioning on the transaction message, and match it with the log desensitization rules to see if there is a desensitization rule for the certificate number for this transaction, and different desensitization methods are called for different certificate types. It is found that the desensitization rules of these transaction logs only have desensitization rules for the ID card number, and the field position setting does not cover the different situations of different message formats. Determine that the log desensitization rule library is in the state of pending update, and update the log desensitization rules for the above transactions.
[0113] (6) Continue to process other errors. For the problems of "No such contract number" and "Account does not exist" reported in I331 and I343 transactions, the contract number and account number fields cannot be matched in the data desensitization rule library by obtaining the transaction interface information. Therefore, it is determined that it is not related to data desensitization and is printed in the pending transaction list, including transaction code, error code, error count, error code explanation, error details, etc., for comprehensive analysis by testers.
[0114] (7) After updating the public environment teller equipment table, improving the log desensitization rules and re-desensitizing the transaction log, the overall transaction success rate was increased to 92%. The above process can be repeated as needed to solve individual problems exposed in some transactions after solving common problems.
[0115] The method provided in this application can help personnel who use log playback technology for system testing to get rid of their dependence on production data and reduce the risk of using production data. In the case where data desensitization technology is not perfect, it can quickly locate the cause of failure, classify and analyze by error type and impact range, and combine centralized disposal with differential disposal to quickly improve the success rate of the overall test. And through continuous testing and error analysis, testers can deepen their understanding of business rules and data desensitization, and continuously feed back data desensitization technology, so that data desensitization rules are gradually enriched and improved.
[0116] In addition to improving the level of data desensitization to increase the success rate of transactions, using production business log playback technology for testing can also set up a dedicated data isolation area to achieve physical isolation from the development and testing environment, and perform strict authority control to ensure data security. Using unmasked production data for direct testing can avoid data damage caused by improper desensitization that affects the success rate of transactions.
[0117] The embodiment of the present invention provides a method for determining the cause of test failure, which includes obtaining at least one test failure case; determining the transaction code and error code of each test failure case, and combining and classifying each transaction code and error code to obtain an error code type; selecting a combination to be processed from each combination, wherein the combination to be processed includes a target error code and a target transaction code; when the error code type of the target error code is a preset type, determining the cause of the test failure according to the target transaction code combined with a predetermined data desensitization rule library. The method solves the problem that the cause of the test failure cannot be accurately located when the test fails. The test failure cases are combined and classified by transaction codes and error codes to determine the combination to be processed for the current failure cause analysis, and the test failure cause is determined according to the target transaction code combined with the data desensitization rule library, and accurately determines whether the test failure case is related to data desensitization. By sorting the combinations of transaction codes and error codes, and selecting the combination to be processed according to the arrangement order to analyze and locate the cause of the test failure, important data can be selected for priority processing. After locating the cause of the test failure as a data desensitization error, check the update status of the data desensitization rule base and the log desensitization rule base to determine whether an update is needed, so as to achieve timely update of the data desensitization rule base and the log desensitization rule base, further improve the accuracy of data desensitization processing, and avoid test case failures due to improper data desensitization. After locating the cause of the test failure as data desensitization, propose a corresponding disposal plan. In the next test, the use of accurate data desensitization rule bases and log desensitization rule bases for data desensitization can improve the success rate of log playback.
[0118] Embodiment 3
[0119] Figure 3 This is a schematic diagram of the structure of a device for determining the cause of a test failure provided in Embodiment 3 of the present invention. The device comprises: a case acquisition module 31, a classification module 32, a combination selection module 33 and a cause determination module 34.
[0120] A case acquisition module 31, used to acquire at least one test failure case;
[0121] A classification module 32, for determining the transaction code and error code of each of the test failure cases, and combining and classifying each of the transaction code and error code to obtain an error code type;
[0122] A combination selection module 33, used to select a combination to be processed from each combination, wherein the combination to be processed includes a target error code and a target transaction code;
[0123] The reason determination module 34 is used to determine the reason for the test failure according to the target transaction code in combination with a predetermined data desensitization rule library when the error code type of the target error code is a preset type.
[0124] The embodiment of the present invention provides a device for determining the cause of test failure, which obtains at least one test failure case; determines the transaction code and error code of each test failure case, and combines and classifies each transaction code and error code to obtain an error code type; selects a combination to be processed from each combination, and the combination to be processed includes a target error code and a target transaction code; when the error code type of the target error code is a preset type, the cause of the test failure is determined according to the target transaction code combined with a predetermined data desensitization rule library. The problem that the cause of the test failure cannot be accurately located when the test fails is solved, the test failure cases are combined and classified by transaction code and error code, the combination to be processed for the current failure cause analysis is determined, the test failure cause is determined according to the target transaction code combined with the data desensitization rule library, and whether the test failure case is related to data desensitization is accurately judged.
[0125] Furthermore, the device also includes:
[0126] Log acquisition module, used to obtain log data;
[0127] A data playback module, used for playing back data according to the log data;
[0128] The test report generation module is used to generate a test report according to the data playback result, and the test report includes test failure cases and test success cases.
[0129] Furthermore, the classification module 32 includes:
[0130] A combining unit, used for combining each of the transaction codes with each of the error codes respectively;
[0131] The error code type determining unit is used to determine the error code type according to the error code information of the error code in each combination.
[0132] Furthermore, the combination selection module 33 includes:
[0133] A sorting unit, used to determine the total error amount according to the error code type and sort it, and determine the arrangement order of each combination of transaction code and error code;
[0134] The combination selection unit is used to determine the combination to be processed according to the arrangement order.
[0135] Furthermore, the sorting unit is specifically used to count the error amounts of each transaction code corresponding to each error code type, and determine the total error amount based on each error amount; sort the transaction codes corresponding to the same error code type according to each error amount; compare each total error amount, and sort each error code type.
[0136] Further, the cause determination module 34 includes:
[0137] An interface information determining unit, configured to determine interface information according to the target transaction code, wherein the interface information includes at least one field;
[0138] A field screening unit, used for screening out a target field from each of the fields according to the target error code;
[0139] A cause determination unit is used to determine that the cause of test failure of each of the test failure cases corresponding to the combination to be processed is a data desensitization error if the target field is included in the data desensitization rule library.
[0140] Furthermore, the device also includes:
[0141] A case determination module, used for selecting a test case to be processed from each test failure case corresponding to the combination to be processed;
[0142] A to-be-processed data acquisition module is used to acquire the to-be-processed log data corresponding to the to-be-processed test case;
[0143] A field position determination module, used to parse the log data to be processed and determine the start and end positions of the target field;
[0144] A preset position determination module, used to determine the preset position of the target field according to a predetermined log desensitization rule library;
[0145] A log desensitization rule determination module, used to determine the target log desensitization rule corresponding to the target field in the log desensitization rule library;
[0146] A judgment module is used to judge whether the start and end positions are consistent with the preset positions and whether the target log desensitization rules are the latest rules. If so, the update status of the data desensitization rule library is determined according to the error information of the test case to be processed; otherwise, the log desensitization rule library is determined to be in a state to be updated.
[0147] Furthermore, the judging module includes:
[0148] A data table information determination unit, used to determine access data table information according to the error information of the test case to be processed;
[0149] A data desensitization rule determination unit, used to determine the data desensitization rule corresponding to the access data table information;
[0150] The state determination unit is used to determine that the data desensitization rule library is in a state to be updated if the data desensitization rule is inconsistent with the target log desensitization rule.
[0151] The test failure cause determination device provided in the embodiment of the present invention can execute the test failure cause determination method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0152] Embodiment 4
[0153] Figure 4 A schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention is shown in FIG. Figure 4 As shown, the device includes a processor 40, a memory 41, an input device 42 and an output device 43; the number of processors 40 in the device can be one or more. Figure 4 A processor 40 is taken as an example; the processor 40, memory 41, input device 42 and output device 43 in the device can be connected by a bus or other means. Figure 4 The example of connecting through bus is taken in the following.
[0154] The memory 41, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the test failure cause determination method in the embodiment of the present invention (for example, the case acquisition module 31, the classification module 32, the combination selection module 33 and the cause determination module 34 in the test failure cause determination device). The processor 40 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 41, that is, implements the above-mentioned test failure cause determination method.
[0155] The memory 41 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 41 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 41 may further include a memory remotely arranged relative to the processor 40, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0156] The input device 42 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 43 may include a display device such as a display screen.
[0157] Embodiment 5
[0158] Embodiment 5 of the present invention further provides a storage medium including computer executable instructions, wherein the computer executable instructions are used to perform a method for determining a test failure cause when executed by a computer processor, the method comprising:
[0159] Get at least one test failure case;
[0160] Determine the transaction code and error code of each of the test failure cases, and combine and classify each of the transaction code and error code to obtain an error code type;
[0161] Selecting a combination to be processed from each combination, wherein the combination to be processed includes a target error code and a target transaction code;
[0162] When the error code type of the target error code is a preset type, the reason for the test failure is determined according to the target transaction code in combination with a predetermined data desensitization rule library.
[0163] Of course, the computer executable instructions of a storage medium containing computer executable instructions provided by an embodiment of the present invention are not limited to the method operations described above, and can also execute related operations in the test failure cause determination method provided by any embodiment of the present invention.
[0164] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0165] It is worth noting that in the embodiment of the above-mentioned test failure cause determination device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0166] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for determining the cause of a test failure, characterized in that: include: Get at least one test failure case; Determine the transaction code and error code of each of the test failure cases, and combine and classify each of the transaction code and error code to obtain an error code type; Selecting a combination to be processed from each combination, wherein the combination to be processed includes a target error code and a target transaction code; When the error code type of the target error code is a preset type, determining the cause of the test failure according to the target transaction code in combination with a predetermined data desensitization rule library; Determining the reason for the test failure according to the target transaction code in combination with a predetermined data desensitization rule base includes: Determine interface information according to the target transaction code, the interface information is used to describe request information of the transaction code, and the interface information includes at least one field; Filtering out a target field from each of the fields according to the target error code, wherein the target field is a field used for data desensitization judgment; If the data masking rule library contains the target field, it is determined that the test failure cause of each of the test failure cases corresponding to the combination to be processed is a data masking error.
2. The method according to claim 1, characterized in that Before obtaining at least one test failure case, the method further includes: Get log data; Performing data playback according to the log data; A test report is generated according to the data playback result, and the test report includes test failure cases and test success cases.
3. The method according to claim 1, characterized in that: The transaction codes and error codes are combined and classified to obtain error code types, including: Combining each of the transaction codes with each of the error codes respectively; For the error codes in each combination, the error code type is determined according to the error code information of the error code.
4. The method according to claim 1, characterized in that: The step of selecting a combination to be processed from each combination includes: Determine the total error amount according to the error code type and sort them, and determine the arrangement order of each combination of transaction code and error code; The combinations to be processed are determined in the order of arrangement.
5. The method according to claim 4, characterized in that The determining the total error amount and sorting according to the error code type includes: For each error code type, count the error amount of each transaction code corresponding to the error code type, and determine the total error amount based on each error amount; sorting the transaction codes corresponding to the same error code type according to the error amounts; The total error amounts are compared, and the error code types are sorted.
6. The method according to claim 1, characterized in that Also includes: Selecting a test case to be processed from each test failure case corresponding to the combination to be processed; Obtaining the log data to be processed corresponding to the test case to be processed; Parsing the log data to be processed to determine the start and end positions of the target field; Determining a preset position of the target field according to a predetermined log desensitization rule library; Determine the target log desensitization rule corresponding to the target field in the log desensitization rule library; Determine whether the start and end positions are consistent with the preset positions and whether the target log desensitization rule is the latest rule. If so, determine the update status of the data desensitization rule library according to the error information of the test case to be processed; Otherwise, it is determined that the log desensitization rule base is in a pending update state.
7. The method according to claim 6, characterized in that Determining the update status of the data desensitization rule library according to the error information of the test case to be processed includes: Determine access data table information according to the error information of the test case to be processed; Determine the data desensitization rules corresponding to the access data table information; If the data desensitization rule is inconsistent with the target log desensitization rule, it is determined that the data desensitization rule library is in a state to be updated.
8. A device for determining the cause of a test failure, characterized in that: include: A case acquisition module, used to acquire at least one test failure case; A classification module, used to determine the transaction code and error code of each test failure case, and combine and classify each transaction code and error code to obtain an error code type; A combination selection module, used for selecting a combination to be processed from various combinations, wherein the combination to be processed includes a target error code and a target transaction code; A cause determination module, configured to determine the cause of the test failure according to the target transaction code in combination with a predetermined data desensitization rule base when the error code type of the target error code is a preset type; The cause determination module comprises: An interface information determining unit, used to determine interface information according to the target transaction code, wherein the interface information is used to describe request information of the transaction code, and the interface information includes at least one field; A field screening unit, used to screen out a target field from each of the fields according to the target error code, wherein the target field is a field used for data desensitization judgment; A cause determination unit is used to determine that the cause of test failure of each of the test failure cases corresponding to the combination to be processed is a data desensitization error if the target field is included in the data desensitization rule library.
9. A computer device, characterized in that: The device comprises: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the test failure cause determination method as described in any one of claims 1-7.
Citation Information
Patent Citations
Error code conversion method, error code conversion device and computer readable storage medium
CN108462716A
Error positioning method and device based on log analysis
CN112965852A