Analysis method and device of automatic test, electronic equipment and storage medium

By constructing a data warehouse and automated the method of matching abnormal testing cases, the efficiency of the cause of the failure of the failure of manual analysis in the REST interface test was solved, and the efficiency of high -efficiency automation test analysis was realized, and the cost of manpower input was reduced.

CN119336603APending Publication Date: 2025-01-21INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411320325.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

In the prior art, the test of the REST interface requires testers to manually analyze the cause of failure. If there are a large number of failed use cases, it will greatly occupy human investment and lead to low testing efficiency.

Method used

By building a data warehouse based on the weight of test cases and their exception causes, we can automatically match abnormal test cases and determine their primary exception causes, and generate test analysis results.

Benefits of technology

The automatic analysis of the test report was realized, the cost of manpower input was reduced, the test efficiency was improved, and the time and cost of manual analysis were reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336603A_ABST
    Figure CN119336603A_ABST
Patent Text Reader

Abstract

The invention provides an automatic test analysis method and device, electronic equipment and a storage medium, and the method comprises the steps: carrying out the automatic test of each REST interface, and generating a test report; extracting an abnormal test case executing abnormally in the test report, and matching in a pre-constructed data warehouse based on the abnormal test case to determine a plurality of abnormal reasons of the abnormal test case; and determining a primary exception reason of the REST interface corresponding to the exception test case based on the weight of each exception reason in the exception test case, and determining a test analysis result of the REST interface in the storage system based on the test report and the primary exception reason. The automatic analysis process of the test report is realized, so that efficient automatic test analysis is achieved, the human input cost is reduced, and the test efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automated testing technology, and in particular to an automated testing analysis method, device, electronic equipment and storage medium. Background Art

[0002] With the widespread application of service architecture and API (application programming interface), the number of RESTful API interfaces has increased dramatically to support various business logics and data interactions. In some large projects, it is common to have more than thousands of REST interfaces, which may be distributed in different services to handle core business processes such as user authentication, data query, order processing, etc.

[0003] The existing REST interface testing requires testers to manually analyze the causes of failure. If there are a large number of failed test cases, it will greatly occupy the human input and lead to low testing efficiency. Summary of the invention

[0004] The present invention provides an analysis method, device, electronic device and storage medium for automated testing, which are used to solve the problem that in the process of testing a REST interface in the prior art, testers need to manually analyze the causes of failures. If there are a large number of failed test cases, it will greatly occupy human input and lead to low testing efficiency.

[0005] The present invention provides an analysis method for automated testing, comprising the following steps: Based on the test cases corresponding to each REST interface in the storage system, each REST interface is automatically tested, and a test report of the REST interface in the storage system is generated; Extracting abnormal test cases with abnormal execution in the test report, and matching them in a pre-built data warehouse based on the abnormal test cases to determine multiple abnormal causes of the abnormal test cases, wherein the data warehouse is built based on the test cases and their corresponding multiple abnormal causes with weights, and the weights are determined based on the number of occurrences of the abnormal causes in historical test data; Based on the weight of each abnormal reason in the abnormal test case, the primary abnormal reason of the REST interface corresponding to the abnormal test case is determined, and based on the test report and the primary abnormal reason, the test analysis result of the REST interface in the storage system is determined.

[0006] According to an automated test analysis method provided by the present invention, after determining the primary abnormal cause of the REST interface corresponding to the abnormal test case, the method further includes: Receiving the analysis result of the abnormal test case by the tester; When it is determined that the primary abnormal cause is inaccurate based on the analysis result of the abnormal test case by the tester, the weight of the primary abnormal cause corresponding to the abnormal test case in the data warehouse is reduced.

[0007] According to an automated test analysis method provided by the present invention, after determining the primary abnormal cause of the REST interface corresponding to the abnormal test case, the method further includes: Receiving the analysis result of the abnormal test case by the tester; When it is determined that the primary abnormal cause is accurate based on the analysis result of the abnormal test case by the tester, the weight of the primary abnormal cause corresponding to the abnormal test case in the data warehouse is increased.

[0008] According to an automated test analysis method provided by the present invention, matching is performed in a pre-built data warehouse based on the abnormal test case to determine multiple abnormal causes of the abnormal test case, further comprising: In the case where a match fails in a pre-built data warehouse based on the abnormal test case, an abnormal cause of the abnormal test case is obtained, and the abnormal test case and its abnormal cause are added to the data warehouse.

[0009] According to an automated test analysis method provided by the present invention, matching is performed in a pre-built data warehouse based on the abnormal test case to determine multiple abnormal causes of the abnormal test case, including: Obtaining the test case number of the abnormal test case; Based on a message digest algorithm, determine a target message digest corresponding to the case number of the abnormal test case; Traversing the message digests in the message digest list, and comparing the message digests in the message digest list with the target message digest, to determine a matching message digest in the message digest list that is consistent with the target message digest; Acquire multiple exception reasons of the test case corresponding to the matching message digest, and use the multiple exception reasons of the test case corresponding to the matching message digest as multiple exception reasons of the abnormal test case; The process of constructing the message digest list includes: Determine the message digest of the test case number of each test case in the data warehouse based on the message digest algorithm; The message digests of the test case numbers of the test cases in the data warehouse are summarized to construct the message digest list.

[0010] According to an automated test analysis method provided by the present invention, the step of extracting abnormal test cases with abnormal execution in the test report includes: Based on regular expressions, test cases marked as abnormal information in the test report are extracted to obtain abnormal test cases with abnormal execution in the test report, where the abnormal information includes failure, error, exception and blockage.

[0011] An automated test analysis method provided by the present invention further includes: The acquisition times of the test cases in the data warehouse are counted, target test cases whose acquisition times in the data warehouse are less than a preset threshold are determined, and the target test cases are deleted.

[0012] The present invention also provides an analysis device for automated testing, comprising the following modules: A test report generation module, used to perform automated testing on each REST interface in the storage system based on the test cases corresponding to each REST interface in the storage system, and generate a test report for the REST interface in the storage system; An abnormality cause determination module is used to extract abnormal test cases with abnormal execution in the test report, and match them in a pre-built data warehouse based on the abnormal test cases to determine multiple abnormal causes of the abnormal test cases, wherein the data warehouse is built based on the test cases and their corresponding multiple abnormal causes with weights, and the weights are determined based on the number of times the abnormal causes appear in historical test data; A test result determination module is used to determine the primary abnormal cause of the REST interface corresponding to the abnormal test case based on the weight of each abnormal cause in the abnormal test case, and to determine the test analysis result of the REST interface in the storage system based on the test report and the primary abnormal cause.

[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the analysis method for automated testing as described above is implemented.

[0014] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the analysis method of the automated test as described in any one of the above is implemented.

[0015] The automated test analysis method, device, electronic device and storage medium provided by the present invention construct a data warehouse in advance based on test cases and their corresponding multiple weighted abnormal causes, match them in the data warehouse based on the acquired abnormal test cases, and determine the primary abnormal cause according to the weight of the matched abnormal cause, thereby realizing an automatic analysis process of the test report, thereby achieving efficient automated test analysis, reducing manpower input costs and improving test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 It is a schematic diagram of the flow of the analysis method of the automated test provided by the present invention.

[0018] Figure 2 It is a schematic diagram of the test result analysis process provided by the present invention.

[0019] Figure 3 It is a schematic diagram of the structure of the analysis device for automated testing provided by the present invention.

[0020] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0022] Figure 1 It is a schematic diagram of the process of the analysis method of the automated test provided by the present invention, such as Figure 1 As shown, the method includes the following: Step 110, based on the test cases corresponding to the REST interfaces in the storage system, perform automated testing on the REST interfaces, and generate a test report for the REST interfaces in the storage system; Step 120, extracting abnormal test cases with abnormal execution in the test report, and matching them in a pre-built data warehouse based on the abnormal test cases to determine multiple abnormal causes of the abnormal test cases, wherein the data warehouse is built based on the test cases and their corresponding multiple abnormal causes with weights, and the weights are determined based on the number of occurrences of the abnormal causes in historical test data; Step 130, based on the weight of each abnormal reason in the abnormal test case, determine the primary abnormal reason of the REST interface corresponding to the abnormal test case, and based on the test report and the primary abnormal reason, determine the test analysis result of the REST interface in the storage system.

[0023] The execution subject of the analysis method of the automated test provided by the present invention can be an electronic device, a component in an electronic device, an integrated circuit, or a chip. The electronic device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (NAS), or a personal computer (PC), etc., which is not specifically limited by the present invention.

[0024] The following takes the analysis method of the automated test provided by the present invention executed by a computer as an example to describe the technical solution of the present invention in detail.

[0025] In step 110, based on the test cases corresponding to the REST interfaces in the storage system, each REST interface is automatically tested, and a test report of the REST interface in the storage system is generated.

[0026] The REST (Representational State Transfer) interface is an interface design style based on the HTTP protocol. The REST interface operates resources through standard HTTP methods (such as GET, POST, PUT, and DELETE), and these resources are usually interacted in JSON or XML format. In the storage system, the REST interface can be used for operations such as managing data, querying status, and configuring the system.

[0027] Test cases are the core of automated testing. Test cases for REST interfaces generally include the following aspects: Verify whether the REST interface works as expected. Test the interface's performance when handling boundary conditions (such as maximum and minimum values). Verify the performance and stability of the interface under high load conditions. Ensure that the interface is not vulnerable to attacks such as SQL injection, XSS, etc. Verify the compatibility of the interface in different environments and platforms. Test whether the interface's handling mechanism and the error information returned when an error occurs meet the specifications.

[0028] Define the test cases corresponding to each REST interface, write automated test scripts, and run the written automated test scripts to realize automated testing of each REST interface.

[0029] After the automated testing of each REST interface is completed, a test report of the REST interface in the storage system is generated.

[0030] In step 120, abnormal test cases with execution exceptions in the test report are extracted, and based on the abnormal test cases, matching is performed in a pre-built data warehouse to determine multiple abnormal causes of the abnormal test cases. The data warehouse is built based on the test cases and their corresponding multiple abnormal causes with weights, and the weights are determined based on the number of times the abnormal causes appear in historical test data.

[0031] Pre-build the data warehouse. You can associate the test cases corresponding to each REST interface in the storage system and the multiple exception reasons corresponding to each test case, and build a data warehouse with the obtained multiple associated information.

[0032] It is understandable that during the testing of a REST interface, multiple abnormal reasons may occur, and the probability of each abnormal reason occurring is different. For each piece of associated information in the data warehouse, a test case and multiple abnormal reasons with weights are included.

[0033] Assign a weight to each anomaly cause. The weight is usually based on how often the anomaly cause appears in historical test data. For example, if "Database connection failure" appears many times in past tests, it has a higher weight. Specifically, the weight is determined based on the number of times the anomaly occurs in historical test data. The more times the anomaly cause appears, the higher the weight, and the less times the anomaly cause appears, the lower the weight.

[0034] After the data warehouse is built, the abnormal test cases are matched in the pre-built data warehouse to determine multiple abnormal causes of the abnormal test cases.

[0035] By extracting test cases with abnormal execution and matching them in the pre-built data warehouse, multiple abnormal causes of abnormal test cases can be systematically determined. This approach not only helps to quickly locate problems, but also uses weighted analysis of historical data to make the identification of abnormal causes more accurate and efficient.

[0036] In step 130, based on the weight of each abnormal cause in the abnormal test case, the primary abnormal cause of the REST interface corresponding to the abnormal test case is determined, and based on the test report and the primary abnormal cause, the test analysis result of the REST interface in the storage system is determined.

[0037] When determining multiple abnormal reasons for an abnormal test case, the weight of each abnormal reason in the abnormal test case may be determined based on querying the data warehouse.

[0038] Summarize the weights corresponding to multiple abnormal causes of the abnormal test case, sort all the abnormal causes in each abnormal test case according to the weight, and the abnormal cause with the highest weight can be used as the primary abnormal cause.

[0039] Generate a test analysis result of the REST interface in the storage system based on the test report and the primary abnormal cause of the abnormal REST interface in the storage system.

[0040] Optional, such as Figure 2 The test result analysis process provided by the present invention is shown in the schematic diagram. The test analysis process of the REST interface may include: Step 201: The automated code layer marks the interface use cases that need to be tested, and pulls all the marked use cases into a test plan, which includes test cases corresponding to each REST interface in the storage system; Step 202, automatically executing all use cases in the test plan; Step 203, after all test cases in the test plan are executed, an automated test report is generated; Step 204, parsing the automated test report, extracting abnormal test cases, locating the test termination position, and obtaining the failed operation interface; Step 205, establishing a data warehouse, which is constructed based on the test cases and their corresponding multiple weighted exception reasons; information such as the test termination position and the failed operation interface can be added to the corresponding position of the test case in the data warehouse; Step 206, comparing the abnormal test case with the data in the data warehouse; Step 207: If there is existing analysis data in the data warehouse, intelligent suggestions for ranking the failure causes are given based on the weights of the various abnormal causes in the abnormal test cases obtained from the data warehouse; Step 208: If there is no existing analysis data, the tester is prompted that this is the first time the exception has occurred and manual intervention is required to analyze and locate the cause; Step 209, organizing the actual reasons obtained in step 208 into data and storing them in the data warehouse; Step 210: If in step 207, the tester locates the actual cause, and if it is determined that the existing analysis data is inaccurate based on the actual cause, the actual cause is added to the data warehouse; Step 211, if in step 207, the tester locates the actual cause, if the existing analysis data is determined to be accurate based on the actual cause, the corresponding abnormal cause is weighted; Step 212, the tester adds a corresponding module problem ticket in the problem ticket library, and the problem ticket is associated with the failed test case; Step 213, when the developer solves the problem and sets the problem ticket status to solved and reviewed; In step 214 , after the system checks that the status of the issue ticket is set to resolved and reviewed, the test environment automatically changes the version, re-executes the corresponding test case, and returns to step 202 .

[0041] It is understandable that comprehensive and efficient automated testing of the storage system REST interface not only innovates the manual testing process, but also greatly optimizes the testing cycle and improves the testing quality and efficiency through deep integration and intelligent processing.

[0042] During the test execution phase, advanced automated scripting technology can be used to automatically execute a wide range of preset test cases, which cover various common and boundary conditions of the Rest interface, ensuring the comprehensiveness and depth of the test. During the test, the system will monitor the execution status of each case in real time. Once a failed case is detected, the fault capture mechanism will be immediately activated to accurately record the termination position of the failed case, the detailed failure cause, and related system log information, providing solid data support for subsequent abnormal analysis.

[0043] In order to reduce the burden on testers, an intelligent failure reason display function is also integrated. By analyzing failure data through advanced algorithms, the root cause of failure can be automatically extracted and displayed to testers in an intuitive and easy-to-understand way, significantly reducing the time and labor costs required to analyze failed cases. In addition, it can also support customized failure reason templates, allowing the test team to flexibly adjust the display content according to actual needs, further improving the pertinence and effectiveness of the test.

[0044] In the exception handling process, the whole process from exception location, bill of lading creation, version change to exception regression verification is automated. Once an exception is found, the system will automatically generate an exception report and trigger the corresponding processing flow. Testers only need to simply confirm or supplement information to submit the exception to the development team. At the same time, the system will track the progress of exception handling and automatically perform regression testing after the new version is released to ensure that the exception is completely resolved. This efficient collaboration mechanism not only speeds up the resolution of exceptions, but also improves the overall quality of the software.

[0045] As the types of abnormal errors integrated into the data warehouse continue to increase, it will continue to learn and evolve. Through machine learning algorithm optimization, the system can more accurately identify new error patterns and automatically adjust test strategies and failure cause display methods, thus becoming more intelligent and efficient. This continuous optimization capability enables the system to cope with increasingly complex testing requirements and provide strong support for the stability and quality assurance of the storage system Rest interface.

[0046] In summary, the automated testing method not only greatly reduces the manpower input cost in the testing process, but also significantly improves the testing efficiency and accuracy. By building a closed-loop automated testing ecosystem, comprehensive automated management from test execution to exception resolution is achieved, providing a new solution for the quality assurance of the storage system Rest interface.

[0047] The analysis method for automated testing provided by the present invention pre-builds a data warehouse based on test cases and their corresponding multiple weighted exception causes, performs matching in the data warehouse based on acquired exception test cases, and determines the primary exception cause based on the weight of the matched exception cause, thereby realizing an automatic analysis process for the test report, thereby achieving efficient automated test analysis, reducing manpower input costs, and improving test efficiency.

[0048] In one embodiment, after determining the primary abnormal cause of the REST interface corresponding to the abnormal test case, it also includes: receiving the analysis results of the abnormal test case by the tester; if it is determined that the primary abnormal cause is inaccurate based on the analysis results of the abnormal test case by the tester, reducing the weight of the primary abnormal cause corresponding to the abnormal test case in the data warehouse.

[0049] After determining the primary abnormal cause of the REST interface corresponding to the abnormal test case, it also includes: receiving the analysis results of the abnormal test case by the tester; and when it is determined that the primary abnormal cause is accurate based on the analysis results of the abnormal test case by the tester, increasing the weight of the primary abnormal cause corresponding to the abnormal test case in the data warehouse.

[0050] After determining the primary abnormal cause of the abnormal test case, it is an important feedback and optimization process to receive the analysis results of the tester and adjust the weight of the abnormal cause in the data warehouse. This method helps to continuously improve the accuracy of abnormal cause identification and optimize the abnormal cause weight in the data warehouse.

[0051] After obtaining the primary abnormal cause, feedback is provided on the accuracy of the primary abnormal cause based on manual analysis.

[0052] Based on the tester's analysis results, adjust the weights of the top anomaly causes in the data warehouse to ensure that the weights reflect the actual situation. The adjustment includes the following steps: If the tester's analysis results confirm that the current primary abnormal cause is accurate, then the weight of the abnormal cause needs to be increased.

[0053] If the tester's analysis results show that the current primary cause of the exception is inaccurate, then the weight of the cause of the exception needs to be reduced, and the weights of other causes of the exception can be considered to be increased.

[0054] If the primary anomaly cause is confirmed to be accurate, its weight in the data warehouse is increased. This can be achieved by increasing the weight value or adjusting the weight calculation method. This means that the anomaly cause will be given priority in future anomaly test cases.

[0055] If the primary anomaly cause is confirmed to be inaccurate, reduce its weight. You can reduce the weight value or remove it from the high-weight category. This means that the anomaly cause will be lowered in priority in future anomaly test cases.

[0056] The automated testing analysis method provided by the present invention can continuously train and intelligently improve the system's analysis capability for failed use cases through a manual feedback process, perform weighted analysis based on the degree of match between the system analysis results and the actual location cause analysis results, and implement automated execution analysis regression testing of REST interface testing during loop traversal, thereby achieving efficient automated testing and reducing manpower investment costs.

[0057] In one embodiment, based on the abnormal test case, matching is performed in a pre-built data warehouse to determine multiple abnormal causes of the abnormal test case, further comprising: in the event that matching fails in the pre-built data warehouse based on the abnormal test case, obtaining the abnormal cause of the abnormal test case, and adding the abnormal test case and its abnormal cause to the data warehouse.

[0058] It is understandable that in the process of testing based on test cases, test anomalies that have never occurred before may occur, resulting in a match failure when matching in a pre-built data warehouse to determine multiple anomaly causes of the abnormal test cases.

[0059] In case of matching failure, the tester or developer's expertise can be relied upon to conduct manual analysis and determine the abnormal cause of the abnormal test case.

[0060] Add the abnormal reasons obtained through manual analysis or automated assistance to the data warehouse. Assign an initial weight to the newly added abnormal reasons, which can be set based on experience.

[0061] It is understandable that in the case of matching failure, the abnormal reasons of abnormal test cases are effectively obtained and added to the data warehouse. This not only helps to improve the coverage and accuracy of the data warehouse, but also provides more valuable reference information for subsequent testing and analysis work.

[0062] In one embodiment, based on the abnormal test case, matching is performed in a pre-constructed data warehouse to determine multiple abnormal causes of the abnormal test case, including: obtaining the case number of the abnormal test case; determining the target message digest corresponding to the case number of the abnormal test case based on a message digest algorithm; traversing the message digests in a message digest list, and comparing the message digests in the message digest list with the target message digests, and determining the matching message digests in the message digest list that are consistent with the target message digests; obtaining multiple abnormal causes of the test case corresponding to the matching message digests, and using the multiple abnormal causes of the test case corresponding to the matching message digests as the multiple abnormal causes of the abnormal test case; the construction process of the message digest list includes: determining the message digest of the case number of each test case in the data warehouse based on the message digest algorithm; summarizing the message digests of the case number of each test case in the data warehouse to construct the message digest list.

[0063] A message digest algorithm, also known as a hash algorithm or a hash algorithm, is an algorithm that converts data of any length into a fixed-length digest. Its core lies in the one-way nature of the hash function, that is, the corresponding hash value (or hash value, summary value) can be obtained through the hash function, but the original data information cannot be deduced from the hash value.

[0064] Pre-build a message digest list, traverse all test cases in the data warehouse, execute the same message digest algorithm on the case number of each test case, and generate their own message digests. Collect the message digests of all test cases and build a message digest list. This list contains the unique identifiers of all test cases in the data warehouse (that is, their message digests).

[0065] Use the selected message digest algorithm (such as SHA-256) to hash the case number of the abnormal test case to generate a fixed-length message digest (or hash value). This target message digest will be used as the basis for subsequent searches for similar or identical test cases in the data warehouse.

[0066] Use a loop or iteration to traverse each message digest in the message digest list. During the traversal process, compare the target message digest (i.e., the message digest of the test case number of the abnormal test case) with each message digest in the list. Due to the characteristics of the message digest algorithm (such as high collision resistance), if two message digests are exactly the same, then their corresponding original data (test case number) is the same. Read the multiple abnormal causes recorded in the found test case to achieve a fast acquisition process of multiple abnormal causes of multiple abnormal test cases.

[0067] In one embodiment, abnormal test cases with execution exceptions in the test report are extracted, including: based on regular expressions, test cases marked as abnormal information in the test report are extracted to obtain abnormal test cases with execution exceptions in the test report, wherein the abnormal information includes failure, error, exception and blockage.

[0068] For abnormal test cases marked as execution exceptions in the test report, using regular expressions (Regular Expression, Regex) to extract them is an efficient and flexible method.

[0069] The exception information may include words such as "failure", "error", "exception" and "blocking" or their variants. Based on the pattern of the above exception information, one or more regular expressions can be constructed to match the relevant content in the test report.

[0070] Once a suitable regular expression is constructed, it can be applied to text processing of test reports to extract test cases marked as abnormal information in the test report.

[0071] In one embodiment, the method further includes: counting the number of times the test cases in the data warehouse are acquired, determining a target test case whose number of times in the data warehouse is acquired is less than a preset number threshold, and deleting the target test case.

[0072] In data warehouse management, counting the number of times test cases are acquired and cleaning and optimizing test cases based on the statistical results is an important step in maintaining the quality and efficiency of the data warehouse. This process helps to identify and delete test cases that have not been accessed or used for a long time, thereby freeing up storage space, reducing maintenance costs, and improving the overall performance of the data warehouse.

[0073] The preset number threshold is the key basis for determining whether a test case needs to be deleted. This threshold should be set based on the actual use of the data warehouse, the update frequency of the test case, and business needs.

[0074] Based on the statistics of the number of acquisitions, the test cases whose number of acquisitions is less than the preset threshold are deleted, which can effectively optimize the storage structure and performance of the data warehouse.

[0075] The following is a description of the automated test analysis device provided by the present invention. The automated test analysis device described below and the automated test analysis method described above can be referenced to each other.

[0076] like Figure 3 As shown, the device comprises: A test report generating module 310 is used to perform automated testing on each REST interface in the storage system based on the test cases corresponding to each REST interface in the storage system, and generate a test report for the REST interface in the storage system; The abnormality cause determination module 320 is used to extract the abnormal test cases with abnormal execution in the test report, and match them in a pre-built data warehouse based on the abnormal test cases to determine multiple abnormal causes of the abnormal test cases, wherein the data warehouse is built based on the test cases and their corresponding multiple abnormal causes with weights, and the weights are determined based on the number of times the abnormal causes appear in the historical test data; The test result determination module 330 is used to determine the primary abnormal cause of the REST interface corresponding to the abnormal test case based on the weight of each abnormal cause in the abnormal test case, and determine the test analysis result of the REST interface in the storage system based on the test report and the primary abnormal cause.

[0077] The analysis device for automated testing provided by the present invention builds a data warehouse in advance based on test cases and their corresponding multiple weighted abnormal causes, matches the acquired abnormal test cases in the data warehouse, and determines the primary abnormal cause according to the weight of the matched abnormal cause, thereby realizing an automatic analysis process for the test report, thereby achieving efficient automated test analysis, reducing manpower input costs, and improving test efficiency.

[0078] In one embodiment, the test result determination module 330 is specifically used to: After determining the primary abnormal cause of the REST interface corresponding to the abnormal test case, the method further includes: Receiving the analysis result of the abnormal test case by the tester; When it is determined that the primary abnormal cause is inaccurate based on the analysis result of the abnormal test case by the tester, the weight of the primary abnormal cause corresponding to the abnormal test case in the data warehouse is reduced.

[0079] In one embodiment, the test result determination module 330 is further specifically configured to: After determining the primary abnormal cause of the REST interface corresponding to the abnormal test case, the method further includes: Receiving the analysis result of the abnormal test case by the tester; When it is determined that the primary abnormal cause is accurate based on the analysis result of the abnormal test case by the tester, the weight of the primary abnormal cause corresponding to the abnormal test case in the data warehouse is increased.

[0080] In one embodiment, the abnormality cause determination module 320 is specifically used to: The matching in a pre-built data warehouse based on the abnormal test case to determine multiple abnormal causes of the abnormal test case further includes: In the case where a match fails in a pre-built data warehouse based on the abnormal test case, an abnormal cause of the abnormal test case is obtained, and the abnormal test case and its abnormal cause are added to the data warehouse.

[0081] In one embodiment, the abnormality cause determination module 320 is further specifically configured to: The matching is performed in a pre-built data warehouse based on the abnormal test case to determine multiple abnormal causes of the abnormal test case, including: Obtaining the test case number of the abnormal test case; Based on a message digest algorithm, determine a target message digest corresponding to the case number of the abnormal test case; Traversing the message digests in the message digest list, and comparing the message digests in the message digest list with the target message digest, to determine a matching message digest in the message digest list that is consistent with the target message digest; Acquire multiple exception reasons of the test case corresponding to the matching message digest, and use the multiple exception reasons of the test case corresponding to the matching message digest as multiple exception reasons of the abnormal test case; The process of constructing the message digest list includes: Determine the message digest of the test case number of each test case in the data warehouse based on the message digest algorithm; The message digests of the test case numbers of the test cases in the data warehouse are summarized to construct the message digest list.

[0082] In one embodiment, the test report generating module 310 is specifically used for: The extracting of abnormal test cases with abnormal execution in the test report includes: Based on regular expressions, test cases marked as abnormal information in the test report are extracted to obtain abnormal test cases with abnormal execution in the test report, where the abnormal information includes failure, error, exception and blockage.

[0083] In one embodiment, the test result determination module 330 is further specifically configured to: The acquisition times of the test cases in the data warehouse are counted, target test cases whose acquisition times in the data warehouse are less than a preset threshold are determined, and the target test cases are deleted.

[0084] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the analysis method of the automated test, the method comprising: based on the test cases corresponding to each REST interface in the storage system, performing automated testing on each REST interface, and generating a test report of the REST interface in the storage system; Extracting abnormal test cases with abnormal execution in the test report, and matching them in a pre-built data warehouse based on the abnormal test cases to determine multiple abnormal causes of the abnormal test cases, wherein the data warehouse is built based on the test cases and their corresponding multiple abnormal causes with weights, and the weights are determined based on the number of occurrences of the abnormal causes in historical test data; Based on the weight of each abnormal reason in the abnormal test case, the primary abnormal reason of the REST interface corresponding to the abnormal test case is determined, and based on the test report and the primary abnormal reason, the test analysis result of the REST interface in the storage system is determined.

[0085] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0086] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the automated test analysis method provided by the above methods, the method comprising: based on the test case corresponding to each REST interface in the storage system, performing automated testing on each REST interface, and generating a test report of the REST interface in the storage system; Extracting abnormal test cases with abnormal execution in the test report, and matching them in a pre-built data warehouse based on the abnormal test cases to determine multiple abnormal causes of the abnormal test cases, wherein the data warehouse is built based on the test cases and their corresponding multiple abnormal causes with weights, and the weights are determined based on the number of occurrences of the abnormal causes in historical test data; Based on the weight of each abnormal reason in the abnormal test case, the primary abnormal reason of the REST interface corresponding to the abnormal test case is determined, and based on the test report and the primary abnormal reason, the test analysis result of the REST interface in the storage system is determined.

[0087] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements an analysis method for performing the automated testing provided by the above methods, the method comprising: performing automated testing on each REST interface based on a test case corresponding to each REST interface in the storage system, and generating a test report for the REST interface in the storage system; Extracting abnormal test cases with abnormal execution in the test report, and matching them in a pre-built data warehouse based on the abnormal test cases to determine multiple abnormal causes of the abnormal test cases, wherein the data warehouse is built based on the test cases and their corresponding multiple abnormal causes with weights, and the weights are determined based on the number of occurrences of the abnormal causes in historical test data; Based on the weight of each abnormal reason in the abnormal test case, the primary abnormal reason of the REST interface corresponding to the abnormal test case is determined, and based on the test report and the primary abnormal reason, the test analysis result of the REST interface in the storage system is determined.

[0088] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0089] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially 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 ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An analysis method for automated testing, characterized in that: The method comprises: Based on the test cases corresponding to each REST interface in the storage system, each REST interface is automatically tested, and a test report of the REST interface in the storage system is generated; Extracting abnormal test cases with abnormal execution in the test report, and matching them in a pre-built data warehouse based on the abnormal test cases to determine multiple abnormal causes of the abnormal test cases, wherein the data warehouse is built based on the test cases and their corresponding multiple abnormal causes with weights, and the weights are determined based on the number of occurrences of the abnormal causes in historical test data; Based on the weight of each abnormal reason in the abnormal test case, the primary abnormal reason of the REST interface corresponding to the abnormal test case is determined, and based on the test report and the primary abnormal reason, the test analysis result of the REST interface in the storage system is determined.

2. The automated test analysis method according to claim 1, characterized in that: After determining the primary abnormal cause of the REST interface corresponding to the abnormal test case, the method further includes: Receiving the analysis result of the abnormal test case by the tester; When it is determined that the primary abnormal cause is inaccurate based on the analysis result of the abnormal test case by the tester, the weight of the primary abnormal cause corresponding to the abnormal test case in the data warehouse is reduced.

3. The automated test analysis method according to claim 1, characterized in that: After determining the primary abnormal cause of the REST interface corresponding to the abnormal test case, the method further includes: Receiving the analysis result of the abnormal test case by the tester; When it is determined that the primary abnormal cause is accurate based on the analysis result of the abnormal test case by the tester, the weight of the primary abnormal cause corresponding to the abnormal test case in the data warehouse is increased.

4. The analysis method for automated testing according to claim 1, characterized in that: The matching in a pre-built data warehouse based on the abnormal test case to determine multiple abnormal causes of the abnormal test case further includes: In the case where a match fails in a pre-built data warehouse based on the abnormal test case, an abnormal cause of the abnormal test case is obtained, and the abnormal test case and its abnormal cause are added to the data warehouse.

5. The automated test analysis method according to claim 1, characterized in that: The matching is performed in a pre-built data warehouse based on the abnormal test case to determine multiple abnormal causes of the abnormal test case, including: Obtaining the test case number of the abnormal test case; Based on a message digest algorithm, determine a target message digest corresponding to the case number of the abnormal test case; Traversing the message digests in the message digest list, and comparing the message digests in the message digest list with the target message digest, to determine a matching message digest in the message digest list that is consistent with the target message digest; Acquire multiple exception reasons of the test case corresponding to the matching message digest, and use the multiple exception reasons of the test case corresponding to the matching message digest as multiple exception reasons of the abnormal test case; The process of constructing the message digest list includes: Determine the message digest of the test case number of each test case in the data warehouse based on the message digest algorithm; The message digests of the test case numbers of the test cases in the data warehouse are summarized to construct the message digest list.

6. The automated test analysis method according to claim 1, characterized in that: The extracting of abnormal test cases with abnormal execution in the test report includes: Based on regular expressions, test cases marked as abnormal information in the test report are extracted to obtain abnormal test cases with abnormal execution in the test report, where the abnormal information includes failure, error, exception and blockage.

7. The automated test analysis method according to claim 1, characterized in that: Also includes: The acquisition times of the test cases in the data warehouse are counted, target test cases whose acquisition times in the data warehouse are less than a preset threshold are determined, and the target test cases are deleted.

8. An analysis device for automated testing, characterized in that: include: A test report generation module, used to perform automated testing on each REST interface in the storage system based on the test cases corresponding to each REST interface in the storage system, and generate a test report for the REST interface in the storage system; An abnormality cause determination module is used to extract abnormal test cases with abnormal execution in the test report, and match them in a pre-built data warehouse based on the abnormal test cases to determine multiple abnormal causes of the abnormal test cases, wherein the data warehouse is built based on the test cases and their corresponding multiple abnormal causes with weights, and the weights are determined based on the number of times the abnormal causes appear in historical test data; A test result determination module is used to determine the primary abnormal cause of the REST interface corresponding to the abnormal test case based on the weight of each abnormal cause in the abnormal test case, and to determine the test analysis result of the REST interface in the storage system based on the test report and the primary abnormal cause.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the analysis method for automated testing according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the analysis method for automated testing according to any one of claims 1 to 7 is implemented.