Test case execution information determination method, device and computer equipment
Patent Information
- Application Number
- CN202210237264.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-10
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2042-03-10
AI Technical Summary
[0004]然而,金融类应用软件涉及的业务场景较多样化,测试人员负责的测试内容较多,上述由人工比对记录得到测试用例执行信息的方法,容易出现人工比对错误或记录错误,导致得到的测试用例执行信息与实际测试情况不一致,即得到的测试用例执行信息的准确度不高
[0059]上述测试用例执行信息的确定方法、装置、计算机设备、存储介质和计算机程序产品,通过将各测试用例对应的接口信息与交易日志信息集进行匹配,得到各测试用例的匹配结果,然后根据各测试用例的匹配结果确定各测试用例的执行状态,进而得到目标应用软件的测试用例执行信息。若某个测试用例成功执行,则说明至少有一次交易测试成功调用了该测试用例对应的全部接口,那么该交易测试产生的交易日志信息中将包含该测试用例对应的全部接口信息;若各交易日志信息均不包含该测试用例对应的全部接口信息,说明该测试用例未被执行或仅执行了一部分,可以将该两种情况均认为是执行失败。因此,根据各测试用例的匹配结果可以准确地确定出各测试用例的执行状态,进而得到目标应用软件的测试用例执行信息。相比人工比对记录的测试用例执行信息,本方法确定出的测试用例执行信息与目标应用软件的实际测试情况的一致性高,即测试用例执行信息的准确度高。
Smart Images

Figure CN114579462B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, computer device, storage medium, and computer program product for determining test case execution information. Background Technology
[0002] With the development of internet finance, banks and other financial institutions have launched financial applications such as mobile banking and e-life to facilitate online transactions for users. Before an application is officially launched, it needs to be tested for its functionality, performance, and security. Especially in the specialized financial field, the stability and security of the application greatly affect users' trust. Therefore, the application can only be launched for users after it has passed the required testing.
[0003] Currently, the testing of financial application software generally involves testers conducting transaction tests on the application software to be tested based on test cases. Then, the testers need to compare the transaction test results (i.e., the actual execution of the test cases by the application software) with the test cases one by one and record the execution status of each test case. This yields the test case execution information of the application software, which reflects the testing status of the application software.
[0004] However, financial application software involves a variety of business scenarios, and testers are responsible for a lot of testing content. The above-mentioned method of obtaining test case execution information by manually comparing and recording is prone to errors in manual comparison or recording, resulting in inconsistencies between the obtained test case execution information and the actual test situation, that is, the accuracy of the obtained test case execution information is not high. Summary of the Invention
[0005] Therefore, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for determining test case execution information that can improve the accuracy of test case execution information, in order to address the above-mentioned technical problems.
[0006] Firstly, this application provides a method for determining test case execution information. The method includes:
[0007] Obtain the test information set and transaction log information set corresponding to the target application software; the test information set contains multiple test cases and several interface information corresponding to each test case; the interface information is the information of the interface called by the target application software when executing the test cases; the transaction log information set contains the transaction log information generated by the target application software when executing each test case.
[0008] The matching results for each test case are obtained by matching several interface information corresponding to each test case with the transaction log information set.
[0009] Based on the matching results of each test case, the execution status of each test case is determined, and the test case execution information of the target application software is obtained based on the execution status of each test case.
[0010] In one embodiment, each of the interface information corresponds to a level, and the level of each interface information represents the calling order of the interface information in the corresponding test case;
[0011] The step of matching the test cases with the transaction log information set based on the interface information corresponding to each test case to obtain the matching result of each test case includes:
[0012] The interface information corresponding to the minimum level is used as the target interface information, and the target interface information is matched with the transaction log information set;
[0013] For each target interface information, if none of the transaction log information in the transaction log information set contains the target interface information, the test case corresponding to the target interface information and the level of the target interface information is determined as the first test case that fails to match.
[0014] If at least one transaction log information in the transaction log information set contains the target interface information, the test case corresponding to the target interface information and the level of the target interface information is determined as the second test case;
[0015] If the target interface information is the last-level interface information of the second test case, the matching result of the second test case is determined to be a successful match;
[0016] If the target interface information is not the last-level interface information of the second test case, the next-level interface information of the target interface information is taken as the new target interface information, the set of at least one transaction log information is determined as the new transaction log information set, and the process of matching the target interface information with the transaction log information set is returned.
[0017] In one embodiment, the step of matching the test cases with the transaction log information set based on several interface information corresponding to each test case to obtain the matching result of each test case includes:
[0018] For each test case, several interface information corresponding to the test case are matched with the transaction log information set. If at least one transaction log information in the transaction log information set contains all the interface information corresponding to the test case, the matching result of the test case is determined to be a successful match.
[0019] If none of the transaction log information in the transaction log information set contains all the interface information corresponding to the test case, the matching result of the test case will be determined as a matching failure.
[0020] In one embodiment, determining the execution status of each test case based on the matching results of each test case includes:
[0021] For each test case, if the matching result of the test case is a successful match, the execution status of the test case is determined to be successful.
[0022] If the matching result of the test case is a failure, the execution status of the test case will be determined as execution failure.
[0023] In one embodiment, each transaction log in the transaction log information set further includes transaction status information; the transaction status information indicates whether the target application software's execution of the test case is a successful transaction or a failed transaction.
[0024] The step of determining the execution status of the test case as successful when the matching result of the test case is a successful match includes:
[0025] If the matching result of the test case is a successful match, the at least one transaction log information containing all interface information corresponding to the test case is determined as the target transaction log information;
[0026] If the transaction status information contained in the target transaction log information indicates that the transaction was successful, the execution status of the test case will be determined as successful.
[0027] In one embodiment, obtaining the test information set corresponding to the target application software includes:
[0028] Obtain information on each business scenario corresponding to the target application software, and test cases corresponding to each business scenario.
[0029] Extract the interface information corresponding to each of the aforementioned business scenario information;
[0030] A test information set is obtained based on the test cases corresponding to each of the aforementioned business scenario information and the interface information corresponding to each of the aforementioned business scenario information.
[0031] Secondly, this application also provides a device for determining test case execution information. The device includes:
[0032] The acquisition module is used to acquire the test information set and the transaction log information set corresponding to the target application software; the test information set includes multiple test cases and several interface information corresponding to each test case; the interface information is the information of the interface called by the target application software when executing the test case; the transaction log information set includes the transaction log information generated by the target application software when executing each test case.
[0033] The matching module is used to match the transaction log information set with several interface information corresponding to each test case to obtain the matching result of each test case.
[0034] The determination module is used to determine the execution status of each test case based on the matching results of each test case, and to obtain the test case execution information of the target application software based on the execution status of each test case.
[0035] In one embodiment, each of the interface information corresponds to a level, and the level of each interface information represents the calling order of the interface information in the corresponding test case;
[0036] The matching module is specifically used for:
[0037] The interface information corresponding to the lowest level is taken as the target interface information, and the target interface information is matched with the transaction log information set. For each target interface information, if none of the transaction log information in the transaction log information set contains the target interface information, the test case corresponding to the target interface information and its level is determined as the first test case of mismatch. If at least one transaction log information in the transaction log information set contains the target interface information, the test case corresponding to the target interface information and its level is determined as the second test case. If the target interface information is the last level interface information of the second test case, the matching result of the second test case is determined as a successful match. If the target interface information is not the last level interface information of the second test case, the next level interface information of the target interface information is taken as the new target interface information, the set of the at least one transaction log information is determined as the new transaction log information set, and the process of matching the target interface information with the transaction log information set is returned.
[0038] In one embodiment, the matching module is specifically used for:
[0039] For each test case, several interface information corresponding to the test case are matched with the transaction log information set. If at least one transaction log information in the transaction log information set contains all the interface information corresponding to the test case, the matching result of the test case is determined to be a successful match; if none of the transaction log information in the transaction log information set contains all the interface information corresponding to the test case, the matching result of the test case is determined to be a failed match.
[0040] In one embodiment, the determining module is specifically used for:
[0041] For each test case, if the matching result of the test case is a successful match, the execution status of the test case is determined to be successful; if the matching result of the test case is a failed match, the execution status of the test case is determined to be failed.
[0042] In one embodiment, each transaction log in the transaction log information set further includes transaction status information; the transaction status information indicates whether the target application software's execution of the test case is a successful transaction or a failed transaction.
[0043] The determining module is specifically used for:
[0044] If the matching result of the test case is a successful match, the at least one transaction log information containing all interface information corresponding to the test case is determined as the target transaction log information; if the transaction status information contained in the target transaction log information indicates that the transaction is successful, the execution status of the test case is determined as successful execution.
[0045] In one embodiment, the acquisition module is specifically used for:
[0046] Obtain information on each business scenario corresponding to the target application software, as well as test cases corresponding to each business scenario; extract interface information corresponding to each business scenario from each business scenario; and obtain a test information set based on the test cases and interface information corresponding to each business scenario.
[0047] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0048] Obtain the test information set and transaction log information set corresponding to the target application software; the test information set contains multiple test cases and several interface information corresponding to each test case; the interface information is the information of the interface called by the target application software when executing the test cases; the transaction log information set contains the transaction log information generated by the target application software when executing each test case.
[0049] The matching results for each test case are obtained by matching several interface information corresponding to each test case with the transaction log information set.
[0050] Based on the matching results of each test case, the execution status of each test case is determined, and the test case execution information of the target application software is obtained based on the execution status of each test case.
[0051] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0052] Obtain the test information set and transaction log information set corresponding to the target application software; the test information set contains multiple test cases and several interface information corresponding to each test case; the interface information is the information of the interface called by the target application software when executing the test cases; the transaction log information set contains the transaction log information generated by the target application software when executing each test case.
[0053] The matching results for each test case are obtained by matching several interface information corresponding to each test case with the transaction log information set.
[0054] Based on the matching results of each test case, the execution status of each test case is determined, and the test case execution information of the target application software is obtained based on the execution status of each test case.
[0055] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0056] Obtain the test information set and transaction log information set corresponding to the target application software; the test information set contains multiple test cases and several interface information corresponding to each test case; the interface information is the information of the interface called by the target application software when executing the test cases; the transaction log information set contains the transaction log information generated by the target application software when executing each test case.
[0057] The matching results for each test case are obtained by matching several interface information corresponding to each test case with the transaction log information set.
[0058] Based on the matching results of each test case, the execution status of each test case is determined, and the test case execution information of the target application software is obtained based on the execution status of each test case.
[0059] The aforementioned method, apparatus, computer equipment, storage medium, and computer program product for determining test case execution information match the interface information corresponding to each test case with the transaction log information set to obtain the matching results for each test case. Then, based on the matching results, the execution status of each test case is determined, thereby obtaining the test case execution information of the target application software. If a test case executes successfully, it indicates that at least one transaction test successfully called all interfaces corresponding to that test case, and the transaction log information generated by that transaction test will contain all interface information corresponding to that test case. If none of the transaction log information contains all interface information corresponding to that test case, it indicates that the test case was not executed or only partially executed; both situations can be considered execution failures. Therefore, based on the matching results of each test case, the execution status of each test case can be accurately determined, thereby obtaining the test case execution information of the target application software. Compared to manually compared and recorded test case execution information, the test case execution information determined by this method has a high consistency with the actual testing situation of the target application software, i.e., the accuracy of the test case execution information is high. Attached Figure Description
[0060] Figure 1 This is a flowchart illustrating a method for determining test case execution information in one embodiment;
[0061] Figure 2 This is a flowchart illustrating the process of obtaining the matching results of each test case in one embodiment.
[0062] Figure 3 This is a flowchart illustrating the process of obtaining the matching results of each test case in another embodiment;
[0063] Figure 4 This is a structural block diagram of a device for determining test case execution information in one embodiment;
[0064] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0066] First, before introducing the technical solutions of the embodiments of this application, we will first introduce the technical background or technical evolution on which the embodiments of this application are based. With the development of internet finance, banks and other financial institutions have launched financial application software such as mobile banking and e-life to facilitate users' online transactions. Before an application software is officially launched, it needs to be tested in terms of functionality, performance, and security. Especially in the more specialized financial field, the stability and security of the application software will greatly affect users' trust. Therefore, the application software can only be launched for users after the testing meets the requirements. At present, the testing of financial application software is generally carried out by testers conducting transaction tests on the application software to be tested according to test cases. Then, the testers need to compare the transaction test results (that is, the actual execution of the test cases by the application software) with the test cases one by one and record the execution status of each test case. For example, if a tester determines that a test case has been successfully executed based on transaction testing results, the execution status of that test case is recorded as "execution successful"; if a test case is determined to have failed, it is recorded as "execution failed"; if a transaction test was not performed on a test case, its execution status is "not yet executed." This provides the test case execution information for the application software. Testers and product managers can understand the testing status of the application software based on this information. If the execution status of all test cases in the execution information is "execution successful," it indicates that the application software has passed the corresponding tests.
[0067] However, due to the large variety of financial application software launched by banks, and the diverse business scenarios involved in each application software, testers are responsible for a large amount of testing content. The aforementioned method of obtaining test case execution information by manually comparing and recording is prone to errors in manual comparison or recording, resulting in inconsistencies between the obtained test case execution information and the actual testing situation of the application software, i.e., the accuracy of the obtained test case execution information is not high. If application software that actually fails the test is launched due to errors in comparison and recording, it may cause significant losses. Against this background, the applicant, through long-term research and development and experimental verification, proposes the method for determining test case execution information in this application, which can obtain test case execution information with higher accuracy. In addition, it should be noted that the applicant has devoted a great deal of creative effort to discovering the technical problem of this application and the technical solution described in the following embodiments.
[0068] In one embodiment, such as Figure 1As shown, a method for determining test case execution information is provided. Taking the application of this method to a terminal as an example, it can be understood that this method can also be applied to a server, and to a system including both a terminal and a server, and is implemented through the interaction between the terminal and the server. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices, etc., and the server can be a standalone server or a server cluster composed of multiple servers. In this embodiment, the method includes the following steps:
[0069] Step 101: Obtain the test information set and transaction log information set corresponding to the target application software.
[0070] The test information set includes multiple test cases and several interface information corresponding to each test case. The interface information refers to the interfaces called by the target application software when executing the test cases; the interface information can be the interface name or other identifiers (such as interface number). The transaction log information set contains the transaction log information generated by the target application software when executing each test case.
[0071] In implementation, testers can set corresponding test cases for each business scenario involved in the target application software and determine several interface information corresponding to each test case. For example, for the target application software "eLife," its "eLife SMS Installment Payment" business scenario can be set according to this business scenario, and the corresponding transaction test of the test case can be executed through the target application software (eLife) to generate transaction log information. If the transaction test of the corresponding test case is successfully executed, the target application software will call "the interface corresponding to installment payment (e.g., denoted as interface a1) - the interface corresponding to SMS installment (e.g., denoted as interface b1)." Therefore, the interface information corresponding to this test case is "interface a1 and interface b1 (which can be the names or other identifiers of each interface)." The terminal can pre-store each test case and interface information to obtain a test information set. Testers can execute the corresponding transaction test through the target application software according to each test case to obtain the transaction log information generated by each transaction test. Each transaction log information can contain information about the interfaces actually called by the target application software when executing the corresponding transaction test.
[0072] In this embodiment, the terminal can obtain a pre-stored test information set and transaction log information set corresponding to the target application software. It is understood that the test information set obtained by the terminal may contain all test cases set for the target application software, or it may contain only some test cases. Testers can determine whether the terminal obtains a test information set containing all or some test cases based on current testing requirements.
[0073] Step 102: Match the information of several interfaces corresponding to each test case with the transaction log information set to obtain the matching results of each test case.
[0074] In implementation, after obtaining the test information set and the transaction log information set, the terminal can match the interface information corresponding to each test case in the test information set with the transaction log information set. For example, the interface information corresponding to each test case can be used as keywords to perform keyword matching in the transaction log information set to obtain the matching results of each test case.
[0075] Step 103: Based on the matching results of each test case, determine the execution status of each test case, and obtain the test case execution information of the target application software based on the execution status of each test case.
[0076] In implementation, the terminal can determine the execution status of each test case based on the matching results. For example, if the interface information corresponding to a certain test case is used as a keyword, and at least one transaction log entry is matched when performing keyword matching in the transaction log information set (meaning at least one transaction log entry contains the interface information corresponding to the test case), then the execution status of the test case can be determined as successful. If no transaction log entry is matched (meaning none of the transaction log entries in the transaction log information set contain the interface information corresponding to the test case), then the execution status of the test case can be determined as failed. The terminal can then summarize the execution status of each test case to obtain the test case execution information for the target application software. The test case execution information includes at least the identifier of the test case (e.g., the test case number or name) and the execution status of the test case.
[0077] Optionally, the terminal can also obtain the tester information corresponding to each test case from the test information set, and output all test case execution information or only the execution information of test cases with execution status of execution failure to the testers and relevant personnel through OA system reminders, system to-dos or email reminders, so as to realize an automatic early warning mechanism.
[0078] The method for determining test case execution information described above involves obtaining the test information set and transaction log information set corresponding to the target application software. Several interface information items corresponding to each test case in the test information set are matched with the transaction log information set to obtain the matching results for each test case. Then, the execution status of each test case is determined based on the matching results, thus obtaining the test case execution information of the target application software. If a test case executes successfully, it means that at least one transaction test successfully called all the interfaces corresponding to that test case. Therefore, the transaction log information generated by that transaction test will contain all the interface information corresponding to that test case. If none of the transaction log information contains all the interface information corresponding to that test case, it means that the test case was not executed or only partially executed. Both of these situations can be considered execution failures. Therefore, matching the interface information corresponding to each test case with the transaction log information set allows for accurate determination of the execution status of each test case based on the matching results, resulting in highly accurate test case execution information for the target application software. In other words, the test case execution information determined by this method has high consistency with the actual testing situation of the target application software, while saving manpower and improving efficiency.
[0079] In one embodiment, each interface information corresponds to a level, and the level of each interface information indicates the calling order of that interface information in its respective test case. For example... Figure 2 As shown, the specific process of obtaining the matching results of each test case in step 102 includes the following steps:
[0080] Step 201: Take the interface information corresponding to the minimum level as the target interface information, and match the target interface information with the transaction log information set.
[0081] In implementation, each test case corresponds to several interface information entries, and each interface information entry has a level. The level of each interface information entry indicates the calling order of that interface information within its respective test case. For example, for the aforementioned "e-Life SMS Installment Payment" business scenario, the test cases set according to this business scenario have corresponding interface information "interface a1 and interface b1". The calling order of each interface is to call interface a1 first, then interface b1. Therefore, the level of interface a1 can be set to level one, and the level of interface b1 can be set to level two. The level of interface information corresponding to other test cases is similar. The interface information corresponding to each test case, and the level of each interface information, can be stored in tabular form, as shown in Table 1, the test case interface information table. Different test cases may contain some of the same interface information, and the level of the same interface information in different test cases may be the same or different. For example, in Table 1, test case 1 and test case 2 contain the same interface information a1, and the level of interface information a1 is the same in the two test cases; test case 3 and test case 5 contain the same interface information c1, but the level of interface information c1 is different in the two test cases.
[0082] Table 1 Test Case Interface Information Table
[0083]
[0084] The terminal can use the interface information corresponding to the lowest level as the target interface information. Taking the test case interface information table shown in Table 1 as an example, the interface information corresponding to the lowest level is the first-level interface information. Therefore, the terminal can use the first-level interface information as the target interface information. In this example, the target interface information includes a1 and a2. Then, the terminal can match each target interface information with the transaction log information set. For example, the terminal can use the target interface information "a1" as a keyword to match each transaction log information in the transaction log information set.
[0085] Step 202: For each target interface information, if none of the transaction log information in the transaction log information set contains the target interface information, the test case corresponding to the target interface information and the level of the target interface information is determined as the first test case of the matching failure.
[0086] In implementation, for each target interface information, if the terminal does not find any transaction log information containing the target interface information in the transaction log information set, that is, if none of the transaction log information in the transaction log information set contains the target interface information, then the terminal can determine the test case corresponding to the target interface information and the level of the target interface information as the first test case of the matching failure. For example, as shown in test cases 1 to 6 in Table 1, if the terminal does not find any transaction log information containing the target interface information "a2" in the transaction log information set, then the terminal can determine the test cases corresponding to the target interface information "a2" and the first level (the level of the target interface information "a2" is one level) (i.e., test cases 5 and 6) as the first test cases of the matching failure, that is, the matching results of test cases 5 and 6 are determined as matching failures.
[0087] Step 203: If at least one transaction log information in the transaction log information set contains target interface information, the test case corresponding to the target interface information and the level of the target interface information is determined as the second test case.
[0088] In implementation, for each target interface information, if the terminal matches at least one transaction log information containing the target interface information in the transaction log information set, the terminal can determine the test case corresponding to the target interface information and the level of the target interface information as the second test case. For example, as shown in test cases 1 to 6 in Table 1, if the terminal matches at least one transaction log information (e.g., 4) containing the target interface information "a1" in the transaction log information set, the terminal can determine the test case corresponding to the target interface information "a1" and the level (the level of the target interface information "a1" is level 1) (i.e., test cases 1 to 4) as the second test case.
[0089] Step 204: If the target interface information is the last-level interface information of the second test case, determine the matching result of the second test case as a successful match.
[0090] In practice, after the terminal determines the second test case, it can further determine whether the target interface information is the last level interface information of the second test case. If the target interface information is the last level interface information of the second test case, the matching result of the second test case is determined to be a successful match.
[0091] Step 205: If the target interface information is not the last-level interface information of the second test case, take the next-level interface information of the target interface information as the new target interface information, determine the set of at least one transaction log information as the new transaction log information set, and return to execute the step of matching the target interface information with the transaction log information set.
[0092] In implementation, if the terminal determines that the target interface information is not the last-level interface information of the second test case, the terminal can use the next-level interface information of the target interface information as the new target interface information, and determine the set of at least one transaction log information containing the target interface information as the new transaction log information set. Then, it returns to the step of matching the target interface information with the transaction log information set in step 201. For example, in the example in step 203, if the target interface information "a1" is not the last-level interface information of the second test cases 1 to 4, the terminal can use the next-level interface information of the target interface information "a1" (i.e., the second-level interface information b1, b2, and b3) as the new target interface information, and the terminal can form a new transaction log information set from the four transaction log information containing the target interface information "a1". Then, the terminal can match the new target interface information (i.e., the second-level interface information b1, b2, and b3) with the new transaction log information set.
[0093] For each new target interface information, if the terminal does not match any transaction log information containing the new target interface information in the new transaction log information set, such as not matching any transaction log information containing interface information b1, then the terminal can determine the test case (i.e., test case 1) in the previously determined second test case that corresponds to the new target interface information (i.e., interface information b1) and the level (i.e., second level) of the new target interface information as the first test case of the matching failure; if the terminal matches at least one transaction log information containing the new target interface information in the new transaction log information set, such as matching one transaction log information containing interface information b2 and two transaction log information containing the new target interface information b3, then the terminal can determine the test case (i.e., test case 2) corresponding to the new target interface information b2 and the level (i.e., second level) of the new target interface information, and the test cases (i.e., test cases 3 and 4) corresponding to the new target interface information b3 and the level (i.e., second level) of the new target interface information as the second test case, and further determine whether the new target interface information is the last level interface information of the second test case.
[0094] In this example, if target interface information b2 is the last level interface information of test case 2, the terminal can determine the matching result of test case 2 as a successful match. If target interface information b3 is not the last level interface information of test cases 3 and 4, the terminal can take the next level interface information (interface information c1 and c2) of target interface information b3 as the new target interface information, and determine the set of two transaction log information containing target interface information b3 as the new transaction log information set. Then, the terminal returns to execute the step of matching the target interface information with the transaction log information set, thereby determining the matching result of each test case.
[0095] In this embodiment, the interface information corresponding to each test case is hierarchically classified, and the interface information is matched level by level, starting from the smallest level. If every level of interface information (from the smallest level to the last level) corresponding to a certain test case is successfully matched, it means that at least one transaction log information contains all the interface information corresponding to the test case, so the matching result of the test case is determined to be a successful match. If the target interface information of a certain level fails to match (i.e., no transaction log information containing the target interface information of the previous level is matched in the transaction log information set), the matching result of each test case corresponding to the target interface information of that level is determined to be a failed match. That is, there is no need to further match the interface information of the next level, and the matching result of each test case corresponding to the target interface information of that level can be obtained at the same time. Thus, the matching result of each test case can be determined accurately and efficiently.
[0096] In one embodiment, such as Figure 3 As shown, the specific process of obtaining the matching results corresponding to each test case in step 102 includes the following steps:
[0097] Step 301: For each test case, match the interface information corresponding to the test case with the transaction log information set. If at least one transaction log information in the transaction log information set contains all the interface information corresponding to the test case, the matching result of the test case is determined to be a successful match.
[0098] Step 302: If none of the transaction log information in the transaction log information set contains all the interface information corresponding to the test case, the matching result of the test case is determined as a matching failure.
[0099] In implementation, the terminal can match several interface information corresponding to each test case with the transaction log information set obtained in step 101. For example, the terminal can use the two interface information "a1" and "b1" corresponding to test case 1 in Table 1 as keywords to perform keyword matching in the transaction log information set. If at least one transaction log information is matched and contains all the interface information "a1" and "b1" corresponding to the test case, the terminal can determine the matching result of test case 1 as a successful match; if no transaction log information containing interface information "a1" and "b1" is matched, that is, if none of the transaction log information contains all the interface information corresponding to the test case, the terminal can determine the matching result of test case 1 as a failed match.
[0100] This embodiment proposes another specific method for matching interface information. By performing a full match between all interface information corresponding to each test case and all transaction log information in the transaction log information set, the matching result of each test case can be accurately determined.
[0101] In one embodiment, the process of determining the execution status of each test case in step 103 specifically includes: for each test case, if the matching result of the test case is a successful match, the execution status of the test case is determined to be successful; if the matching result of the test case is a failed match, the execution status of the test case is determined to be failed.
[0102] In implementation, for each test case, if the matching result for the test case is a successful match, the terminal can determine the execution status of the test case as successful; if the matching result for the test case is a failed match, the terminal can determine the execution status of the test case as failed.
[0103] In this embodiment, based on the matching results corresponding to each test case, the execution status of each test case can be effectively and accurately determined as either successful or unsuccessful.
[0104] In one embodiment, each transaction log in the transaction log information set further includes transaction status information, which indicates whether the transaction status of the target application software executing the test case is successful or failed. The process of determining the execution status of the test case as successful includes the following steps:
[0105] If the test case matching result is successful, at least one transaction log information containing all interface information corresponding to the test case is determined as the target transaction log information; if the transaction status information contained in the target transaction log information indicates that the transaction is successful, the execution status of the test case is determined as successful.
[0106] In implementation, transaction log information can also include transaction status information. This refers to the transaction status information of each transaction test performed by the tester through the target application software according to each test case. This status information indicates whether the target application software's execution of each test case resulted in a successful or failed transaction. If the terminal determines that the test case matching result is successful, it means that, according to the aforementioned interface information matching steps, at least one transaction log entry contains all the interface information corresponding to that test case. Therefore, the terminal can identify the transaction log entry containing all the interface information corresponding to that test case as the target transaction log entry and further determine the transaction status information within that target transaction log entry. If the transaction status information in the target transaction log entry indicates a successful transaction, the terminal can determine the execution status of that test case as successful. If the target transaction log entry indicates a failed transaction, the terminal can determine the execution status of that test case as failed, or mark it as a third execution status, such as marked as "entire process executed but transaction failed." Understandably, for test cases whose target is transaction failure, such as counterexamples or destructive tests, the execution status of the test case can be determined as successful if the transaction status information in the target transaction log indicates a transaction failure. The transaction test target of each test case can be pre-identified to distinguish whether the test case's target is transaction success or transaction failure.
[0107] In this embodiment, if the test case matching result is successful, the execution status of the test case can be further determined based on the transaction status information. This allows for a more accurate determination of the test case execution information. Furthermore, test cases that are successfully matched but do not achieve the transaction test objective can be marked as a third execution status, so that testers can better understand the execution status of each test case.
[0108] In one embodiment, the process of obtaining the test information set in step 101 specifically includes: obtaining the business scenario information corresponding to the target application software and the test cases corresponding to each business scenario information; extracting the interface information corresponding to each business scenario information from the business scenario information; and obtaining the test information set based on the test cases corresponding to each business scenario information and the interface information corresponding to each business scenario information.
[0109] During implementation, in the process of developing the target application software, information files (i.e., business scenario information) related to each business scenario can be generated, allowing testers to set corresponding test cases based on this information. The terminal can obtain the business scenario information corresponding to each business scenario, as well as the corresponding test cases, and extract the interface information from the business scenario information. Then, the terminal can summarize the test cases and interface information corresponding to each business scenario to obtain a test information set for subsequent interface information matching steps.
[0110] Optionally, transaction log information generated by testers during transaction testing can be stored in the log module. The log module can also contain transaction log information from other testers and other application software. The terminal can pre-filter the transaction log information in the log module. For example, tester identity information, test time, and application software identifiers can be used as filtering criteria to select qualified transaction log information and combine them into a transaction log information set for subsequent interface information matching, thereby improving matching efficiency.
[0111] In one example, testers need to test multiple applications and determine the test case execution information for each application. The terminal can first use the identification information of each application as keywords to match it with the transaction log information in the log module to obtain the transaction log information set corresponding to each application. Each application is a target application. For each application, the method for determining the test case execution information described above is executed to obtain the test case execution information for each application.
[0112] In this embodiment, by extracting interface information through the business scenario information corresponding to the target application software, it can be ensured that the interface information contained in the test information set is the information of all interfaces called during the successful execution of each test case. Then, the matching result of each test case can be obtained based on the interface information, which can ensure the accuracy of the execution information of each test case.
[0113] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0114] Based on the same inventive concept, this application also provides a test case execution information determination device for implementing the test case execution information determination method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more test case execution information determination device embodiments provided below can be found in the limitations of the test case execution information determination method described above, and will not be repeated here.
[0115] In one embodiment, such as Figure 4 As shown, a device 400 for determining test case execution information is provided, comprising: an acquisition module 401, a matching module 402, and a determination module 403, wherein:
[0116] The acquisition module 401 is used to acquire the test information set and transaction log information set corresponding to the target application software. The test information set contains multiple test cases and several interface information corresponding to each test case. The interface information is the information of the interface called by the target application software when executing the test cases. The transaction log information set contains the transaction log information generated by the target application software when executing each test case.
[0117] The matching module 402 is used to match the interface information corresponding to each test case with the transaction log information set to obtain the matching result of each test case.
[0118] The determination module 403 is used to determine the execution status of each test case based on the matching results of each test case, and to obtain the test case execution information of the target application software based on the execution status of each test case.
[0119] In one embodiment, each interface information corresponds to a level, and the level of each interface information represents the calling order of that interface information in its respective test case. The matching module 402 is specifically used for:
[0120] The interface information corresponding to the smallest level is taken as the target interface information, and the target interface information is matched with the transaction log information set. For each target interface information, if none of the transaction log information in the transaction log information set contains the target interface information, the test case corresponding to the target interface information and its level is determined as the first test case of mismatch. If at least one transaction log information in the transaction log information set contains the target interface information, the test case corresponding to the target interface information and its level is determined as the second test case. If the target interface information is the last level interface information of the second test case, the matching result of the second test case is determined as a successful match. If the target interface information is not the last level interface information of the second test case, the next level interface information of the target interface information is taken as the new target interface information, the set consisting of at least one transaction log information is determined as the new transaction log information set, and the process of matching the target interface information with the transaction log information set is returned.
[0121] In one embodiment, the matching module 402 is specifically used for:
[0122] For each test case, the corresponding interface information is matched with the transaction log information set. If at least one transaction log information in the transaction log information set contains all the interface information corresponding to the test case, the matching result of the test case is determined to be a successful match; if none of the transaction log information in the transaction log information set contains all the interface information corresponding to the test case, the matching result of the test case is determined to be a failed match.
[0123] In one embodiment, the determining module 403 is specifically used for:
[0124] For each test case, if the matching result of the test case is successful, the execution status of the test case is determined to be successful; if the matching result of the test case is unsuccessful, the execution status of the test case is determined to be unsuccessful.
[0125] In one embodiment, each transaction log in the transaction log information set further includes transaction status information; the transaction status information indicates whether the target application software's test case execution transaction status is successful or failed. The determination module 403 is specifically used for:
[0126] If the test case matching result is successful, at least one transaction log information containing all interface information corresponding to the test case is determined as the target transaction log information; if the transaction status information contained in the target transaction log information indicates that the transaction is successful, the execution status of the test case is determined as successful.
[0127] In one embodiment, the acquisition module 401 is specifically used for:
[0128] Obtain information on each business scenario corresponding to the target application software, as well as test cases corresponding to each business scenario; extract interface information corresponding to each business scenario from the information on each business scenario; and obtain a test information set based on the test cases and interface information corresponding to each business scenario.
[0129] Each module in the aforementioned test case execution information determination device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0130] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a method for determining test case execution information. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0131] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0132] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0133] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0134] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0135] The method, apparatus, computer equipment, storage medium, and computer program product for determining test case execution information provided in this application relate to the field of artificial intelligence technology and can be used in the field of financial technology or other related fields. This application does not limit the application fields of the method, apparatus, computer equipment, storage medium, and computer program product for determining test case execution information.
[0136] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0137] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0138] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0139] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for determining test case execution information, characterized in that, The method includes: Obtain the test information set and transaction log information set corresponding to the target application software; the test information set contains multiple test cases and several interface information corresponding to each test case; the interface information is the information of the interface called by the target application software when executing the test cases; the transaction log information set contains the transaction log information generated by the target application software when executing each test case. The matching results for each test case are obtained by matching several interface information corresponding to each test case with the transaction log information set. Based on the matching results of each test case, the execution status of each test case is determined, and the test case execution information of the target application software is obtained based on the execution status of each test case. Each of the interface information has a corresponding level, and the level of each interface information represents the calling order of the interface information in the corresponding test case; The step of matching the test cases with the transaction log information set based on the interface information corresponding to each test case to obtain the matching result of each test case includes: The interface information corresponding to the minimum level is used as the target interface information, and the target interface information is matched with the transaction log information set; For each target interface information, if none of the transaction log information in the transaction log information set contains the target interface information, the test case corresponding to the target interface information and the level of the target interface information is determined as the first test case that fails to match. If at least one transaction log information in the transaction log information set contains the target interface information, the test case corresponding to the target interface information and the level of the target interface information is determined as the second test case; If the target interface information is the last-level interface information of the second test case, the matching result of the second test case is determined to be a successful match; If the target interface information is not the last-level interface information of the second test case, the next-level interface information of the target interface information is taken as the new target interface information, the set of at least one transaction log information is determined as the new transaction log information set, and the process of matching the target interface information with the transaction log information set is returned.
2. The method according to claim 1, characterized in that, The step of matching the test cases with the transaction log information set based on the interface information corresponding to each test case to obtain the matching result of each test case includes: For each test case, several interface information corresponding to the test case are matched with the transaction log information set. If at least one transaction log information in the transaction log information set contains all the interface information corresponding to the test case, the matching result of the test case is determined to be a successful match. If none of the transaction log information in the transaction log information set contains all the interface information corresponding to the test case, the matching result of the test case will be determined as a matching failure.
3. The method according to claim 1 or 2, characterized in that, Determining the execution status of each test case based on the matching results of each test case includes: For each test case, if the matching result of the test case is a successful match, the execution status of the test case is determined to be successful. If the matching result of the test case is a failure, the execution status of the test case will be determined as execution failure.
4. The method according to claim 3, characterized in that, Each transaction log in the transaction log information set also includes transaction status information; the transaction status information indicates whether the target application software's execution of the test case is a successful or failed transaction. The step of determining the execution status of the test case as successful when the matching result of the test case is a successful match includes: If the matching result of the test case is a successful match, the at least one transaction log information containing all interface information corresponding to the test case is determined as the target transaction log information; If the transaction status information contained in the target transaction log information indicates that the transaction was successful, the execution status of the test case will be determined as successful.
5. The method according to claim 1, characterized in that, The acquisition of the test information set corresponding to the target application software includes: Obtain information on each business scenario corresponding to the target application software, and test cases corresponding to each business scenario. Extract the interface information corresponding to each of the aforementioned business scenario information; A test information set is obtained based on the test cases corresponding to each of the aforementioned business scenario information and the interface information corresponding to each of the aforementioned business scenario information.
6. A device for determining test case execution information, characterized in that, The device includes: The acquisition module is used to acquire the test information set and the transaction log information set corresponding to the target application software; the test information set includes multiple test cases and several interface information corresponding to each test case; the interface information is the information of the interface called by the target application software when executing the test case; the transaction log information set includes the transaction log information generated by the target application software when executing each test case. The matching module is used to match the transaction log information set with several interface information corresponding to each test case to obtain the matching result of each test case. The determination module is used to determine the execution status of each test case based on the matching results of each test case, and to obtain the test case execution information of the target application software based on the execution status of each test case. Each of the interface information has a corresponding level, and the level of each interface information represents the calling order of the interface information in the corresponding test case; The matching module is specifically used for: The interface information corresponding to the minimum level is used as the target interface information, and the target interface information is matched with the transaction log information set; For each target interface information, if none of the transaction log information in the transaction log information set contains the target interface information, the test case corresponding to the target interface information and the level of the target interface information is determined as the first test case that fails to match. If at least one transaction log information in the transaction log information set contains the target interface information, the test case corresponding to the target interface information and the level of the target interface information is determined as the second test case; If the target interface information is the last-level interface information of the second test case, the matching result of the second test case is determined to be a successful match; If the target interface information is not the last-level interface information of the second test case, the next-level interface information of the target interface information is taken as the new target interface information, the set of at least one transaction log information is determined as the new transaction log information set, and the process of matching the target interface information with the transaction log information set is returned.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method for checking invalid code completion case based on logs
CN110727597A