A test result format conversion method and computing device

By generating and storing the structural rules of the test facility, the test result format conversion is automatically performed, which solves the complexity problems caused by different test result formats in the prior art, and improves the testing efficiency and accuracy.

CN118839668BActive Publication Date: 2025-04-11YUXIN ELECTRONIC TECHNOLOGY GROUP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410790673.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-18
Publication Date
2025-04-11
Estimated Expiration
2044-06-18

AI Technical Summary

Technical Problem

In current technology, when analyzing and comparing the test results obtained by different testing facilities, the complexity is high due to different formats and a large number of manual resources are required for format adaptation and conversion, resulting in low testing efficiency and low accuracy.

Method used

By receiving test results examples and key field configuration files, a structural rule corresponding to the test facility is generated, and the structural rule is stored to automatically convert the test results format to ensure format uniqueness and uniformity.

Benefits of technology

It reduces the time spent on format conversion of test results, improves testing efficiency, and improves the accuracy of format conversion of test results, thereby improving the accuracy of overall tests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118839668B_ABST
    Figure CN118839668B_ABST
Patent Text Reader

Abstract

The present application discloses a method and computing device for format conversion of test results. The method includes: receiving a test result example corresponding to a first test facility, and a key field configuration file corresponding to the test result example; generating a structural rule corresponding to the first test facility according to the test result example and the key field configuration file; storing the structural rule corresponding to the first test facility so as to perform format conversion on the test result to be converted based on the stored structural rule. According to the test result use case and the corresponding key field configuration file, the structural rule corresponding to the first test facility is counted and stored, and the format conversion of the test result to be converted is realized according to the stored structural rule to obtain the test result in a unified format, thereby ensuring the uniformity of the test structure format, eliminating the need to manually convert the format of the test result, reducing the time consumed by the test result format conversion, and improving the test efficiency and the accuracy of the test result format conversion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automated testing technology, and in particular to a test result format conversion method and computing device. Background Art

[0002] In order to ensure that the functions of the developed software products can meet the development requirements, the software products will be tested and the test results will be obtained. The functions of the software products will be evaluated by analyzing the test results. The functions of the software products will be monitored and the abnormalities of the software product functions will be located based on the analysis of the test results, so as to facilitate the subsequent resolution of the abnormal problems of the software product functions and ensure that the functions of the software product can meet the development requirements.

[0003] With the development of science and technology, the testing facilities (e.g., testing tools, testing frameworks) that can test software products are becoming more and more diverse. Different testing facilities have different formats for testing software products. When testers analyze and compare the test results obtained from different testing facilities, the different formats of the test results make the task of analyzing and comparing the test results in the software testing phase more complicated.

[0004] In order to reduce the complexity of analyzing and comparing test results in different formats, a common format conversion method in current technology is to manually adapt and convert the data of test results in different formats to convert multiple test results in different formats into multiple test results in a unified format.

[0005] It can be seen that the common format conversion method in current technology requires a lot of manual resources to adapt and convert test results, which not only wastes a lot of time, resulting in low overall test efficiency, but also low overall test accuracy. Summary of the invention

[0006] A test result format conversion method and computing device provided in an embodiment of the present application can reduce the time consumed in test result format conversion, improve test efficiency to a certain extent, and do not require manual conversion of the test result format, thereby improving the accuracy of the test result format conversion and thus improving the accuracy of the overall test.

[0007] In order to achieve the above objectives, this application adopts the following technical solutions:

[0008] In the first aspect, the embodiment of the present application provides a method for format conversion of test results, including: receiving a test result example corresponding to a first test facility, and a key field configuration file corresponding to the test result example; the key field configuration file includes a first key field name and a corresponding key field; generating a structure rule corresponding to the first test facility according to the test result example and the key field configuration file; the structure rule includes a header field corresponding to the key field and a second key field name corresponding to the key field; storing the structure rule corresponding to the first test facility, so as to perform format conversion on the test result to be converted based on the stored structure rule. According to the test result case and the corresponding key field configuration file, the structure rule corresponding to the first test facility is counted and stored, and subsequently, according to the structure rule corresponding to the first test facility, the format conversion of the test result to be converted corresponding to the first test facility is automatically realized, so as to obtain a target test result in a preset format, thereby ensuring the uniqueness and uniformity of the test structure format, not requiring manual conversion of the test result format, reducing the time consumed by the test result format conversion, and improving the test efficiency to a certain extent; and to a certain extent, improving the accuracy of the test result format conversion, thereby improving the accuracy of the overall test.

[0009] In a possible implementation, according to the test result example and the key field configuration file, the attribute information of the key field in the test result example is parsed; the key field is the key field included in the key field configuration file; according to the attribute information of the key field, the header field corresponding to the key field is determined in the test result example; according to the header field corresponding to the key field and the second key field name corresponding to the key field, the structural rule corresponding to the first test facility is generated; the second key field name corresponding to the key field is a pre-set unified key field name. By analyzing the test result example and the key field configuration file, the structural rule corresponding to the first test facility is statistically calculated, so as to facilitate the subsequent format conversion of the test result according to the structural rule corresponding to the first test facility.

[0010] In a possible implementation, it is determined whether a key field configuration file satisfies a first condition; the first condition is that the key field configuration file can be correctly parsed; when the key field configuration file satisfies the first condition, it is determined whether the test result example satisfies a second condition; the second condition is that all key fields included in the key field configuration file exist in the test result example; when the test result example satisfies the second condition, a structural rule corresponding to the first test facility is generated according to the test result example and the key field configuration file. After receiving the test result example and the key field configuration file, both the key field configuration file and the test result example are verified, and when the first condition and the second condition are met, a structural rule corresponding to the first test facility is generated based on the test result example and the key field configuration file. This avoids affecting the accuracy of the structural rules corresponding to the first test facility due to errors in the test result example and the key field configuration file, and further improves the accuracy of subsequent test result format conversion.

[0011] In a possible implementation, when the key field configuration file does not meet the first condition, a first prompt message is output to prompt the user that the key field configuration file cannot be correctly parsed. The user re-enters the corresponding key field configuration file based on the first prompt message.

[0012] In a possible implementation, when the test result example does not meet the second condition, a second prompt message is output to prompt the user that the correspondence between the test result example and the key field configuration file is incorrect. Based on the second prompt message, the user determines whether the input test result example and key field configuration file correspond to the first test facility.

[0013] In a possible implementation, a test result to be converted and a second test facility corresponding to the test result to be converted are received; it is determined whether the structural rule corresponding to the second test facility can be matched; when the structural rule corresponding to the second test facility is matched, the test result to be converted is formatted based on the structural rule corresponding to the second test facility to obtain a target test result in a preset format. Based on the stored structural rules, the format of the test result to be converted corresponding to the first test facility is automatically converted to obtain a target test result in a preset format, which ensures the uniqueness and uniformity of the test structure format, does not require manual conversion of the test result format, reduces the time consumed by the test result format conversion, and can improve the test efficiency to a certain extent; and to a certain extent, improves the accuracy of the test result format conversion, thereby improving the accuracy of the overall test.

[0014] In a possible implementation, based on the structural rules corresponding to the second test facility, key field information is obtained from the test result to be converted; based on the key field information and the corresponding second key field name, a target test result in a corresponding preset format is generated. Through the structural rules, key field information is obtained from the test result to be converted, and a test result in a unified format is obtained based on the key field information.

[0015] In a possible implementation, when the structural rule corresponding to the second test facility is not matched, a third prompt information is output; the third prompt information is used to indicate that there is no structural rule corresponding to the second test facility. Based on the output third prompt information, the user is prompted to add a structural rule corresponding to the second test facility, thereby realizing flexible update of the format conversion capability.

[0016] In a possible implementation, it is determined whether there is an abnormality in the target test result of the preset format; when there is no abnormality in the target test result of the preset format, the target test result of the preset format is output. It is determined whether there is an abnormality in the target test result of the preset format, and if there is no abnormality in the target test result, the target test result is output, which further ensures the accuracy and reliability of the test result format conversion.

[0017] In a possible implementation, when the target test result in the preset format is abnormal, a fourth prompt message is output; the fourth prompt message is used to indicate that the structural rule corresponding to the second test facility and / or the test result to be converted is abnormal. The fourth prompt message is output to indicate that the structural rule and / or the received test result to be converted may be abnormal, so that the user can detect the structural rule and / or the test result to be converted, further ensuring the accuracy and reliability of the test result format conversion.

[0018] In a second aspect, an embodiment of the present application provides a computing device, including a memory and a processor;

[0019] The memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the processor executes the format conversion method of the test result in the first aspect and its possible implementation modes as described above;

[0020] The memory is also used to store structural rules corresponding to the test facility.

[0021] In a third aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed on a computing device, the computing device implements the method for format conversion of test results in the above-mentioned first aspect and its possible implementation methods.

[0022] In a fourth aspect, an embodiment of the present application provides a computer program product, which includes computer program instructions. When the computer program instructions are executed on a computing device, the computing device implements the format conversion method of the test results in the above-mentioned first aspect and its possible implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 A flowchart of a method for format conversion of test results provided in an embodiment of the present application;

[0024] Figure 2 A schematic diagram of a process for obtaining a structural rule corresponding to a first test facility provided in an embodiment of the present application;

[0025] Figure 3A An example diagram of a test result example provided in an embodiment of the present application;

[0026] Figure 3B An example diagram of a key field configuration file provided in an embodiment of the present application;

[0027] Figure 4 A flowchart of another method for format conversion of test results provided in an embodiment of the present application;

[0028] Figure 5 A schematic diagram of an application scenario for implementing format conversion of test results provided in an embodiment of the present application;

[0029] Figure 6 A schematic diagram of another application scenario for implementing format conversion of test results provided in an embodiment of the present application;

[0030] Figure 7 A schematic diagram of a process for converting the format of a test result to be converted provided in an embodiment of the present application;

[0031] Figure 8 A flowchart of another method for format conversion of test results provided in an embodiment of the present application;

[0032] Fig. 9 A schematic diagram of the structure of a test result format conversion device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] The terms "first", "second", "third", etc. in the specification, claims and drawings of this application are used to distinguish different objects rather than to limit a specific order.

[0034] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0035] In order to make the description of the following embodiments clear and concise, a brief introduction to the related technology is first given:

[0036] Test Infrastructure refers to the overall collection of hardware, software environment and related resources required to support software testing activities. Test infrastructure includes test tools, test frameworks, etc.

[0037] Test tools are specialized software applications used to assist or automate the testing process. Test tools can more effectively create test cases, execute tests, record results, track defects, measure performance, and perform regression testing. Test tools include: automated testing tool Selenium, performance testing tool LoadRunner, unit testing tool JUnit, etc.

[0038] A test framework is a structured approach or a set of conventions that provides a standardized infrastructure on which testers can build and organize test code. A test framework not only contains rules for writing test cases, but may also provide some advanced features such as test set management, test data management, and exception handling mechanisms. A test framework helps reuse test logic, reduce duplication of work, improve test efficiency and consistency, and support the implementation of automated testing. Test frameworks include: Cactus, an integrated unit test framework for server-side Java code, and Selenium WebDriver, a test framework for web user interfaces (Web UI).

[0039] The following introduces the advantages of a method for format conversion of test results in an embodiment of the present application by comparison with the problems of the format conversion method of test results in the current technology.

[0040] Since the formats of the test results obtained by different testing facilities are different, the analysis and comparison tasks of the test results in the testing phase are highly complex. In order to reduce the complexity of analyzing and comparing test results in different formats, the current technology generally manually adapts and converts the data of test results in different formats to convert the test results in different formats into test results in a unified format. Since it is necessary to manually convert multiple test results in different formats into a test result in a unified format, a large amount of manual resources will be consumed to adapt and convert the test results, which requires a lot of time to be wasted, resulting in low overall test efficiency; and the manual conversion of the format of the test results, due to different manual experience and manual subjective reasons, makes it impossible to ensure the correct format conversion of the test results, resulting in low accuracy of the format conversion of the test results, thereby making the overall test accuracy low.

[0041] Furthermore, there is also a method of format conversion of test results in the current technology. Specifically, a customized statistical script is generated for a certain project in advance, and the test results of the corresponding single project are converted through the customized statistical script, without the need to manually convert the format of the test results. However, when the format conversion of the test results is realized through the customized statistical script, it can only be applied to the corresponding single project and is difficult to apply to other projects. Therefore, the universality of the format conversion of the test results through the customized statistical script is low.

[0042] The embodiment of the present application provides a method for format conversion of test results, including: receiving a test result example corresponding to a first test facility, and a key field configuration file corresponding to the test result example; obtaining a structural rule corresponding to the first test facility according to the test result example and the key field configuration file; storing the structural rule corresponding to the first test facility, so as to perform format conversion on the test result to be converted based on the stored structural rule. The embodiment of the present application counts and stores the structural rule corresponding to the first test facility according to the test result use case and the corresponding key field configuration file, and then automatically realizes the format conversion of the test result to be converted corresponding to the first test facility according to the structural rule corresponding to the first test facility, thereby obtaining a target test result in a preset format, ensuring the uniqueness and uniformity of the test structure format, eliminating the need to manually convert the format of the test result, reducing the time consumed by the test result format conversion, and improving the test efficiency to a certain extent; and to a certain extent, improving the accuracy of the test result format conversion, thereby improving the accuracy of the overall test.

[0043] Embodiment 1:

[0044] Combine the following Figure 1- Figure 3, a method for format conversion of a test result provided in an embodiment of the present application is introduced in detail. A method for format conversion of a test result provided in an embodiment of the present application is applied to a format conversion device. It should be noted that the format conversion device is essentially a computing device that can execute a method for format conversion of a test result provided in an embodiment of the present application.

[0045] like Figure 1 As shown, a method for format conversion of test results provided in an embodiment of the present application includes the following steps:

[0046] S101: Receive a test result example corresponding to a first test facility and a key field configuration file corresponding to the test result example.

[0047] Specifically, a test result example corresponding to the first test facility and a key field configuration file corresponding to the test result example input by a user are received.

[0048] The test result example refers to the test result file generated after a set of test cases are executed during the software testing process, the actual result record and evaluation report of the test result file. For example, the test result example usually includes: test objectives, execution process, test data, expected results, and actual results.

[0049] In the embodiment of the present application, the received test result examples include test result examples corresponding to different results, for example: a test result example with a successful test result, a test result example with a failed test result, a test result example with a skipped test result, a test result example with a timeout test result, etc. Among them, a test result of Success indicates that the test has achieved the expected goal; a test result of Failure indicates that at least one test condition has failed to reach the expected goal, that is, the actual result does not match the expected result; a test result of Skip indicates that the test has not been executed, usually because a certain condition is not met; a test result of Timeout indicates that during the test execution, a certain operation or function has not been completed within the specified time.

[0050] In a possible implementation, the received test result examples include test result examples corresponding to different test results. Exemplarily, the test results include four types: failure, success, skip, and timeout. Then, the received test result examples include test result examples corresponding to the four test results, that is, the number of received test result examples is four.

[0051] In another possible implementation, when different test results use the same format, a test result example corresponds to the different test results. For example, if the format of a successful test result is the same as the format of a failed test result, the test result examples corresponding to the successful and failed test results are the same test result example. When different test results use different formats, multiple test result examples are required to correspond to the different test results. Exemplarily, the test results include failure, success, skip, and timeout. The formats of the test results for failure and success are the same. The received test result examples include: a test result example corresponding to a failed (or successful) test result, a test result example corresponding to a skipped test result, and a test result example corresponding to a timed-out test result. That is, the number of received test result examples is three.

[0052] Among them, the key field configuration file includes a first key field name and a corresponding key field. Specifically, the key field configuration file is used to indicate the key fields in the test result example. The key fields include: a test suite name field, a test case name field, a test result field, a test facility name field, etc., wherein the test suite name, the test case name, the test result, the test facility name, etc. can be referred to as the first key field name. That is, the key field configuration file is used to indicate which fields in the test result example are the fields corresponding to the first key field name, for example: the key field configuration file is used to indicate which fields in the test result example are the test suite name fields, which fields are the test case name fields, which fields are the test result representation fields, which fields are the test facility name fields, etc.

[0053] A test suite is a set of related test cases that are used to verify the behavior and performance of a specific module, feature set, or the entire software product.

[0054] A test case is the basic unit of software testing. It describes a single test operation in detail and is designed to verify a specific function or behavior of a software product.

[0055] In a possible implementation, when the number of test result examples is at least two, the key field configuration file includes key field configuration information corresponding to the at least two test result examples. Further, the key field configuration information corresponding to the at least two test result examples can be stored in the form of a key field configuration subfile.

[0056] S102: Generate a structural rule corresponding to the first test facility according to the test result example and the key field configuration file.

[0057] The structural rule includes the header field corresponding to the key field and the second key field name corresponding to the key field, that is, the structural rule includes the correspondence between the header field and the second key field name. The structural rule is used to indicate that the field that appears after the header field in the test result corresponding to the corresponding test facility is the key field corresponding to the second key field name. For example: the structural rule includes the correspondence between the second key field name A and the header field a, then in the test result corresponding to the first test facility, the key field that appears after the header field a is the key field corresponding to the second key field name A.

[0058] It should be noted that in the embodiments of the present application, in the structural rules corresponding to different test facilities, the name of the second key field is unified and can be pre-set by the user according to user needs or based on usage experience. This application does not make any specific limitations.

[0059] Further, it should be noted that the first key field name and the second key field name may be the same or different, and this application does not make specific limitations. The first key field names representing the same key field name in different key field configuration files may be different or the same; however, the second key field names representing the same key field name in the structural rules corresponding to different test facilities are the same. Exemplarily, the first key field name of the test case name field in the key field configuration file corresponding to test tool m is case, and the first key field name of the test case name field in the key field configuration file corresponding to test tool n is casename, and the first key field name of the test case name may be different; the second key field name of the test case name field in the structural rules corresponding to test tool m and test tool n, respectively, is "_fixed_fields_casename", and the second key field name of the test case name must be unified (the same).

[0060] For ease of understanding, the following Figure 2 The following describes in detail how to obtain the structural rules corresponding to the first test facility.

[0061] S201. According to the test result example and the key field configuration file, the attribute information of the key fields in the test result example is parsed.

[0062] The attribute information of the key field includes paragraph information, position information, and frequency of occurrence information of the key field in the test result example. For example, the test suite name field only appears once in multiple test result examples. If the test suite name field appears too many times, it may indicate that there is an abnormality in the test result example.

[0063] S202. Determine, according to the attribute information of the key field, the header field corresponding to the key field in the test result example.

[0064] The header field corresponding to the key field is located before the key field and is used to describe the specific meaning represented by the key field.

[0065] S203: Generate a structural rule corresponding to the first test facility according to the header field corresponding to the key field and the second key field name corresponding to the key field.

[0066] Exemplarily, the key field is the use case name field, and the corresponding header field when the use case name field appears in the test result example is header field b; header field b is the header field of the use case name field, and the second key field name corresponding to the use case name field is "standard test case name"; based on the header field b corresponding to the use case name field and the second key field name "standard test case name" corresponding to the use case name field, the structural rules corresponding to the first test facility are generated, that is, the structural rules corresponding to the first test facility include the correspondence between the header field b and the standard test case name.

[0067] Further, for ease of understanding, the following is combined Figure 3A and Figure 3B , an example is given to explain how to obtain the structural rules corresponding to the first test facility.

[0068] For example, the test results corresponding to the test facility mugen are as follows: Figure 3A As shown. Specifically, the first line records: It occurred at 00:02:43 on Wednesday, August 9, 2023, with a log level of INFO, and the content is that the test case named oe_test_pyScss_03 was started. The second line records: It occurred at 00:02:44 on Wednesday, August 9, with a log level of INFO, and the content is that the test case exited because of 0. The third line records that it occurred at 00:02:44 on Wednesday, August 9, with a log level of INFO, and the content is that the test case named oe_test_pyScss_03 was terminated.

[0069] The log level INFO in the test case is used to describe a type of message recorded by the system or application during software development and operation and maintenance. In the log system, INFO-level log messages are mainly used to provide useful information during normal operation. They record important system operations, state changes, process flows, etc., but do not indicate that there are problems or errors.

[0070] For example, the key field configuration file is as follows: Figure 3BSpecifically, the key field configuration file includes: the first key field name is test facility and its corresponding key field is mugen; the first key field name is use case name and its corresponding key field is oe_test_pyScss_03; the first key field name is test result and its corresponding key field is 0.

[0071] According to the test result example and key field configuration file, the key field attribute information in the test result example is parsed. It can be seen that the key field oe_test_pyScss_03 corresponding to the use case name is located in the first and third rows and appears twice; the key field corresponding to the test result is located in the second row and appears once.

[0072] Then, according to the key field attribute information, it is determined that the header field corresponding to the key field oe_test_pyScss_03 corresponding to the use case name includes "Start to run testcase" and "End to run testcase". Among them, the header field "Start to run testcase" is followed by the key field oe_test_pyScss_03 corresponding to the use case name, and the second key field name corresponding to the key field oe_test_pyScss_03 corresponding to the use case name is "_fixed_fields_casename" (fixed field test case name). According to the key field attribute information, it is determined that the header field corresponding to the key field 0 corresponding to the test result is "The case exit by", and it is followed by the key field 0 corresponding to the test result, and the second key field name corresponding to the key field 0 corresponding to the test result is "_fixed_fields_result" (fixed field test result).

[0073] Then, according to the correspondence between the header field "Start to run testcase" and the second key field name "_fixed_fields_casename", and the correspondence between the header field "The case exit by" and the second key field name "_fixed_fields_result", the structural rules corresponding to the test facility mugen are generated.

[0074] The above combination Figure 2 , Figure 3A and Figure 3B , describes in detail how to obtain the structural rules corresponding to the first test facility in the embodiment of the present application, and then continues with Figure 1 A method for converting the format of a test result provided in an embodiment of the present application is introduced.

[0075] S103: Storing the structural rules corresponding to the first test facility, so as to perform format conversion on the test result to be converted based on the stored structural rules.

[0076] Specifically, the structural rules corresponding to the first test facility are stored in the format conversion device itself. When the format conversion device receives the test result to be converted corresponding to the first test facility, it performs format conversion on the test result to be converted based on the structural rules corresponding to the first test facility.

[0077] In one possible implementation, after storing the structural rules corresponding to the first test facility, the structural rules corresponding to the first test facility are output to other devices / apparatuses / platforms, so that other devices / apparatuses / platforms store the structural rules corresponding to the first test facility, thereby realizing the function of format conversion of the test results to be converted corresponding to the first test facility.

[0078] Furthermore, based on the structural rules corresponding to the first test facility, the format of the test results to be converted corresponding to the first test facility is converted as follows: based on the structural rules corresponding to the first test facility, key field information is obtained from the test results to be converted corresponding to the first test facility; based on the key field information and the second key field name, a target test result in a preset format is generated.

[0079] For ease of understanding, an example is given below in conjunction with Table 1. The preset format takes the template shown in Table 1 as an example.

[0080] Table 1

[0081] Second key field name template data Standard use case suite name Use case name (Use case name data) Standard use case names Use Case Name (Use Case Name Data) Standard test results Test Results (Test result data)

[0082] Exemplarily, based on the structural rules corresponding to the first test facility, the use case suite name field information, the use case name field information and the test result field information are obtained from the test results to be converted corresponding to the first test facility; based on the use case suite name field information and the corresponding second key field name "standard use case suite name", the use case name field information and the corresponding second key field name "standard use case name", the test result field information and the corresponding second key field name "standard test result", the corresponding use case suite name data, use case name data and test result data are filled into the table shown in Table 1, thereby generating the target test results in a preset format.

[0083] A method for format conversion of test results provided in an embodiment of the present application includes: receiving a test result example corresponding to a first test facility, and a key field configuration file corresponding to the test result example; obtaining a structural rule corresponding to the first test facility according to the test result example and the key field configuration file; storing the structural rule corresponding to the first test facility so as to perform format conversion on the test result to be converted based on the stored structural rule. The embodiment of the present application counts and stores the structural rule corresponding to the first test facility according to the test result use case and the corresponding key field configuration file, and then automatically realizes the format conversion of the test result to be converted corresponding to the first test facility according to the structural rule corresponding to the first test facility, thereby obtaining a target test result in a preset format, ensuring the uniqueness and uniformity of the test structure format, eliminating the need to manually convert the format of the test result, reducing the time consumed by the test result format conversion, and improving the test efficiency to a certain extent; and to a certain extent, improving the accuracy of the test result format conversion, thereby improving the accuracy of the overall test.

[0084] Embodiment 2:

[0085] Combine the following Figure 4 , another test result format conversion method provided in an embodiment of the present application is introduced in detail.

[0086] S401: Receive a test result example corresponding to a first test facility and a key field configuration file corresponding to the test result example.

[0087] The above S401 is the same as S101 in the first embodiment. For details on the specific implementation of S401, please refer to S101 in the first embodiment, which will not be repeated here.

[0088] S402: Determine whether the key field configuration file meets the first condition.

[0089] Among them, the first condition is that the key field configuration file can be parsed correctly.

[0090] Since the key field configuration file may contain spelling errors, format errors and other problems, the key field configuration file cannot be parsed correctly, that is, the key fields recorded in the key field configuration file cannot be obtained, resulting in the inability to subsequently parse the key field attribute information in the test result example based on the test result example and the key field configuration file.

[0091] When it is determined that the key field configuration file does not satisfy the first condition, that is, the key field configuration file cannot be correctly parsed, the structural rule generation process at this time is terminated.

[0092] In one possible implementation, when it is determined that the key field configuration file does not meet the first condition, a first prompt message for the key field configuration file is output to prompt the user that the key field configuration file input is incorrect and needs to be re-entered, and the format conversion device re-receives the key field configuration file input by the user.

[0093] When it is determined that the key field configuration file meets the first condition, that is, the key field configuration file can be correctly parsed, S403 is performed.

[0094] S403: Determine whether the test result example meets the second condition.

[0095] The second condition is that all key fields recorded in the key field configuration file exist in the test result example.

[0096] When the test result example does not meet the second condition, that is, all the key fields recorded in the corresponding key field configuration file do not exist in the test result example, the structural rule generation process ends. When the test result example does not meet the second condition, it means that the correspondence between the test result example and the key field configuration file is incorrect. For example, due to input / receive errors in the key field configuration file or the test result example, the key field configuration file is not the key field configuration file corresponding to the test result example, resulting in the inability to parse the key field attribute information in the test result example based on the test result example and the key field configuration file.

[0097] In one possible implementation, when it is determined that the test result example does not satisfy the second condition, a second prompt message regarding the correspondence is output to prompt the user that the correspondence between the test result example and the key field configuration file input by the user is incorrect and that the test result example and / or the key field configuration file needs to be re-entered, and the format conversion device re-receives the test result example and / or the key field configuration file input by the user.

[0098] When the test result example satisfies the second condition, that is, all the key fields recorded in the corresponding key field configuration file do not exist in the test result example, S404 is performed.

[0099] S404: Obtain a structural rule corresponding to the first test facility according to the test result example and the key field configuration file.

[0100] S405: Storing the structural rules corresponding to the first test facility, so as to perform format conversion on the test result to be converted based on the stored structural rules.

[0101] The above S404 and S405 are the same as S102 and S103 in the first embodiment. For details on the specific implementation of S404 and S405, please refer to S102 and S103 in the first embodiment, which will not be repeated here.

[0102] The embodiment of the present application provides a method for format conversion of test results. After receiving a test result example corresponding to a first test facility and a key field configuration file corresponding to the test result example, it is determined whether the key field configuration file satisfies a first condition and whether the test result example satisfies a second condition; when the key field configuration file satisfies the first condition and the test result example satisfies the second condition, the structural rules corresponding to the first test facility are obtained according to the test result example and the key field configuration file; the structural rules corresponding to the first test facility are stored so as to perform format conversion on the test results to be converted based on the stored structural rules. This avoids affecting the accuracy of the structural rules corresponding to the first test facility due to errors in the test result example and the key field configuration file, and further improves the accuracy of subsequent test result format conversion.

[0103] Embodiment three:

[0104] Combine the following Figure 5-Figure 8 , a detailed introduction is given to how to implement the format conversion of the test results to be converted in a test result format conversion method provided in an embodiment of the present application.

[0105] First combine Figure 5 and Figure 6 , an example is given to illustrate an application scenario in which the format conversion of the test results to be converted is implemented in an embodiment of the present application.

[0106] An application scenario for realizing format conversion of test results to be converted provided by an embodiment of the present application is as follows: Figure 5 As shown in the figure, the format conversion device is the base of the automated test platform, that is, the format conversion device is the infrastructure or hardware facility of the automated test platform. It can be simply understood that the format conversion device is part of the automated test platform. Among them, the automated test platform provides a full set of tools and services required for automated testing, aiming to simplify and standardize the entire test process, from test plan formulation, test case writing, test execution to test result analysis and report generation.

[0107] Specifically, the automated testing platform tests software products based on testing tools, testing frameworks, benchmark tests and other testing facilities, and outputs corresponding test results to be converted; converts the test results to be converted into target test results in a corresponding preset format through format conversion equipment; and outputs the corresponding target test results.

[0108] In a possible implementation, the automated test platform can output the corresponding target test results through console output, file output, and application programming interface (API) output. Among them, the console output method is to output the target test results through the standard output stream; the file output method is to write the target test results to the file on the disk to achieve the output of the target test results; the API output method refers to outputting the target test results through the return value or response data provided by the application programming interface.

[0109] Another application scenario for implementing the format conversion of the test results to be converted provided by the embodiment of the present application is as follows: Figure 6 As shown, the structural rules generated by the format conversion device are output and deployed to the automated testing platform (or other testing platform), so that the automated testing platform can convert the test results to be converted into the corresponding target test results in a preset format based on the deployed structural rules and output the corresponding target test results.

[0110] Combine the following Figure 7 A detailed description is given of how to implement the format conversion of the test results to be converted in a method for format conversion of test results provided in an embodiment of the present application. The method can be applied to an automated test platform that deploys a format conversion device or an automated test platform that deploys structural rules generated by a format conversion device. In the embodiment of the present application, the application is described by taking the application to the format conversion device as an example. The process of the automated test platform applied to the structural rules generated by the format conversion device is similar to that applied to the format conversion device.

[0111] S701: Receive a test result to be converted and a second test facility corresponding to the test result to be converted.

[0112] Receive the test result to be converted and the corresponding second test facility input by the user.

[0113] It should be noted that the second test facility may be the same as the first test facility, or may be different from the first test facility, and this application does not make any specific limitation.

[0114] S702: Determine whether a structural rule corresponding to the second test facility can be matched.

[0115] Specifically, only if the structural rule corresponding to the second test facility exists in the format conversion device, can the format conversion of the test result to be converted be implemented.

[0116] When the structural rule corresponding to the second test facility is matched, S703 is performed.

[0117] When the structural rule corresponding to the second test facility is not matched, S704 is performed.

[0118] S703: Output third prompt information.

[0119] The third prompt information is used to indicate that there is no structural rule corresponding to the second test facility. By outputting the third prompt information, the user can be prompted to add a structural rule corresponding to the second test facility so as to realize the format conversion of the test result corresponding to the second test facility.

[0120] In a possible implementation, if the format conversion device includes a display, the third prompt information may be output through a pop-up window to prompt the user that a new structural rule corresponding to the second test facility needs to be added.

[0121] S704: Based on the structural rule corresponding to the second test facility, perform format conversion on the test result to be converted to obtain a target test result in a preset format.

[0122] Specifically, based on the structural rules corresponding to the second test facility, key field information is obtained from the test result to be converted; based on the key field information and the corresponding second key field name, a corresponding target test result in a preset format is generated.

[0123] S705: Determine whether there is an abnormality in the target test result in the preset format.

[0124] Specifically, the target test result in the preset format is parsed, and based on the parsing of the target test result in the preset format, it is determined whether the target test result in the preset format is abnormal. The abnormality of the target test result includes: lack of necessary key field information, obvious errors in key fields, or even the target test result does not carry any information.

[0125] When the target test result in the preset format is abnormal, proceed to S706.

[0126] When there is no abnormality in the target test result in the preset format, proceed to S707.

[0127] S706: Output fourth prompt information.

[0128] The fourth prompt information is used to indicate that the structural rule and / or the received test result to be converted are abnormal. By outputting the fourth prompt information, the user can be prompted to check the structural rule corresponding to the second test facility and / or the received test result to be converted.

[0129] When there is an abnormality in the target test result of the preset format, it indicates that there is an abnormality in the structural rule and / or the received test result to be converted, for example: the structural rule corresponding to the second test facility is incorrect, the received test result to be converted is not the test result corresponding to the second test facility, etc.

[0130] S707: Output the target test result in a preset format.

[0131] Specifically, the corresponding target test results can be output through console output, file output and API output.

[0132] In an embodiment of the present application, a test result to be converted and a second test facility corresponding to the test result to be converted are received; when a structural rule corresponding to the second test facility is matched, the test result to be converted is formatted based on the structural rule corresponding to the second test facility to obtain a target test result in a preset format, and the target test result in the preset format is output. In an embodiment of the present application, based on the stored structural rules, the format conversion of the test result to be converted corresponding to the first test facility is automatically implemented to obtain a target test result in a preset format, thereby ensuring the uniqueness and uniformity of the test structure format, eliminating the need to manually convert the format of the test result, reducing the time consumed by the test result format conversion, and improving the test efficiency to a certain extent; and to a certain extent, improving the accuracy of the test result format conversion, thereby improving the accuracy of the overall test.

[0133] Furthermore, when the structural rule corresponding to the second test facility is not matched, a third prompt message is output to prompt the user to add a structural rule corresponding to the second test facility, thereby realizing flexible update of the format conversion capability.

[0134] Furthermore, after obtaining the target test result, it is determined whether there is any abnormality in the target test result in the preset format. If there is no abnormality in the target test result, the target test result is output, further ensuring the accuracy and reliability of the test result format conversion.

[0135] Furthermore, if there is an abnormality in the target test result, a fourth prompt message is output to prompt that there may be an abnormality in the structural rules and / or the received test results to be converted, so that the user can detect the structural rules and / or the test results to be converted, further ensuring the accuracy and reliability of the test result format conversion.

[0136] Combine the following Figure 8 , an exemplary overall introduction to a format conversion method provided by an embodiment of the present application is given. Assuming that the format conversion device does not store the structural rules corresponding to the third test facility, the process is as follows Figure 8 shown.

[0137] like Figure 8 As shown, structural rules are generated and stored in advance, and a test result example corresponding to the third test facility and a key field configuration file corresponding to the test result example are received; the structural rules corresponding to the third test facility are generated according to the test result example and the corresponding key field configuration file; the structural rules corresponding to the third test facility are stored, and the generation and storage of the structural rules corresponding to the third test facility are completed.

[0138] Subsequently, based on the structural rules corresponding to the stored third test facility, the format conversion of the test results corresponding to the third test facility is implemented. Figure 8 As shown, the test results to be converted corresponding to the third test facility and the third test facility are received; it is determined whether the structural rules corresponding to the third test facility can be matched; in an embodiment of the present application, the structural rules corresponding to the third test facility can be matched, and based on the structural rules corresponding to the third test facility, the test results to be converted corresponding to the third test facility are formatted to obtain target test results in a preset format; it is determined whether there are any abnormalities in the target test results in the preset format; if there are no abnormalities, the target test results in the preset format are output; if there are any abnormalities, a fourth prompt message is output to prompt that there are abnormalities in the structural rules and / or the received test results to be converted.

[0139] Further, if the structural rule corresponding to the third test facility is not matched, a third prompt message is output to prompt the user to add a structural rule corresponding to the second test facility.

[0140] Embodiment 4:

[0141] Combine the following Fig. 9 , a test result format conversion device provided in an embodiment of the present application is introduced in detail.

[0142] like Fig. 9 As shown, a format conversion and transposition of a test result provided in an embodiment of the present application includes the following modules:

[0143] The receiving module 901 is used to receive a test result example corresponding to the first test facility and a key field configuration file corresponding to the test result example; the key field configuration file includes a first key field name and a corresponding key field;

[0144] A generating module 902, for generating a structural rule corresponding to the first test facility according to the test result example and the key field configuration file; the structural rule includes a header field corresponding to the key field and a second key field name corresponding to the key field;

[0145] The storage module 903 is used to store the structural rules corresponding to the first test facility, so as to perform format conversion on the test result to be converted based on the stored structural rules.

[0146] In one possible implementation, generation module 902 is specifically used to parse attribute information of key fields in a test result example based on the test result example and the key field configuration file; the key field is a key field included in the key field configuration file; based on the attribute information of the key field, a header field corresponding to the key field is determined in the test result example; based on the header field corresponding to the key field and the second key field name corresponding to the key field, a structural rule corresponding to the first test facility is generated; the second key field name corresponding to the key field is a pre-set unified key field name.

[0147] In a possible implementation, the device further includes a configuration file judgment module and a result example judgment module. The configuration file judgment module is used to judge whether the key field configuration file meets the first condition; the first condition is that the key field configuration file can be correctly parsed; the result example judgment module is used to judge whether the test result example meets the second condition when the key field configuration file meets the first condition; the second condition is that all the key fields included in the key field configuration file exist in the test result example; the generation module 902 is specifically used to generate the structural rules corresponding to the first test facility according to the test result example and the key field configuration file when the test result example meets the second condition.

[0148] In a possible implementation, the configuration file determination module is further configured to output a first prompt message when the key field configuration file does not satisfy the first condition, so as to prompt the user that the key field configuration file cannot be correctly parsed.

[0149] In a possible implementation, the result example judgment module is further configured to output a second prompt message when the test result example does not satisfy the second condition, so as to prompt the user that the correspondence between the test result example and the key field configuration file is incorrect.

[0150] In a possible implementation, the device further includes:

[0151] A test result receiving module to be converted, used for receiving the test result to be converted and a second test facility corresponding to the test result to be converted;

[0152] A structural rule matching module, used to determine whether a structural rule corresponding to the second test facility can be matched;

[0153] The test result format conversion module is used to convert the format of the test result to be converted based on the structural rule corresponding to the second test facility when the structural rule corresponding to the second test facility is matched, so as to obtain the target test result in a preset format.

[0154] In one possible implementation, the test result format conversion module is specifically used to obtain key field information from the test result to be converted based on the structural rules corresponding to the second test facility; based on the key field information and the corresponding second key field name, generate a corresponding target test result in a preset format.

[0155] In a possible implementation, the structural rule matching module is further used to output third prompt information when the structural rule corresponding to the second test facility is not matched; the third prompt information is used to indicate that there is no structural rule corresponding to the second test facility.

[0156] In one possible implementation, the device also includes: a target test result abnormality judgment module and a target test result output module; wherein the target test result abnormality judgment module is used to judge whether there is an abnormality in the target test result in a preset format; the target test result output module is used to output the target test result in a preset format when there is no abnormality in the target test result in the preset format.

[0157] In a possible implementation, the target test result abnormality judgment module is also used to output a fourth prompt message when an abnormality exists in the target test result of a preset format; the fourth prompt message is used to indicate that an abnormality exists in the structural rule corresponding to the second test facility and / or the test result to be converted.

[0158] The embodiment of the present application provides a test result format conversion device, including: a receiving module 901, which is used to receive a test result example corresponding to a first test facility, and a key field configuration file corresponding to the test result example; the key field configuration file includes a first key field name and a corresponding key field; a generating module 902, which is used to generate a structure rule corresponding to the first test facility according to the test result example and the key field configuration file; the structure rule includes a header field corresponding to the key field and a second key field name corresponding to the key field; a storage module 903, which is used to store the structure rule corresponding to the first test facility, so as to perform format conversion on the test result to be converted based on the stored structure rule. According to the test result case and the corresponding key field configuration file, the structure rule corresponding to the first test facility is counted and stored, and subsequently, according to the structure rule corresponding to the first test facility, the format conversion of the test result to be converted corresponding to the first test facility is automatically realized, so as to obtain the target test result of the preset format, thereby ensuring the uniqueness and uniformity of the test structure format, not requiring manual conversion of the test result format, reducing the time consumed by the test result format conversion, and improving the test efficiency to a certain extent; and to a certain extent, improving the accuracy of the test result format conversion, thereby improving the accuracy of the overall test.

[0159] In addition, an embodiment of the present application also provides a computing device, including a memory and a processor; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory, so that the processor executes the steps of the format conversion method of the test results in the above embodiment; the memory is also used to store structural rules corresponding to the test facilities.

[0160] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed on a computer, the computer executes the method for format conversion of the test results in the above embodiment.

[0161] For the explanation of the relevant contents and description of the beneficial effects of any of the above-mentioned computer-readable storage media, reference may be made to the above-mentioned corresponding embodiments, which will not be repeated here.

[0162] The present application embodiment also provides a computer program product including instructions, when the instructions are run on a computer, the computer executes the format conversion method of any one of the test results in the above-mentioned embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that can be accessed by the computer or a data storage device such as a server, a data center, etc. that can be integrated with one or more media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD), etc.

[0163] It should be noted that the above-mentioned devices for storing computer instructions or computer programs provided in the embodiments of the present application, such as but not limited to the above-mentioned memories, computer-readable storage media and communication chips, etc., are all non-transitory.

[0164] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more servers that can be integrated with a medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).

[0165] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other changes to the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0166] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for converting the format of a test result, characterized in that: include: receiving a test result example corresponding to each of the test facilities in a plurality of test facilities and a key field configuration file corresponding to the test result example; The key field configuration file includes a first key field name and a corresponding key field; Generate a structural rule corresponding to each of the test facilities according to the test result example and the key field configuration file; the structural rule includes a header field corresponding to the key field, a second key field name corresponding to the key field, and a corresponding relationship between the header field and the second key field name; The second key field name in the structural rule corresponding to each of the test facilities is the same; storing the structural rules corresponding to each of the test facilities, so as to perform format conversion on the test results to be converted based on the stored structural rules; The format conversion of the test result to be converted based on the stored structural rules includes: receiving the test result to be converted and a second test facility corresponding to the test result to be converted; Determining whether a structural rule corresponding to the second test facility can be matched; When the structural rule corresponding to the second test facility is matched, the test result to be converted is formatted based on the structural rule corresponding to the second test facility to obtain a target test result in a preset format, where the preset format includes a second key field name; When the structural rules corresponding to the second test facility are not matched, a third prompt message is output so as to receive the test result example corresponding to the second test facility and the corresponding key field configuration file based on the third prompt message, and generate the structural rules corresponding to the second test facility according to the test result example corresponding to the second test facility and the corresponding key field configuration file; wherein the third prompt message is used to prompt that there is no structural rule corresponding to the second test facility.

2. The method according to claim 1, characterized in that Generating a structural rule corresponding to each of the test facilities according to the test result example and the key field configuration file includes: According to the test result example and the key field configuration file, parsing the attribute information of the key field in the test result example; the key field is a key field included in the key field configuration file; Determine, in the test result example, a header field corresponding to the key field according to the attribute information of the key field; The structural rules corresponding to each of the test facilities are generated according to the header field corresponding to the key field and the second key field name corresponding to the key field; the second key field name corresponding to the key field is a pre-set unified key field name.

3. The method according to claim 1, characterized in that Before generating the structural rules corresponding to each of the test facilities according to the test result examples and the key field configuration files, the method further includes: Determine whether the key field configuration file meets a first condition; the first condition is that the key field configuration file can be correctly parsed; When the key field configuration file meets the first condition, determining whether the test result example meets the second condition; the second condition is that all the key fields included in the key field configuration file exist in the test result example; Generating a structural rule corresponding to each of the test facilities according to the test result example and the key field configuration file includes: When the test result example satisfies the second condition, a structural rule corresponding to each of the test facilities is generated according to the test result example and the key field configuration file.

4. The method according to claim 3, characterized in that The method further comprises: When the key field configuration file does not meet the first condition, a first prompt message is output to prompt the user that the key field configuration file cannot be correctly parsed.

5. The method according to claim 3, characterized in that: The method further comprises: When the test result example does not satisfy the second condition, a second prompt message is output to prompt the user that the correspondence between the test result example and the key field configuration file is incorrect.

6. The method according to claim 1, characterized in that The step of converting the test result to be converted based on the structural rule corresponding to the second test facility to obtain a target test result in a preset format includes: Based on the structural rule corresponding to the second test facility, acquiring key field information from the test result to be converted; Based on the key field information and the corresponding second key field name, a target test result in a corresponding preset format is generated.

7. The method according to claim 1, characterized in that After converting the format of the test result to be converted based on the structural rule corresponding to the second test facility to obtain the target test result in a preset format, the method further includes: Determine whether the target test result in the preset format is abnormal; When there is no abnormality in the target test result in the preset format, the target test result in the preset format is output.

8. The method according to claim 7, characterized in that The method further comprises: When the target test result in the preset format is abnormal, a fourth prompt message is output; the fourth prompt message is used to indicate that the structural rule corresponding to the second test facility and / or the test result to be converted is abnormal.

9. A computing device, characterized in that including memory and processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Test processing method and apparatus

    CN109376083A

  • Chip test result format conversion method and device and electronic equipment

    CN117408231A