Method, system and equipment for executing test based on test steps and medium

By using a mapping table, the test step documents generated by the designer's unit tests are converted into a format that can be recognized by automated testing software. This solves the problems of time consumption and errors caused by manual conversion in existing technologies, and achieves efficient and accurate test step parsing and format conversion.

CN121579347APending Publication Date: 2026-02-27CHINA FAW CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511686246.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-17
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

In existing technologies, test step documents generated by designers for unit tests need to be manually converted into the format of automated testing software. This process is time-consuming, prone to information omissions or conversion errors, and has poor compatibility between different designers' formats, making it difficult to meet the efficiency and accuracy requirements of software testing.

Method used

This paper provides a method for executing tests based on test steps. It converts initial test parameters and execution logic into a standard format through a mapping table, generates a structured test table, and executes tests through the target test interface, thereby achieving automated test step parsing and format conversion.

Benefits of technology

It enables the automated conversion from non-standardized testing steps to standardized executable data, improving testing efficiency and accuracy, and reducing errors and compatibility issues caused by manual operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579347A_ABST
    Figure CN121579347A_ABST
Patent Text Reader

Abstract

The method comprises the following steps: extracting initial test parameters and initial test execution logic from initial test content; based on the mapping table, matching a standard parameter expression format corresponding to a parameter expression format in the initial test parameters, and matching a standard execution logic expression format corresponding to an execution logic expression format in the initial test execution logic; according to a standard parameter expression format, converting the initial test parameters into corresponding target test parameters, and according to a standard execution logic expression format, converting the initial test execution logic into corresponding target test execution logic; and according to the target test parameters and the target test execution logic, generating a target structured test table, sending the target structured test table to the target test interface, and executing a test according to the target structured test table through the target test interface to obtain a target test result, so that conversion from test steps to standardized executable can be completed, and the test is executed. Automation of test step analysis, format conversion and test execution is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of software testing, and in particular to a method, system, device and medium for performing testing based on test steps. BACKGROUND

[0002] In the technical field of software testing, designer unit testing is a key link to ensure the effectiveness of software functions. After the designer completes the unit testing, a test step document containing test logic, input and output requirements, and execution conditions is generated. However, the automatic testing software can only recognize data in a specific format, so the key information in the test step document needs to be extracted and converted into a data file that meets the format requirements of the automatic testing software. This process is the core link between designer unit testing and automatic testing execution.

[0003] However, the existing technology has long relied on manual operation, and the staff needs to master both the test step analysis logic and the automatic testing software format specifications. This not only takes a long time to process, is prone to information omission or conversion errors, and is difficult to meet the efficiency requirements of software testing, but also has poor compatibility of diversified test step formats written by different designers, lacks a unified processing standard, and results in low test efficiency and accuracy of software testing. SUMMARY

[0004] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.

[0005] The main purpose of the embodiments of the present disclosure is to provide a method, system, device and medium for performing testing based on test steps, which can complete the conversion from test steps to standardized executable and perform testing, and realize the automation of test step analysis, format conversion and test execution.

[0006] The first aspect of the embodiments of the present application provides a method for performing testing based on test steps, for a central controller, the method comprising: extracting initial test parameters and initial test execution logic from the initial test content in response to the test requirements of the initial test content; matching a standard parameter expression format corresponding to a parameter expression format in the initial test parameters and a standard execution logic expression format corresponding to an execution logic expression format in the initial test execution logic based on a mapping table; the mapping table includes a first sub-mapping table and a second sub-mapping table, the first sub-mapping table includes mapping relationships between a plurality of parameter expression formats and a standard parameter expression format, and the second sub-mapping table includes mapping relationships between a plurality of execution logic expression formats and a standard execution logic expression format; According to the standard parameter expression format, the initial test parameters are converted into corresponding target test parameters, and according to the standard execution logic expression format, the initial test execution logic is converted into corresponding target test execution logic. Based on the target test parameters and the target test execution logic, a target structured test table is generated; The target structured test form is sent to the target test interface so that the test is performed according to the target structured test form through the target test interface to obtain the target test result.

[0007] The first aspect of this application provides a method for executing tests based on test steps. This method involves extracting initial test parameters and initial test execution logic from initial test content; matching standard parameter expression formats corresponding to the parameter expression formats in the initial test parameters and standard execution logic expression formats corresponding to the execution logic expression formats in the initial test execution logic based on a mapping table; converting the initial test parameters into corresponding target test parameters according to the standard parameter expression formats, and converting the initial test execution logic into corresponding target test execution logic according to the standard execution logic expression formats; generating a target structured test table based on the target test parameters and target test execution logic, and sending it to a target test interface; executing the test through the target test interface based on the target structured test table to obtain the target test result. This method automates the conversion from test steps to standardized executable data and performs the test, thus automating test step parsing, format conversion, and test execution.

[0008] In some embodiments of this application, the step of extracting initial test parameters and initial test execution logic from the initial test content includes: The initial test content is semantically parsed to obtain the parameter description text and logical description text in the initial test content; The parameter description text and the logic description text are preprocessed to obtain the initial test parameters and the initial test execution logic. The preprocessing includes at least deduplication and classification.

[0009] In some embodiments of this application, after extracting the initial test parameters and initial test execution logic from the initial test content, the method further includes: Based on the mapping table, the initial test parameters and initial test execution logic are format-validated to obtain the format validation result; If the format verification result indicates that the initial test parameters do not match the standard parameter expression format in the mapping table, or the initial test execution logic does not match the standard execution logic expression format in the mapping table, then a preset prompt message will be output and the current test execution process will be terminated.

[0010] In some embodiments of the present application, the converting the initial test parameters into corresponding target test parameters according to the standard parameter expression format and the converting the initial test execution logic into corresponding target test execution logic according to the standard execution logic expression format comprises: converting the matched parameter expression format in the initial test parameters into corresponding standard parameter expression format based on the first sub-mapping table to obtain the target test parameters, the initial test parameters including signal parameters, power parameters and state parameters of a test object; converting the matched execution logic expression format in the initial test execution logic into corresponding standard execution logic expression format based on the second sub-mapping table to obtain the target test execution logic, the initial test execution logic including loop execution rules, conditional branching rules and sequential execution rules of test steps.

[0011] In some embodiments of the present application, the generating a target structured test table according to the target test parameters and the target test execution logic comprises: traversing the target test parameters and the target test execution logic to eliminate irrelevant contents in the target test parameters and the target test execution logic to obtain first test parameters and first test execution logic, the irrelevant contents being identified and determined based on preset irrelevant content identifiers; associating and integrating the first test parameters and the first test execution logic based on the initial test content to form a structured data matrix; calling a format conversion component to convert the structured data matrix into table format data to obtain the target structured test table, the table format data being in a format that can be directly read by the target test interface.

[0012] In some embodiments of the present application, before the sending the target structured test table to the target test interface to perform a test according to the target structured test table through the target test interface to obtain a target test result, the method further comprises: respectively counting the number of test steps in the initial test content and the number of test step rows in the target structured test table; performing an integrity check on the target structured test table according to the number of test steps and the number of test step rows to obtain a check result; in the case that the check result is that the number of test steps is inconsistent with the number of test step rows, performing a preset abnormal operation and outputting an abnormal prompt.

[0013] In some embodiments of the present application, the initial test content is a test procedure document generated after the user completes the unit test, the test procedure document is in at least one of a text format, a document format and a table format, and the test procedure document includes test execution logic, test parameter requirements and test execution conditions.

[0014] To achieve the above object, a second aspect of the embodiments of the present application provides a system for performing a test based on test steps, the system comprising: an extraction module configured to extract initial test parameters and initial test execution logic from the initial test content in response to test requirements of the initial test content; a matching module configured to match a standard parameter expression format corresponding to a parameter expression format in the initial test parameters and a standard execution logic expression format corresponding to an execution logic expression format in the initial test execution logic based on a mapping table, the mapping table comprising a first sub-mapping table and a second sub-mapping table, the first sub-mapping table comprising mapping relationships between a plurality of parameter expression formats and the standard parameter expression format, and the second sub-mapping table comprising mapping relationships between a plurality of execution logic expression formats and the standard execution logic expression format; a conversion module configured to convert the initial test parameters into corresponding target test parameters according to the standard parameter expression format and convert the initial test execution logic into corresponding target test execution logic according to the standard execution logic expression format; a generation module configured to generate a target structured test table according to the target test parameters and the target test execution logic; an execution module configured to send the target structured test table to a target test interface to perform a test according to the target structured test table through the target test interface to obtain a target test result.

[0015] To achieve the above object, a third aspect of the embodiments of the present application provides an electronic device, comprising at least one control processor and a memory in communication connection with the at least one control processor, the memory storing instructions executable by the at least one control processor, the instructions being executed by the at least one control processor to enable the at least one control processor to perform the above-mentioned method for performing a test based on test steps.

[0016] To achieve the above object, a fourth aspect of the embodiments of the present application provides a computer readable storage medium, the computer readable storage medium storing computer executable instructions, the computer executable instructions being used to enable a computer to perform the above-mentioned method for performing a test based on test steps.

[0017] It can be understood that the beneficial effects of the second aspect to the fourth aspect and related technologies compared with the first aspect and related technologies are the same as the beneficial effects of the first aspect, which can be seen in the above description of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0018] The above and / or additional aspects and advantages of the present application will become apparent and be readily appreciated from the following description, including the references to the figures, in which: Figure 1 is a flowchart of a method for performing a test based on a test step provided by the present application; Figure 2 is a structural schematic diagram of a system for performing a test based on a test step provided by the present application; Figure 3 is a structural schematic diagram of an embodiment of an electronic device provided by the present application. DETAILED DESCRIPTION

[0019] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, in which the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as a limitation of the present application.

[0020] In the description of the present application, if there is a description of first, second, etc., it is only for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features or the order of indicated technical features.

[0021] In the description of the present application, it should be understood that the orientation description, such as the orientation or position relationship indicated by up, down, etc., is based on the orientation or position relationship shown in the drawings, and is only for the convenience of describing the present application and simplifying the description, and is not intended to indicate or imply that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation of the present application.

[0022] In the description of the present application, it should be noted that, unless otherwise explicitly limited, the words such as setting, installing, connecting, etc. should be broadly understood, and those skilled in the art can reasonably determine the specific meaning of the above words in the present application in combination with the specific content of the technical solution.

[0023] In the field of software testing technology, designer unit testing is a key link to ensure the effectiveness of software functions. After the designer completes the unit testing, a test step document containing test logic, input and output requirements, and execution conditions will be generated. However, the automatic test software can only recognize data in a specific format, so the key information in the test step document needs to be extracted and converted into a data file that meets the format requirements of the automatic test software. This process is the core link between designer unit testing and automatic test execution.

[0024] However, the existing technology has long relied on manual operation, requiring staff to master both test step analysis logic and automatic test software format specifications. This not only takes a long time to process, is prone to information omission or conversion errors, and is difficult to meet the efficiency requirements of software testing, but also lacks a unified processing standard, resulting in low test efficiency and accuracy of software testing.

[0025] Therefore, the embodiments of the present application provide a method, system, device and medium for executing tests based on test steps, aiming to convert non-standardized test steps into standardized executable data and execute tests, and realize the automation of test step analysis, format conversion and test execution.

[0026] The method, system, device and medium for executing tests based on test steps provided by the embodiments of the present application are specifically explained by the following embodiments. First, the method for executing tests based on test steps in the embodiments of the present application is described.

[0027] To this end, with reference to Figure 1 The embodiments of the present application provide a method for executing tests based on test steps. The method is applied to a central controller, which can be a server, an electronic device, a mobile terminal, etc., and is not limited here. The method includes the following steps S110 to S150.

[0028] Step S110, in response to the test requirements of the initial test content, extracting initial test parameters and initial test execution logic from the initial test content; Step S120, based on the mapping table, matching the standard parameter expression format corresponding to the parameter expression format in the initial test parameters, and matching the standard execution logic expression format corresponding to the execution logic expression format in the initial test execution logic; the mapping table includes a first sub-mapping table and a second sub-mapping table, the first sub-mapping table includes the mapping relationship between the multiple parameter expression formats and the standard parameter expression format, and the second sub-mapping table includes the mapping relationship between the multiple execution logic expression formats and the standard execution logic expression format; Step S130: According to the standard parameter expression format, convert the initial test parameters into the corresponding target test parameters, and according to the standard execution logic expression format, convert the initial test execution logic into the corresponding target test execution logic. Step S140: Generate a target structured test table based on the target test parameters and the target test execution logic; Step S150: Send the target structured test form to the target test interface so that the target test interface can execute the test according to the target structured test form and obtain the target test result.

[0029] In this step, the initial test content is the test procedure document generated after the user completes the unit test. The test procedure document can be in at least one of the following formats: text, document, and table. The test procedure document contains the test execution logic, test parameter requirements, and test execution conditions.

[0030] In this step, we first respond to the testing requirements of the initial test content, and then extract the initial test parameters and initial test execution logic from the initial test content. The initial test content is the test procedure document generated by the user (e.g., a designer) after completing the unit tests. The document format includes at least one of the following: text format (.txt), document format (.docx), and table format (.xlsx). The document contains test logic, input / output requirements, and execution conditions.

[0031] Furthermore, initial test parameters and initial test execution logic are extracted from the initial test content. The initial test parameters include at least initial test input parameters (such as "accelerator pedal signal" and "brake pedal power") and initial test output parameters (such as "wheel speed pulse" and "ambient temperature").

[0032] Specifically, the initial test content is first semantically parsed. Preferably, a semantic understanding component (such as a large language model) is used to identify text fragments representing parameters (such as "gear position = 6") and text fragments representing execution logic (such as "execute branch steps if not empty") in the initial test content, thus obtaining parameter description text and logic description text. Then, the parameter description text and logic description text are preprocessed to obtain the initial test parameters and initial test execution logic. The preprocessing includes at least deduplication (removing duplicate parameter descriptions) and classification processing (classifying "accelerator pedal signal = 0" and "accelerator pedal input value 0" into the same type of parameter description).

[0033] Further, based on the mapping table, a standard parameter expression format corresponding to a parameter expression format in the initial test parameter is matched, and a standard execution logic expression format corresponding to an execution logic expression format in the initial test execution logic is matched. The mapping table includes a first sub-mapping table and a second sub-mapping table. The first sub-mapping table includes mapping relationships between a plurality of parameter expression formats and a standard parameter expression format. The second sub-mapping table includes mapping relationships between a plurality of execution logic expression formats and a standard execution logic expression format.

[0034] Specifically, the mapping table is a preset standardized mapping configuration file (such as a table form) and includes the first sub-mapping table and the second sub-mapping table. The first sub-mapping table includes mapping relationships between a plurality of parameter expression formats (such as “caliper state EPB switch = 0” and “EPB switch state is 0”) and a standard parameter expression format. The standard parameter expression format is an expression format of a test parameter recognizable by a target test interface (such as “caliper state EPB switch: 0”). The second sub-mapping table includes mapping relationships between a plurality of execution logic expression formats (such as “loop execution test step” and “repeat this link”) and a standard execution logic expression format. The standard execution logic expression format is an execution logic expression format recognizable by the target test interface (such as “loop execution: times = 5”).

[0035] Further, according to the standard parameter expression format matched by the initial test parameter and the standard execution logic expression format matched by the initial test execution logic, the initial test parameter is converted into a corresponding target test parameter, and the initial test execution logic is converted into a corresponding target test execution logic.

[0036] Specifically, first, the initial test parameter (such as “caliper state EPB switch = 0”) is converted according to the standard parameter expression format matched by the initial test parameter in the mapping table to obtain a target test parameter (such as “caliper state EPB switch: 0”). Then, the initial test execution logic (such as “loop execution test step”) is converted according to the standard execution logic expression format matched by the initial test execution logic in the mapping table to obtain a target test execution logic (such as “loop execution rule: times = 3, interval = 1s”). The initial test parameter can include a signal parameter and a power parameter of a test object. The initial test execution logic can include a loop execution rule, a conditional branching rule, and a sequential execution rule of a test step.

[0037] Further, according to the target test parameter and the target test execution logic, a target structured test table is generated. Specifically, first, the target test parameter and the target test execution logic are traversed. Based on a preset irrelevant content identifier (such as “ENV preview”, “function description”, and “document annotation”), irrelevant content is identified and removed to obtain first test parameters and first test execution logics.

[0038] Further, based on the test flow sequence of the initial test content (such as “caliper state detection → accelerator pedal signal input → gear shifting test → wheel speed fault simulation”), the first test parameters and the first test execution logic are associated and integrated in the field order (such as “parameter name → parameter value → execution logic → execution condition”) preset by the mapping table to form a structured data matrix.

[0039] Further, the format conversion component is called to convert the structured data matrix into table format data (such as.xlsx format) to obtain a target structured test table, wherein the table format data is in a format that can be directly read by the target test interface.

[0040] Further, the target structured test table is sent to the target test interface to perform testing according to the target structured test table through the target test interface to obtain a target test result. Before execution, it further includes first counting the number of test steps (such as 4 test links) in the initial test content and the number of test step rows (such as 4 rows of data) in the target structured test table, and then performing integrity checking on the target structured test table according to the number of test steps and the number of test steps to obtain a checking result.

[0041] Specifically, if the checking result is “consistent in number”, the step of “sending the target structured test table to the target test interface to perform testing according to the target structured test table through the target test interface to obtain a target test result” is executed, and the target structured test table is executed through the target test interface to generate a target test result (such as the execution status of each test link, parameter feedback value), and if the checking result is “inconsistent in number”, a preset abnormal operation (such as triggering a retry mechanism to re-execute the method step of performing testing based on the test steps) is executed and an abnormal prompt (such as “test step missing, please check the initial test content or mapping relationship”) is output.

[0042] Further, based on the mapping table, the initial test parameters and the initial test execution logic are format checked to determine whether the initial test parameters match the standard parameter expression format in the mapping table and whether the initial test execution logic matches the standard execution logic expression format in the mapping table; if not, a preset prompt information (such as “there is an unrecognized parameter format, please supplement the mapping relationship”) is output and the current test execution process is terminated.

[0043] In an embodiment, by building an automated workflow based on a large language model, the method steps for performing tests based on test steps are implemented in combination with programming code, and the overall process is divided into four links: "input module-parsing module-format conversion module-output module". Among them, the overall architecture of the workflow is the core logic of the workflow with "start-input / output interface-test step parsing-format conversion-condition branching-output". The functions and configurations of each link are as follows: The start module is used to trigger the start of the workflow, and when the designer completes the unit test and submits the test step document, the workflow can be triggered; the input / output interface module is used to define the input and output of the workflow, wherein the input is the test step document uploaded by the designer (supports.txt,.docx,.xlsx formats) and the model interface information table; the output is the test data file executable by the automated test software.

[0044] The test step parsing module is used to call the "qwen3-32BCHAT" large model component in the large language model to perform semantic analysis on the test step document and extract key information. Specifically, the extraction of key information includes input parameters of test links (such as "accelerator pedal signal", "brake pedal power supply"), output parameters (such as "wheel speed pulse", "environmental temperature"), and execution logic (such as "loop execution test step", "conditional branching of not empty reply"). At the same time, the code uses try-except statements to process test step documents of different formats (such as skipping comment lines for text documents and directly reading data columns for table documents), ensuring that multiple input formats can be normally parsed.

[0045] Further, in combination with the rule engine component, the parsed results are standardized to achieve a "large model + rule engine" dual driving mode, with the large model responsible for semantic understanding (such as identifying "lower power self-clamping IBC_AVH" as a parameter name), and the rule engine preset parameter mapping table (such as mapping "accelerator pedal signal" to "accelerator pedal" field in the table), avoiding ambiguity in large model parsing.

[0046] For example, the description of "caliper state EPB switch is 0" in the test step is mapped to the unified parameter name "caliper state_EPB switch" and the value "0".

[0047] Further, the format conversion module is used for reading data and implementing data structuring; preferably, data reading is performed by the os.listdir() function to traverse the test step document under the input path, excluding non-data text lines (such as document annotations), and the np.loadtxt() function is used to read valid test data; data structuring is performed by mapping the parsed test step data to the fields (such as “caliper state”, “gear”, “IBC_AVH”) of the automation software format, and the np.hstack() function is used to realize column splicing of multi-source data to form a structured data matrix.

[0048] The format output module is used to call the “MARKDOWN to XLSX” component of the large language model to convert the structured data into a table format recognizable by the test interface end, so as to ensure that the automation test software can recognize.

[0049] Further, after format conversion, a verification link is added to the workflow to compare the number of parsed test steps with the number of rows in the converted table. If there is a difference (such as 10 sets of steps are parsed but only 9 rows of data are converted), a retry mechanism is triggered to re-execute the parsing and conversion steps to ensure data integrity.

[0050] In an embodiment, a designer completes unit testing of a car braking system, generates a test step document, and includes “caliper state detection-accelerator pedal signal input-gear shifting test-wheel speed fault simulation” four links, which need to be converted into a format recognizable by the automation test software. The specific implementation of this embodiment is based on the method steps of testing the test steps as follows: First, the designer uploads the test step document to the platform of the large language model and clicks “start workflow”. The input and output interface module reads the document and passes it to the test step parsing module. Then, the qwen3-32BCHAT large model parses the document and extracts parameters such as “caliper state EPB switch = 0”, “accelerator pedal = 0”, “gear = 6”, and “wheel speed fault = 0”. The rule engine is used to standardize the parameters into formats such as “caliper state EPB switch: 0” and “accelerator pedal: 0”.

[0051] Further, the format conversion module calls the code to read the parsed parameter data, skips the annotation lines (such as “ENV preview” and “function description”) in the document using the np.loadtxt() function, and then matches the parameters with the table fields of the signal interface, splices them into structured data using the np.hstack() function, and converts them into.xlsx format. Finally, the automation test software reads the.xlsx file, recognizes the parameters in the table, executes the corresponding test steps, and completes the braking system test.

[0052] In some embodiments, the initial test parameters and the initial test execution logic are extracted from the initial test content in step S110, including steps S210 to S220 as follows: Step S210, performing semantic parsing on the initial test content to obtain parameter description text and logic description text in the initial test content; Step S220, preprocessing the parameter description text and the logic description text to obtain the initial test parameters and the initial test execution logic, the preprocessing at least including deduplication and classification processing.

[0053] In the present embodiment, since the initial test content can be any form of test content, when the initial test content is a standardized test document, it can be directly parsed into two types of distinguishable key description texts; and when the initial test content is a non-standardized test document, it needs to be converted into two types of distinguishable key description texts through the natural language processing capability of a large language model.

[0054] Specifically, the initial test content is subjected to semantic understanding by section, and the parameter description text and the logic description text are separated from the document through preset recognition rules (for example, a description containing a "parameter name + numerical value" feature is determined to be parameter-related, and a description containing keywords such as "execution", "loop", "branch", etc. is determined to be logic-related), thereby establishing a structured basis for subsequent processing.

[0055] Further, the two types of description texts obtained through semantic parsing are optimized through deduplication and classification processing to eliminate redundant information, unify expression differences, and ensure that the extracted initial test parameters and execution logic are consistent, thereby providing high-quality input for subsequent standardized conversion. The deduplication processing mainly eliminates repeatedly appearing description contents, for example, when "accelerator pedal = 0" is repeatedly mentioned in the test document, only 1 piece is retained after deduplication, avoiding data redundancy in subsequent conversion; the classification processing classifies descriptions with different expressions but the same meaning into the same category, thereby reducing the complexity of subsequent standardized conversion.

[0056] In some embodiments, after the initial test parameters and the initial test execution logic are extracted from the initial test content in step S10, steps S310 to S320 are further included as follows: Step S310, based on the mapping table, performing format checking on the initial test parameters and the initial test execution logic to obtain a format checking result; Step S320, if the format checking result is that the initial test parameters are not matched to the standard parameter expression format in the mapping table, or the initial test execution logic is not matched to the standard execution logic expression format in the mapping table, outputting a preset prompt information and terminating the current test execution process.

[0057] In the embodiment, the extracted initial test parameters and initial test execution logic are respectively matched and verified with the standard parameter expression format in the mapping table and the standard execution logic expression format in the mapping table. The mapping table is a preset mapping reference, and the standard parameter expression format (such as “caliper state EPB switch = 0”, “accelerator pedal = 0”, etc.) and the standard execution logic expression format (such as “test step loop execution”, “sequential link execution”, etc.) executable by the target test interface are defined in advance. In the verification process, the initial test parameters and the standard parameter expression format are compared one by one in terms of the format characteristics (such as parameter name expression and value type), and the initial test execution logic and the standard execution logic expression format are compared in terms of the expression mode (such as whether to contain the key logic words “loop” and “sequence”), and finally the format verification result of “matching success” or “matching failure” is generated.

[0058] When the format verification result shows that the initial test parameters do not match the standard parameter expression format or the initial test execution logic does not match the standard execution logic expression format, a preset prompt information (such as “there is an unrecognized parameter format, please supplement the candidate mapping relationship in the test interface information” or “the execution logic expression is not standardized, please check the initial test content”) is output, and the current test execution process is terminated, so as to intercept the unrecognizable parameters or logic in advance, avoid invalid output (such as generating a table that cannot be recognized by the automatic test interface) caused by entering the subsequent conversion link, and reduce the rework cost. Moreover, the prompt information directly points to the specific mismatch type (parameter or logic), which reduces the difficulty of user troubleshooting.

[0059] In some embodiments, in step S130, the initial test parameters are converted into corresponding target test parameters according to the standard parameter expression format, and the initial test execution logic is converted into corresponding target test execution logic according to the standard execution logic expression format, including the following steps S410 to S420: Step S410, based on the first sub-mapping table, the matched parameter expression format in the initial test parameters is converted into the corresponding standard parameter expression format, and the target test parameters are obtained. The initial test parameters include signal parameters, power parameters and state parameters of the test object; Step S420, based on the second sub-mapping table, the matched execution logic expression format in the initial test execution logic is converted into the corresponding standard execution logic expression format, and the target test execution logic is obtained. The initial test execution logic includes the loop execution rule, the condition branching rule and the sequential execution rule of the test step.

[0060] In the embodiment, the mapping relationship of each sub-mapping table in the mapping table is used to realize the unification of the parameter expression. The mapping table is a pre-defined reference configuration (e.g., in the form of a table), and the sub-mapping table explicitly records the mapping relationship between the multiple parameter expression formats that different designers can use and the standard parameter expression format, and the mapping relationship between the multiple execution logic expression formats that different designers can use and the standard execution logic expression format.

[0061] Specifically, in the conversion process, the initial test parameters (e.g., "caliper state EPB switch = 0" and "accelerator pedal = 0" in the test of the automobile braking system) extracted in the early stage are compared with the multiple parameter expression formats in the first sub-mapping table. After the matching item is found, the initial test parameters are converted according to the standard parameter expression format corresponding to the matching item, and the target test parameters are obtained. The initial test parameters include the signal parameters and power parameters of the test object (e.g., "wheel speed pulse signal", "accelerator pedal signal", "brake pedal power supply", and "sensor power supply voltage"), so that after the mapping conversion, the target test interface can accurately identify the parameter type and value meaning, and avoid parameter misreading caused by expression differences.

[0062] Further, the initial test execution logic mainly includes "test step loop execution rules" and "conditional branch execution rules", for example, the designer can describe "loop execution test step 3 times" and "execute branch A if not empty", which belong to the candidate execution logic. Then, in the conversion process, the core meaning of the initial test execution logic (e.g., "repeat execution of this link" is essentially a loop logic) is identified, the corresponding standard execution logic expression format is matched based on the mapping relationship between the multiple execution logic expression formats and the standard execution logic expression format, and then the initial test execution logic is converted into the standard execution logic expression format of specific rules (number of times, condition, execution order), to obtain the target test execution logic (e.g., "loop execution rule: number of times = 3, interval = 1s" and "conditional branch rule: if parameter ≠ empty, execute branch A"), so that the automatic test software can accurately identify the execution flow and avoid logic execution errors caused by human understanding bias.

[0063] In some embodiments, in step S140, the target structured test table is generated according to the target test parameters and the target test execution logic, including the following steps S510 to S530: Step S510, the target test parameters and the target test execution logic are traversed to eliminate irrelevant contents in the target test parameters and the target test execution logic, to obtain first test parameters and first test execution logic, and the irrelevant contents are identified and determined based on a pre-set irrelevant content identifier; Step S520, the first test parameters and the first test execution logic are associated and integrated based on the initial test content to form a structured data matrix. Step S530, calling a format conversion component to convert the structured data matrix into table format data to obtain a target structured test table, and the table format data is in a format that can be directly read by the target test interface.

[0064] In this embodiment, since the test step document generated by the designer often contains auxiliary content (such as “ENV preview”, “function description”, “document annotation”, etc.) irrelevant to test execution, these contents are not the core data required by automated testing. This embodiment automatically identifies and removes the contents containing the identifiers by presetting irrelevant content identifiers (such as the keywords “ENV preview”, “function description”, etc.), traversing the target test parameters and the target test execution logic, and finally obtaining pure first test parameters (only retaining standardized parameters related to testing) and first test execution logic (only retaining standardized logic related to execution), ensuring that the subsequent integration is all valid test data, thereby improving the data quality and avoiding table redundancy or execution errors caused by irrelevant information.

[0065] Further, based on the original flow order of the initial test content (such as “caliper state detection→accelerator pedal signal input→gear shifting test→wheel speed fault simulation” of the automobile braking system test), the first test parameters and the first test execution logic are associated and matched according to a preset field order (such as “test link→standardized parameter→standardized execution logic→execution condition”), and a structured data matrix similar to a table row / column structure is formed by splicing multiple source data, ensuring that the parameters and the logic correspond one by one according to the test flow, and providing an ordered structured basis for subsequent format conversion.

[0066] Further, a format conversion component is called to convert the structured data matrix into table format data (such as.xlsx format) to generate a target structured test table, realizing seamless connection from “standardized data” to “executable table”. The table format strictly matches the reading specifications of the target test interface (such as field column name, data type, arrangement order), for example, the “parameter value” column in the table is all numerical, and the “execution logic” column is all preset structured expressions (such as “loop times = 1”). Finally, not only the accuracy and order of the data are ensured, but also the table generation efficiency is greatly improved through automated format conversion, and at the same time, since the format strictly matches the target interface, the recognition success rate of the automated test software is significantly improved.

[0067] In some embodiments, before the target structured test table is sent to the target test interface in step S150 to execute the test according to the target structured test table through the target test interface to obtain a target test result, the following steps S610 to S630 are further included: Step S610, respectively, the number of test steps in the initial test content and the number of test step rows in the target structured test table are counted. Step S620, according to the number of test steps and the number of test steps, the integrity of the target structured test table is checked, and the checking result is obtained. Step S630, in the case that the checking result is that the number of test steps and the number of test steps are inconsistent, a preset abnormal operation is performed and an abnormal prompt is output.

[0068] In this embodiment, two core data are counted respectively: one is the number of test steps in the initial test content (i.e. the total number of test links in the designer document, such as "caliper state detection, accelerator pedal signal input, gear shifting test, wheel speed fault simulation" in the automobile braking system test, a total of 4 steps); The second is the number of test step rows in the target structured test table (each row in the table corresponds to a test step, and the number of rows should be consistent with the number of original steps when the conversion is complete), the number of test step rows can be determined by reading the valid rows of the table data, to ensure that the statistical result accurately reflects the number of steps actually contained in the table.

[0069] Further, by comparing the two numbers counted, it is judged whether the converted table completely covers all steps in the original test content. If the number of initial test steps is equal to the number of table test step rows, it means that the conversion process does not lose steps, and the checking result is "complete"; if the numbers are not equal (such as the original number of steps is 4 and the number of table rows is 3), it means that there are steps missing or redundant, and the checking result is "incomplete", which ensures that the test coverage is consistent with the original design.

[0070] Specifically, when the checking result is "consistent in number", it is confirmed that the target structured test table is complete and valid, and the process is allowed to continue to execute, that is, the table data is read through the target test interface, each test step is executed in order, and finally the target test result (such as the execution state of each link, parameter feedback value) is generated, which ensures that only a complete test table will be executed, which guarantees the comprehensiveness of the test from the process and avoids the distortion of the test conclusion caused by the incomplete table.

[0071] Further, when the check result is "quantity inconsistency", an abnormal processing mechanism is triggered to quickly locate the problem. According to the uploaded file, the preset abnormal operation includes triggering a retry mechanism (re-executing the process from "extracting initial parameters / logic" to "generating target table", trying to repair the missing step problem) and recording abnormal information (such as recording the initial test content identifier, the original step quantity, the table row number, etc., for easy tracing), while outputting an abnormal prompt (such as "test step quantity and table row number are inconsistent, there may be step omission, please check the conversion process"), guiding the staff to troubleshoot the problem (such as whether the initial test content has a fuzzy description leading to parsing omission, or whether the test interface information mapping relationship is incomplete), so as to advance the problem discovery node to "before test execution", greatly shorten the problem troubleshooting cycle, reduce invalid test cost, reduce the problem solving threshold, and ensure the consistency of the test process from design to execution.

[0072] As shown in Figure 2 some embodiments of the present application, a system for testing based on test steps is provided, the system comprising an extraction module 210, a matching module 220, a conversion module 230, a generation module 240, and an execution module 250, specifically: The extraction module 210 is configured to extract initial test parameters and initial test execution logic from the initial test content in response to the test requirements of the initial test content. The matching module 220 is configured to match a standard parameter expression format corresponding to a parameter expression format in the initial test parameters and a standard execution logic expression format corresponding to an execution logic expression format in the initial test execution logic based on a mapping table; the mapping table comprises a first sub-mapping table and a second sub-mapping table, the first sub-mapping table comprises mapping relationships between a plurality of parameter expression formats and a standard parameter expression format, and the second sub-mapping table comprises mapping relationships between a plurality of execution logic expression formats and a standard execution logic expression format. The conversion module 230 is configured to convert the initial test parameters into corresponding target test parameters according to the standard parameter expression format, and convert the initial test execution logic into corresponding target test execution logic according to the standard execution logic expression format. The generation module 240 is configured to generate a target structured test table according to the target test parameters and the target test execution logic. The execution module 250 is configured to send the target structured test table to a target test interface, so as to execute the test according to the target structured test table through the target test interface, and obtain a target test result.

[0073] It should be noted that the system for performing a test based on a test step provided in the embodiment and the method for performing a test based on a test step described above are based on the same inventive concept, and thus the related content of the method for performing a test based on a test step described above is also applicable to the content of the system for performing a test based on a test step, and thus, details are not repeated here.

[0074] To this end, the system extracts initial test parameters and initial test execution logic from initial test content; matches a standard parameter expression format corresponding to a parameter expression format in the initial test parameters and a standard execution logic expression format corresponding to an execution logic expression format in the initial test execution logic based on a mapping table; converts the initial test parameters into corresponding target test parameters according to the standard parameter expression format, and converts the initial test execution logic into corresponding target test execution logic according to the standard execution logic expression format; and generates a target structured test table according to the target test parameters and the target test execution logic, to send to a target test interface, and performs a test according to the target structured test table through the target test interface to obtain a target test result. In this way, the conversion from a test step to a standardized executable test can be completed and the test can be performed, and the automation of test step analysis, format conversion, and test execution is realized.

[0075] As Figure 3 The embodiment of the present application further provides an electronic device, and the electronic device comprises: at least one memory; at least one processor; at least one program; The program is stored in the memory, and the processor executes the at least one program to implement the method for performing a test based on a test step provided in the embodiment.

[0076] The electronic device can be any intelligent terminal, such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a vehicle-mounted computer, etc.

[0077] The electronic device provided in the embodiment of the present application is described in detail below.

[0078] The processor 1600 can be implemented in a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute a related program to implement the technical solutions provided in the embodiments of the present application. The memory 1700 can be implemented in the form of a Read Only Memory (ROM), a static storage device, a dynamic storage device, or a Random Access Memory (RAM), etc. The memory 1700 can store an operating system and other application programs. When the technical solutions provided by the embodiments of the present specification are implemented by software or firmware, the program codes are stored in the memory 1700 and are called and executed by the processor 1600 to perform a method for performing testing based on test steps.

[0079] The input / output interface 1800 is configured to realize information input and output. The communication interface 1900 is configured to realize the communication interaction between the device and other devices. The communication can be realized by a wired manner (for example, a USB, a network cable, etc.) or a wireless manner (for example, a mobile network, WIFI, Bluetooth, etc.). The bus 2000 is configured to transmit information between various components (for example, the processor 1600, the memory 1700, the input / output interface 1800, and the communication interface 1900) of the device. The processor 1600, the memory 1700, the input / output interface 1800, and the communication interface 1900 are connected to each other through the bus 2000 to realize the communication connection between the devices.

[0080] The embodiments of the present application also provide a storage medium, which is a computer readable storage medium, and stores computer executable instructions. The computer executable instructions are used to make a computer execute the above-mentioned method for performing testing based on test steps.

[0081] The memory is a non-transitory computer readable storage medium, which can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory can include a high-speed random access memory and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include a memory remotely arranged relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0082] The embodiments described in the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

[0083] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation to the embodiments of the present application, and can include more or fewer steps than shown in the figures, or combine certain steps, or different steps.

[0084] The apparatus embodiments described above are merely illustrative, and units described as separate components can or can not be physically separate, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments.

[0085] Those skilled in the art can understand that all or some of the steps in the above disclosed method, the function modules / units in the system and the device can be implemented as software, firmware, hardware and their appropriate combinations.

[0086] The terms "first", "second", "third", "fourth" and the like used in the description of the application and the above-described drawings (if any) are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0087] It should be understood that in the present application, "at least one" means one or more, and "multiple" means two or more. "And / or" is used to describe the association between the associated objects, which means that there can be three relationships, for example, "A and / or B" can mean that there are three cases of only A, only B and A and B at the same time, where A and B can be singular or plural. The character " / " generally represents that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c can mean a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0088] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented by other manners. For example, the apparatus embodiments described above are merely illustrative, for example, the division of units is merely a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, apparatuses or units, and can be electrical, mechanical or other forms.

[0089] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place or can be distributed to a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0090] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0091] If the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part of the prior art that contributes to the technical solutions or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions for causing an electronic device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program storage media.

[0092] The above is a specific description of the preferred implementation of the embodiments of the present application, but the embodiments of the present application are not limited to the above implementation. Those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the embodiments of the present application, and these equivalent modifications or replacements are all included in the scope defined by the claims of the embodiments of the present application.

Claims

1. A method for performing tests based on test steps, characterized in that, The method includes: In response to the testing requirements of the initial test content, initial test parameters and initial test execution logic are extracted from the initial test content; Based on the mapping table, a standard parameter expression format corresponding to the parameter expression format in the initial test parameters is matched, and a standard execution logic expression format corresponding to the execution logic expression format in the initial test execution logic is matched; the mapping table includes a first sub-mapping table and a second sub-mapping table, the first sub-mapping table includes the mapping relationship between various parameter expression formats and standard parameter expression formats, and the second sub-mapping table includes the mapping relationship between various execution logic expression formats and standard execution logic expression formats; According to the standard parameter expression format, the initial test parameters are converted into corresponding target test parameters, and according to the standard execution logic expression format, the initial test execution logic is converted into corresponding target test execution logic. Based on the target test parameters and the target test execution logic, a target structured test table is generated; The target structured test form is sent to the target test interface so that the test is performed according to the target structured test form through the target test interface to obtain the target test result.

2. The method for performing tests based on test steps according to claim 1, characterized in that, The extraction of initial test parameters and initial test execution logic from the initial test content includes: The initial test content is semantically parsed to obtain the parameter description text and logical description text in the initial test content; The parameter description text and the logic description text are preprocessed to obtain the initial test parameters and the initial test execution logic. The preprocessing includes at least deduplication and classification.

3. The method for performing tests based on test steps according to claim 2, characterized in that, After extracting the initial test parameters and initial test execution logic from the initial test content, the method further includes: Based on the mapping table, the initial test parameters and initial test execution logic are format-validated to obtain the format validation result; If the format verification result indicates that the initial test parameters do not match the standard parameter expression format in the mapping table, or the initial test execution logic does not match the standard execution logic expression format in the mapping table, then a preset prompt message will be output and the current test execution process will be terminated.

4. The method for performing tests based on test steps according to claim 1, characterized in that, The step of converting the initial test parameters into corresponding target test parameters according to the standard parameter expression format, and converting the initial test execution logic into corresponding target test execution logic according to the standard execution logic expression format, includes: Based on the first sub-mapping table, the parameter expression format matched in the initial test parameters is converted into the corresponding standard parameter expression format to obtain the target test parameters. The initial test parameters include the signal parameters, power parameters and state parameters of the test object. Based on the second sub-mapping table, the execution logic expression format matched in the initial test execution logic is converted into the corresponding standard execution logic expression format to obtain the target test execution logic. The initial test execution logic includes the loop execution rules, conditional branch rules, and sequential execution rules of the test steps.

5. The method for performing tests based on test steps according to claim 1, characterized in that, The step of generating a target structured test table based on the target test parameters and the target test execution logic includes: The target test parameters and the target test execution logic are traversed to remove irrelevant content from the target test parameters and the target test execution logic to obtain the first test parameters and the first test execution logic. The irrelevant content is identified and determined based on a preset irrelevant content identifier. Based on the initial test content, the first test parameters and the first test execution logic are associated and integrated to form a structured data matrix; The format conversion component is invoked to convert the structured data matrix into tabular data, resulting in the target structured test table. The tabular data is in a format that the target test interface can directly read.

6. The method for performing tests based on test steps according to claim 1, characterized in that, Before sending the target structured test table to the target test interface to execute tests based on the target structured test table and obtain the target test results, the method further includes: Count the number of test steps in the initial test content and the number of test step rows in the target structured test table, respectively; Based on the number of test steps and the number of rows in the test steps, the target structured test table is subjected to integrity verification to obtain the verification result. If the verification result shows that the number of test steps is inconsistent with the number of test step rows, a preset abnormal operation is performed and an abnormal prompt is output.

7. The method for performing tests based on test steps according to claim 1, characterized in that, The initial test content is a test step document generated after the user completes the unit test. The test step document includes at least one of the following formats: text format, document format, and table format. The test step document contains test execution logic, test parameter requirements, and test execution conditions.

8. A system for performing tests based on test steps, characterized in that, The system includes: The extraction module is used to extract initial test parameters and initial test execution logic from the initial test content in response to the test requirements of the initial test content. The matching module is used to match, based on the mapping table, a standard parameter expression format corresponding to the parameter expression format in the initial test parameters, and a standard execution logic expression format corresponding to the execution logic expression format in the initial test execution logic; the mapping table includes a first sub-mapping table and a second sub-mapping table, the first sub-mapping table including the mapping relationship between various parameter expression formats and standard parameter expression formats, and the second sub-mapping table including the mapping relationship between various execution logic expression formats and standard execution logic expression formats; The conversion module is used to convert the initial test parameters into corresponding target test parameters according to the standard parameter expression format, and to convert the initial test execution logic into corresponding target test execution logic according to the standard execution logic expression format. The generation module is used to generate a target structured test table based on the target test parameters and the target test execution logic. The execution module is used to send the target structured test form to the target test interface, so that the target test interface can perform tests according to the target structured test form and obtain the target test results.

9. An electronic device, characterized in that, It includes at least one control processor and a memory for communicatively connecting to the at least one control processor; the memory stores instructions executable by the at least one control processor to enable the at least one control processor to perform a method for performing tests based on test steps as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform a method for performing a test based on test steps as described in any one of claims 1 to 7.