Intelligent parsing and execution system of unstructured test instructions
Patent Information
- Application Number
- CN202611130268.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-28
- Publication Date
- 2026-10-16
AI Technical Summary
[0005]因此,本发明提供了一种非结构化测试指令的智能解析与执行系统解决语义解析缺乏多路径建模及解析准确性低与执行可靠性差的问题
[0040]The beneficial effects of this invention are as follows: By performing multi-path semantic interpretation modeling on the set of semantic anchor points and combining path constraint verification and parsing credibility calculation, a set of parsing branches is generated, realizing multi-path expansion and quantifiable filtering of semantic ambiguity in unstructured test instructions, and improving the reliability of mapping test instructions to execution actions; at the same time, by performing semantic execution consistency judgment on the execution evidence sequence and performing semantic reverse correction processing based on the deviation positioning sequence and deviation type labeling sequence, the semantic anchor points are traced back from the execution result and classified correction and parsing branch reconstruction are performed, so that the execution process forms a closed-loop mechanism of "parsing-execution-feedback-correction", effectively suppressing error propagation, improving the adaptive correction capability of the execution path and the overall accuracy of test execution.
Smart Images

Figure CN122927261A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software test automation technology, and in particular to an intelligent parsing and execution system for unstructured test instructions. Background Technology
[0002] As software complexity continues to increase and the demand for automated testing continues to grow, the way test cases are constructed and executed is gradually evolving from structured script-driven to natural language description-driven. In the early stages, test execution typically relied on strictly formatted scripting languages or predefined instruction sets, using fixed syntax rules to parse and execute test steps. In recent years, with the development of natural language processing and intelligent testing technologies, the automatic parsing and execution of unstructured test instructions has gradually become a research hotspot. Related technologies perform semantic parsing on natural language test descriptions, transforming them into executable operation sequences, thereby lowering the barrier to test writing and improving testing efficiency. Common technical paths in this process mainly include rule-matching-based semantic parsing methods, template mapping-based instruction conversion methods, and semantic understanding methods combined with machine learning.
[0003] However, existing technologies still have significant shortcomings in practical applications. Most solutions typically generate only a single semantic interpretation result or rely on fixed priority rules for path selection during the parsing phase, lacking multi-path modeling and constraint verification mechanisms for semantic ambiguity. This leads to deviations in parsing results when there are unclear references, complex conditions, or semantic ambiguity, which in turn affects the accuracy of subsequent execution. Existing solutions generally adopt a one-way "parsing-execution" process, lacking the ability to make reverse corrections based on execution feedback. That is, even if problems such as object mismatch, inconsistent operations, or unmet conditions are detected during execution, it is difficult to trace back to the semantic layer for correction and reconstruction, leading to error propagation and reduced overall test reliability. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides an intelligent parsing and execution system for unstructured test instructions to solve the problems of lack of multi-path modeling, low parsing accuracy, and poor execution reliability in semantic parsing.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0007] This invention provides an intelligent parsing and execution system for unstructured test instructions, comprising: an instruction reconstruction module, which acquires unstructured test instruction text and performs normalization and structural reconstruction processing to generate a standardized instruction sequence; a semantic modeling module, which extracts semantic anchors from the standardized instruction sequence to form a set of semantic anchors, performs multi-path semantic interpretation modeling processing on the set of semantic anchors to generate a set of parsing branches; a structure mapping module, which maps each parsing branch in the set of parsing branches to its corresponding execution semantic structure to form a set of candidate execution structures, extracts semantic elements from the set of candidate execution structures and performs action mapping processing to form a set of candidate action chains; a path execution module, which calculates the path priority of each candidate action chain in the set of candidate action chains, outputs an initial execution path, senses the execution status of the initial execution path and collects execution feedback information to form an execution evidence sequence; and a judgment and correction module, which performs semantic execution consistency judgment on the execution evidence sequence to form a deviation location sequence and a deviation type labeling sequence, performs semantic reverse correction processing based on the deviation location sequence and the deviation type labeling sequence, and generates a test execution report.
[0008] As a preferred embodiment of the intelligent parsing and execution system for unstructured test instructions described in this invention, the specific steps for generating the standardized instruction sequence are as follows:
[0009] Unstructured test instruction text is processed with unified encoding, whitespace character normalization, comment fragment isolation, and line break boundary recognition to form the original instruction sequence;
[0010] Identify delay markers in the original instruction sequence, remove the line start numbers, and generate a regular statement sequence;
[0011] Extract variable placeholders from regular statement sequences and split compound statements to generate standardized instruction sequences.
[0012] As a preferred embodiment of the intelligent parsing and execution system for unstructured test instructions described in this invention, the specific steps for forming the semantic anchor set are as follows:
[0013] By parsing the statement structure, the operation description fragments, target reference fragments, and modification and limitation fragments in the standardized instruction sequence are identified, and a statement structure parsing sequence is generated.
[0014] Semantic classification processing is performed on the parsed sequence of statement structure, mapping operation description fragments to action semantic anchors and target referential fragments to object semantic anchors, generating a basic semantic anchor sequence;
[0015] The modification and constraint fragments in the statement structure parsing sequence are subjected to constraint parsing processing, and the parsed constraint information is associated with the basic semantic anchor sequence to form a semantic anchor set.
[0016] As a preferred embodiment of the intelligent parsing and execution system for unstructured test instructions described in this invention, the specific steps for generating the parsing branch set are as follows:
[0017] Identify semantic ambiguities in each semantic anchor point in the semantic anchor point set and perform semantic combination to generate a candidate semantic path sequence;
[0018] Perform path constraint verification on the candidate semantic path sequence, calculate the parsing credibility of each candidate semantic path, and generate a set of parsing branches.
[0019] As a preferred embodiment of the intelligent parsing and execution system for unstructured test instructions described in this invention, the specific steps for forming a candidate execution structure set are as follows:
[0020] Perform semantic relation parsing on the parsing branch set, and parse the combination, sequence and constraint relationships between semantic anchors in each parsing branch to generate semantic relation records;
[0021] Transform the execution relationships in the semantic relationship records and perform constraint injection processing based on the constraint relationships to generate a set of candidate execution structures.
[0022] As a preferred embodiment of the intelligent parsing and execution system for unstructured test instructions described in this invention, the specific steps for forming a candidate action chain set are as follows:
[0023] Extract the operation content, object content, sequence content, and constraint content corresponding to single-step execution from the candidate execution structure set to form a semantic element sequence;
[0024] The semantic elements in the semantic element sequence are classified and chained to form a set of candidate action chains.
[0025] As a preferred embodiment of the intelligent parsing and execution system for unstructured test instructions described in this invention, the steps for outputting the initial execution path are as follows:
[0026] Read the execution order, target object, and execution conditions of each single-step action record in each candidate action chain of the candidate action chain set, and count the historical successful execution records and environment matching information of the corresponding candidate action chain to generate a path indicator sequence;
[0027] Calculate the path priority of the path indicator sequence, perform priority filtering, and output the initial execution path.
[0028] As a preferred embodiment of the intelligent parsing and execution system for unstructured test instructions described in this invention, the specific steps for forming the execution evidence sequence are as follows:
[0029] The operation type corresponding to each single-step action is called sequentially according to the execution order in the initial execution path and applied to the corresponding target object. At the same time, the execution time and execution position of each single-step action are recorded to form an action execution record.
[0030] During the execution of each single-step action, information on interface state changes, target object response information, and operation return information corresponding to the current single-step action are collected and associated with the corresponding single-step action to form a state feedback record.
[0031] The execution times of the action execution records and the status feedback records are aligned and sequentially organized to form a sequence of execution evidence.
[0032] As a preferred embodiment of the intelligent parsing and execution system for unstructured test instructions described in this invention, the specific steps for forming the deviation location sequence and the deviation type marking sequence are as follows:
[0033] Establish a step-by-step correspondence between the execution evidence sequence and the initial execution path based on the order of single-step actions, and generate an alignment record for each corresponding position;
[0034] Perform multi-dimensional consistency comparison processing on each alignment record, comparing the target object matching, operation type matching, execution order compliance, and execution condition satisfaction respectively, to form a progressively consistent record;
[0035] The alignment positions that do not meet the consistency conditions in the step-by-step consistency records are filtered out, and the corresponding single-step action positions and time positions are recorded to form a deviation localization sequence.
[0036] The deviations in the deviation location sequence are classified into object deviations, action deviations, sequence deviations and conditional deviations according to the corresponding comparison dimensions. The corresponding type identifier is written at each deviation location to form a deviation type label sequence.
[0037] As a preferred embodiment of the intelligent parsing and execution system for unstructured test instructions described in this invention, the specific steps for generating the test execution report are as follows:
[0038] Based on the single-step action sequence of each deviation position in the deviation localization sequence in the initial execution path, the corresponding execution steps and associated semantic anchor records are located to form a deviation association record;
[0039] The deviation correlation records are classified, corrected, and reconstructed using parsing branches to generate a test execution report.
[0040] The beneficial effects of this invention are as follows: By performing multi-path semantic interpretation modeling on the set of semantic anchor points and combining path constraint verification and parsing credibility calculation, a set of parsing branches is generated, realizing multi-path expansion and quantifiable filtering of semantic ambiguity in unstructured test instructions, and improving the reliability of mapping test instructions to execution actions; at the same time, by performing semantic execution consistency judgment on the execution evidence sequence and performing semantic reverse correction processing based on the deviation positioning sequence and deviation type labeling sequence, the semantic anchor points are traced back from the execution result and classified correction and parsing branch reconstruction are performed, so that the execution process forms a closed-loop mechanism of "parsing-execution-feedback-correction", effectively suppressing error propagation, improving the adaptive correction capability of the execution path and the overall accuracy of test execution. Attached Figure Description
[0041] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is a schematic diagram of an intelligent parsing and execution system for unstructured test instructions.
[0043] Figure 2 A flowchart for generating standardized instruction sequences and parsing branch sets.
[0044] Figure 3 A flowchart for forming a set of candidate action chains and a sequence of execution evidence.
[0045] Figure 4 A flowchart for generating a deviation type labeling sequence and a test execution report. Detailed Implementation
[0046] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0047] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0048] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0049] Reference Figures 1-4 As one embodiment of the present invention, this embodiment provides an intelligent parsing and execution system for unstructured test instructions, comprising the following steps:
[0050] The instruction reconstruction module acquires unstructured test instruction text and performs normalization and structural reconstruction processing to generate standardized instruction sequences.
[0051] Unstructured test instruction text is processed with unified encoding, whitespace character normalization, comment fragment isolation, and line break boundary recognition to form the original instruction sequence.
[0052] It should be noted that unstructured test instruction text includes natural language test description data entered by testers through the test management platform, historical test case text data obtained through interface calls, and operation record transcribed text data extracted through log playback. The natural language test description data includes operation instructions, target object descriptions, and condition constraint descriptions. The historical test case text data includes records of executed test steps and their corresponding execution statements. The operation record transcribed text data includes textualized step descriptions generated based on the interface operation trajectory.
[0053] Unstructured test instruction text undergoes unified encoding processing, converting text data from different data interfaces and storage environments into a unified character encoding format to eliminate character parsing differences caused by different encoding methods. The uniformly encoded text data undergoes whitespace normalization processing, identifying consecutive whitespace characters, tabs, and newlines, compressing consecutive whitespace characters into a single delimiter, while retaining newlines used to distinguish statement boundaries. Segments in the text data that conform to annotation semantic features undergo annotation fragment isolation processing, where annotation semantic features include text content starting with an annotation identifier that does not participate in semantic parsing; annotation fragments are extracted from the main text and their original positions are recorded separately. The normalized text data undergoes statement boundary recognition processing, dividing statement boundaries by detecting newlines, semicolons, and natural language connectors indicating step separations, and sorting them according to their order of appearance in the original text to form the original instruction sequence.
[0054] Identify the delay markers in the original instruction sequence, remove the line beginning numbers, and generate a regular statement sequence.
[0055] It should be noted that each statement in the original instruction sequence is processed sequentially for delay marker identification and line number stripping according to its order in the original instruction sequence. Specifically, for delay marker identification, the time expression information in each statement is parsed to identify semantic segments indicating waiting or delayed execution. The time expression information includes a time description composed of numerical values and time units, as well as a natural language description expressing the meaning of waiting. The identified delay markers are separated from the corresponding statements and their corresponding positions in the original instruction sequence are recorded. After completing the delay marker identification process, it is checked whether there is numbering information indicating the step sequence at the beginning position of each statement. If so, it is removed from the corresponding statement while maintaining the original order of each statement, thus generating a regular statement sequence.
[0056] Extract variable placeholders from regular statement sequences and split compound statements to generate standardized instruction sequences.
[0057] It should be noted that the parameter reference expressions in each statement of the regularized statement sequence are parsed to identify placeholder expressions used to represent device identifiers, account identifiers, path identifiers, port identifiers, network addresses, and other parameters to be replaced. The identified variable placeholders are separated from their corresponding statements, and the statement position and character position of the variable placeholders in the regularized statement sequence are recorded. After the variable placeholder extraction process is completed, compound statement splitting is performed on each statement in the regularized statement sequence. Multiple operation description fragments contained in a single statement and the separators used to connect different operation descriptions are identified. The separators include punctuation separators, line break separators, sequence connectors, conditional conjunctions, and parallel connectors. The statement boundaries are divided according to the position of each separator in the statement, and the single statement is split into multiple semantically complete and independently parsable statement fragments. At the same time, the original arrangement order of each statement fragment in the regularized statement sequence before and after splitting is not changed, generating a standardized instruction sequence.
[0058] The semantic modeling module extracts semantic anchors from standardized instruction sequences to form a set of semantic anchors. It then performs multi-path semantic interpretation modeling on the set of semantic anchors to generate a set of parsing branches.
[0059] By parsing the statement structure, the operation description fragments, target reference fragments, and modifier / qualification fragments in the standardized instruction sequence are identified, and a statement structure parsing sequence is generated.
[0060] It should be noted that, following the order of arrangement in the standardized instruction sequence, each statement in the standardized instruction sequence is parsed sequentially. Each statement undergoes word segmentation and syntactic segmentation to separate predicate expressions, noun references, modifying expressions, and connecting expressions. Based on the dominant position of the predicate expression in the statement, the operational description segment representing the execution behavior is identified. Based on the dominated position of noun references and noun phrases in the predicate expression, the target reference segment representing the execution object is identified. Based on the time description, condition description, scope description, parameter description, and mode description attached to the operational description segment or target reference segment, the modifying and limiting segments are identified. The sequence and associated records are then generated according to the occurrence position, attachment position, and correspondence of each segment in the original statement, thus generating the statement structure parsing sequence.
[0061] Semantic classification processing is performed on the parsed sequence of statement structure, mapping operation description fragments to action semantic anchors and target referential fragments to object semantic anchors, generating a basic semantic anchor sequence.
[0062] It should be noted that the operation description fragments and target reference fragments corresponding to each statement in the statement structure parsing sequence are read, and the predicate expressions, action modification expressions, and action scope expressions in the operation description fragments are merged to extract the core action semantics representing the execution behavior; the noun references, noun phrases, and object modification expressions in the target reference fragments are merged to extract the core object semantics representing the execution object; the core action semantics are written into the action semantic anchor position of the corresponding statement, and the core object semantics are written into the object semantic anchor position of the corresponding statement. The correspondence between the action semantic anchors and the object semantic anchors is recorded in the basic semantic anchor sequence according to the statement order to generate the basic semantic anchor sequence.
[0063] The modification and constraint fragments in the statement structure parsing sequence are subjected to constraint parsing processing, and the parsed constraint information is associated with the basic semantic anchor sequence to form a semantic anchor set.
[0064] It should be noted that the modification and constraint fragments corresponding to each statement in the statement structure parsing sequence are read, and the time description, condition description, parameter description, range description, and mode description in the modification and constraint fragments are classified and parsed to extract constraint information representing execution condition constraints, execution order constraints, parameter value constraints, scope constraints, and execution mode constraints. The constraint information in each statement is matched and associated with the action semantic anchors and object semantic anchors of the corresponding statements in the basic semantic anchor sequence, so that each constraint information is attached to the corresponding action semantic anchor or object semantic anchor. After the constraint information is attached, the association relationship between the action semantic anchor, object semantic anchor, and their corresponding constraint information is recorded according to the original arrangement order of each statement in the basic semantic anchor sequence to form a semantic anchor set.
[0065] Identify semantic ambiguities in each semantic anchor in the set of semantic anchors and perform semantic combination to generate a sequence of candidate semantic paths.
[0066] It should be noted that the process involves reading the action semantic anchors, object semantic anchors, and constraint information corresponding to each statement in the semantic anchor set, performing action expression expansion processing on the action expressions corresponding to the action semantic anchors, identifying different action expression methods based on the action description forms in the current statement and adjacent statements, and using these different action expression methods as candidate action semantics; performing reference parsing processing on the object references corresponding to the object semantic anchors, by reading object description fragments in the current statement and adjacent statements, and matching them based on the occurrence position and modification information of the object description fragments in the statements, using different reference forms that can correspond to the same object as candidate object semantics; performing constraint expansion processing on the constraint information, parsing the conditional expressions, time expressions, and parameter expressions in the constraint information, and extracting different value forms and constraint ranges as candidate constraint semantics, thereby generating action semantic candidate sets, object semantic candidate sets, and constraint semantic candidate sets respectively; and performing combination processing on the action semantic candidate sets, object semantic candidate sets, and constraint semantic candidate sets in the same statement, combining and arranging them according to the corresponding positional relationship of each semantic candidate in the statement to generate a candidate semantic path sequence.
[0067] Perform path constraint verification on the candidate semantic path sequence, calculate the parsing credibility of each candidate semantic path, and generate a set of parsing branches.
[0068] It should be noted that the process involves reading the action semantic candidates, object semantic candidates, and constraint semantic candidates selected at each statement position in the candidate semantic path sequence, and establishing a path verification record according to the order of the statements in the candidate semantic path. By reading the operation category corresponding to the action semantic candidate and the object category corresponding to the object semantic candidate, it is determined whether the operation category can be applied to the object category. Statement positions that can be applied are marked as action-object matching positions, and statement positions that cannot be applied are marked as action-object mismatch positions. The process involves reading the condition description, time description, parameter description, and range description in the constraint semantic candidate, parsing them to form the corresponding condition value range, time value range, parameter value range, and scope of application, and determining whether the object semantic candidate and the action semantic candidate fall into the corresponding value range and scope of application. Statement positions that meet the constraint requirements are marked as constraint-satisfied positions, and statement positions that do not meet the constraint requirements are marked as constraint mismatch positions.
[0069] Path connection verification is performed on adjacent statement positions in the path verification record. The object semantic candidate of the previous statement position and the action semantic candidate of the next statement position are read. It is determined whether the object output by the previous statement position can be the object input by the next statement position. The execution order descriptions in the corresponding constraint semantic candidate of the adjacent statement positions are compared to see if there are any contradictions. Adjacent statement positions that meet the connection requirements and do not have sequence contradictions are marked as valid path connection positions. Adjacent statement positions that do not meet the connection requirements or have sequence contradictions are marked as invalid path connection positions. Candidate semantic paths containing action object mismatch positions, constraint mismatch positions, or invalid path connection positions are eliminated. The resolution credibility of the retained candidate semantic paths is calculated and associated with the corresponding candidate semantic paths to generate a set of resolution branches.
[0070] The expression for calculating the reliability of the parsing is:
[0071] ;
[0072] in, Indicates the first The reliability of parsing candidate semantic paths; Indicates the first The number of statements in the candidate semantic paths; Indicates the action object matching tag, when the first... The first of the candidate semantic paths The value is 1 if the statement position matches the position of the action object, otherwise it is 0. The constraint is satisfied by the flag when the first constraint is satisfied. The first of the candidate semantic paths The value is 1 if the constraint at each statement position is satisfied, and 0 otherwise. Indicates a path connection marker, when the first... The first of the candidate semantic paths The value is 1 if the statement position is written to a valid position of the path connection, otherwise it is 0.
[0073] It should also be noted that the three weighting coefficients are determined by the proportions of action object matching, constraint satisfaction, and path connection in the historical execution results. Specifically, the proportion of statement positions that satisfy action object matching in a successfully executed path out of the total number of statement positions is used as the action object matching influence; the proportion of statement positions that satisfy constraint conditions in a successfully executed path out of the total number of statement positions is used as the constraint satisfaction influence; and the proportion of statement positions that satisfy path connection conditions in a successfully executed path out of the total number of statement positions is used as the path connection influence. The action object matching influence, constraint satisfaction influence, and path connection influence are normalized so that their sum is 1, and these are then used as the weighting coefficients. , and .
[0074] Determining whether an operation category can be applied to an object category is achieved by judging the dominance relationship between action semantic candidates and object semantic candidates in the statement structure parsing sequence. Specifically, the predicate expression corresponding to the action semantic candidate and the noun reference corresponding to the object semantic candidate are read from the statement structure parsing sequence corresponding to the current statement. When the dominance relationship of the predicate expression in the statement structure points to the noun reference, it is determined that the current operation category can be applied to the object category; otherwise, it is determined that it cannot be applied.
[0075] The condition value range is obtained by splitting the condition qualifiers and value descriptions in the condition description; the time value range is obtained by parsing the start and end time expressions or time length expressions in the time description; the parameter value range is obtained by extracting the numerical expressions and range-limiting expressions in the parameter description; and the scope of application is obtained by parsing the object-limiting expressions in the range description.
[0076] During the constraint satisfaction determination process, the parameter semantic content representing object attributes in the object semantic candidate and the time semantic content representing execution timing in the action semantic candidate are read. The parameter values corresponding to the object semantic candidate are compared with the parameter value range. If the parameter value falls within the parameter value range, it is determined that the parameter is satisfied; otherwise, it is determined that the parameter is not satisfied. The execution time corresponding to the action semantic candidate is compared with the time value range. If the execution time falls within the time value range, it is determined that the time is satisfied; otherwise, it is determined that the time is not satisfied. The object category corresponding to the object semantic candidate is matched with the scope. If the object category belongs to the object set limited by the scope, it is determined that the scope is satisfied; otherwise, it is determined that the scope is not satisfied. The condition value range is matched with the corresponding condition state in the current statement context. If the condition state falls within the condition value range, it is determined that the condition is satisfied; otherwise, it is determined that the condition is not satisfied. When the parameter, time, scope, and condition are satisfied simultaneously, the corresponding statement position is marked as the constraint satisfied position; otherwise, it is marked as the constraint mismatch position.
[0077] The structure mapping module maps each parsing branch in the parsing branch set to its corresponding execution semantic structure, forming a candidate execution structure set. It then extracts the semantic elements from the candidate execution structure set and performs action mapping processing to form a candidate action chain set.
[0078] Perform branch semantic relationship parsing on the parsing branch set, and parse the combination relationship, sequence relationship and constraint relationship between semantic anchors in each parsing branch to generate semantic relationship records.
[0079] It should be noted that the process involves reading the action semantic anchors, object semantic anchors, and constraint information of each parsing branch in the parsing branch set, and establishing a combination relationship based on the corresponding positional relationship between action semantic anchors and object semantic anchors within the same statement to characterize the semantic pairing method of an action semantic anchor acting on another object semantic anchor; reading the execution order constraint information between adjacent statements, comparing the order of the preceding and following statements in the original statement and the order descriptions corresponding to the sequence connectors, and establishing the sequence relationship between the preceding and following statements to characterize the order of each statement in the current parsing branch; reading the execution condition constraints, parameter value constraints, scope constraints, and execution method constraints corresponding to each statement, and attaching each constraint information to the corresponding action semantic anchor and object semantic anchor pairing relationship to form a constraint relationship; and recording the combination relationship corresponding to each statement, the sequence relationship between adjacent statements, and the constraint relationship within each statement in sequence according to the order of the statements in the parsing branch to generate a semantic relationship record.
[0080] Transform the execution relationships in the semantic relationship records and perform constraint injection processing based on the constraint relationships to generate a set of candidate execution structures.
[0081] It should be noted that the process involves reading the combination, sequence, and constraint relationships corresponding to each statement in the semantic relationship record, and converting the semantic pairing content representing the action semantic anchor acting on the object semantic anchor in the combination relationship into an execution correspondence, so that each pairing content of action semantic anchor and object semantic anchor forms an executable step; reading the sequence description representing the order of the preceding and following statements in the sequence relationship, and writing the sequence description between each executable step to form the order of the executable steps; continuing to read the execution condition constraints, parameter value constraints, scope constraints, and execution mode constraints corresponding to the constraint relationship, and writing the execution condition constraints to the trigger position of the corresponding executable step, the parameter value constraints to the parameter position of the corresponding executable step, the scope constraints to the object limitation position of the corresponding executable step, and the execution mode constraints to the action limitation position of the corresponding executable step; and recording each executable step that has completed constraint injection in sequence according to the order of the statements in the semantic relationship record to form a candidate execution structure set.
[0082] Extract the operation content, object content, sequence content, and constraint content corresponding to single-step execution from the candidate execution structure set to form a semantic element sequence.
[0083] It should be noted that the execution correspondence, order, execution condition constraints, parameter value constraints, scope constraints, and execution method constraints of each single-step execution in the candidate execution structure set are read. The paired content representing the action semantic anchor point acting on the object semantic anchor point in the execution correspondence is extracted as operation content, the paired content representing the acted object in the execution correspondence is extracted as object content, the sequential description representing the order of execution positions in the order is extracted as sequence content, and the execution condition constraints, parameter value constraints, scope constraints, and execution method constraints are extracted as constraint content. According to the original order of single-step execution in the candidate execution structure set, the corresponding operation content, object content, sequence content, and constraint content of each single-step execution are recorded to form a semantic element sequence.
[0084] The semantic elements in the semantic element sequence are classified and chained to form a set of candidate action chains.
[0085] It should be noted that semantic elements with the same action expression or the same operation type in the semantic element sequence are classified into the same action category, and each semantic element is labeled with the corresponding action category identifier. After completing the action classification process, the semantic elements are chained according to the sequential content corresponding to each semantic element. By reading the sequential description representing the execution relationship between the preceding and following parts in the sequential content, the semantic elements are sequentially connected according to the original arrangement order of the semantic elements in the candidate execution structure and the sequential relationship defined by the sequential description, forming an action sequence with a preceding and following execution relationship. During the chained arrangement process, the object content and constraint content corresponding to each semantic element are kept associated with the corresponding operation content, so that each action in the action sequence has both an execution object and execution constraints. The action sequences that have completed the chained arrangement are recorded according to the source relationship in the candidate execution structure set to form a candidate action chain set.
[0086] The path execution module calculates the path priority of each candidate action chain in the candidate action chain set, outputs the initial execution path, senses the execution status of the initial execution path and collects execution feedback information to form an execution evidence sequence.
[0087] Read the execution order, target object, and execution conditions of each single-step action record in each candidate action chain of the candidate action chain set, and count the historical successful execution records and environment matching information of the corresponding candidate action chain to generate a path indicator sequence.
[0088] It should be noted that the process involves reading the operation content, object content, sequence content, and constraint content of each candidate action chain in the candidate action chain set. Based on the sequence content, the order of actions in each candidate action chain is calculated. Based on the object content, the target object corresponding to each action in each candidate action chain is extracted. Based on the constraint content, the execution conditions corresponding to each action in each candidate action chain are extracted. The historical execution records corresponding to each candidate action chain are read, and the number of successful executions and the total number of executions for each candidate action chain in the historical execution records are calculated to form the historical execution success rate. Simultaneously, the device status, interface status, and network status in the current test environment are read, and the status values in the current test environment are compared item by item with the value requirements in the constraint content corresponding to the candidate action chain. The proportion of status items that meet the constraint requirements to the total number of status items is calculated to form the environment matching degree. According to the original arrangement order of the candidate action chains in the candidate action chain set, the action arrangement order, target object, execution conditions, historical execution success rate, and environment matching degree corresponding to each candidate action chain are recorded to generate a path indicator sequence.
[0089] Calculate the path priority of the path indicator sequence, perform priority filtering, and output the initial execution path.
[0090] It should be noted that the historical execution success rate and environment matching degree of each candidate action chain in the path indicator sequence are weighted and summed to obtain the path priority of each candidate action chain. The calculated path priority is written into the path indicator record of the corresponding candidate action chain. The candidate action chains in the path indicator sequence are sorted from high to low according to the path priority, and the candidate action chain with the highest path priority is selected as the target action chain. The action sequence corresponding to the target action chain is used as the initial execution path output.
[0091] It should also be noted that the weighting coefficients for historical execution success rate and environment matching degree are obtained by statistically calculating the execution results corresponding to each candidate action chain in the historical execution record. Specifically, the historical execution success rate corresponding to each candidate action chain in the historical execution record is calculated, and the average of the historical execution success rates of all candidate action chains is taken as the overall level value of historical execution success rate; the average of the set of environment matching degree values corresponding to the candidate action chains that meet the execution success conditions in the historical execution record is taken as the overall level value of environment matching degree; the overall level value of historical execution success rate and the overall level value of environment matching degree are normalized so that their sum is 1, and these are used as the weighting coefficients for historical execution success rate and environment matching degree, respectively.
[0092] The operation type corresponding to each single-step action is called sequentially according to the execution order in the initial execution path and applied to the corresponding target object. At the same time, the execution time and execution position of each single-step action are recorded to form an action execution record.
[0093] It should be noted that each single-step action record in the initial execution path is executed sequentially according to its arrangement in the initial execution path. Specifically, the operation content, object content, and constraint content corresponding to each single-step action record are read. The corresponding operation type is determined based on the operation content, and the corresponding target object is determined based on the object content. Then, the operation type is filled with parameters by combining the execution conditions and parameter values in the constraint content to generate the corresponding execution instruction. After generating the execution instruction, the execution instruction is sent to the corresponding target object in the order of the actions in the initial execution path. At the same time as sending the execution instruction, the start time of the single-step action is recorded. After the execution instruction is completed or the execution result is returned, the end time is recorded. At the same time, the corresponding action sequence number is generated according to the arrangement position of the single-step action in the initial execution path. The start time, end time, and action sequence number are associated with the corresponding single-step action record to form the action execution record.
[0094] During the execution of each single-step action, information on interface state changes, target object response information, and operation return information corresponding to the current single-step action are collected and associated with the corresponding single-step action to form a state feedback record.
[0095] It should be noted that during the execution of each single-step action, the execution status of the target object and its interface corresponding to the current single-step action is collected and processed. Specifically, after sending the execution command, the interface of the target object is continuously read. By acquiring the interface display content and interface element status before and after the execution command is triggered, the display status change information related to the target object is extracted as interface status change information. At the same time, the target object is subjected to response detection processing. By reading the attribute changes and interaction status changes of the target object after the execution command is applied, the state change of the target object and the content of the change are extracted as target object response information. The execution result returned by the execution command is read, and the return value, execution status identifier and exception prompt information corresponding to the execution command are obtained as operation return information. Based on the action sequence number of the current single-step action in the initial execution path, the interface status change information, target object response information and operation return information are associated with the corresponding single-step action record for position and time correspondence, forming a status feedback record.
[0096] The execution times of the action execution records and status feedback records are aligned and sequentially organized to form a sequence of execution evidence.
[0097] It should be noted that the start time, end time, and action sequence number of each single-step action in the action execution record are read, and the collection time and associated action sequence number of each feedback content in the status feedback record are read. Based on the associated action sequence number, the action execution record and status feedback record are initially matched. The collection time in the status feedback record is compared with the start and end times of the corresponding single-step action, and status feedback content whose collection time falls within the corresponding time interval is included in the record range corresponding to that single-step action. The action execution records and their time-aligned status feedback records corresponding to each single-step action are sequentially organized according to the ascending order of the action sequence number. The start time, end time, interface state change information, target object response information, and operation return information corresponding to the same single-step action are sequentially written into the same evidence entry to form an execution evidence sequence.
[0098] The judgment and correction module performs semantic execution consistency judgment on the execution evidence sequence, forming a deviation location sequence and a deviation type label sequence. Based on the deviation location sequence and the deviation type label sequence, it performs semantic reverse correction processing and generates a test execution report.
[0099] Establish a step-by-step correspondence between the execution evidence sequence and the initial execution path based on the order of single-step actions, and generate an alignment record for each corresponding position.
[0100] It should be noted that the process involves reading the action number, operation content, object content, sequence content, and constraint content corresponding to each single-step action in the initial execution path, and reading the action number, start time, end time, interface state change information, target object response information, and operation return information corresponding to each evidence item in the execution evidence sequence. Following the principle of matching action numbers, the single-step actions in the initial execution path are paired with the evidence items in the execution evidence sequence item by item. The arrangement of the single-step actions in the initial execution path is compared with the arrangement of the evidence items in the execution evidence sequence to identify any sequence offset. After completing the action number pairing and position verification, each pair of paired single-step actions and evidence items are written to the same corresponding position. The corresponding position records the operation content, object content, sequence content, constraint content corresponding to the single-step action, and the start time, end time, interface state change information, target object response information, and operation return information corresponding to the evidence item, thereby generating an alignment record for each corresponding position.
[0101] Perform multidimensional consistency comparison processing on each alignment record, comparing the target object matching, operation type matching, execution order matching, and execution condition satisfaction respectively, to form a progressively consistent record.
[0102] It should be noted that, based on the correspondence comparison between the target object identifier recorded in the object content and the response object identifier recorded in the target object response information, a target object matching flag is written when both point to the same target object; otherwise, a target object mismatch flag is written. Based on the correspondence comparison between the operation type recorded in the operation content and the actual execution type recorded in the operation return information, an operation type matching flag is written when both match; otherwise, an operation type mismatch flag is written. Based on the position comparison between the arrangement order recorded in the sequence content and the actual arrangement position of the alignment record in the execution evidence sequence, an execution order conformity flag is written when the actual arrangement position matches the order corresponding to the sequence content; otherwise, an execution order offset flag is written. Based on the execution condition value requirements, scope requirements, and trigger condition requirements recorded in the constraint content, the corresponding values in the interface state change information, target object response information, and operation return information are compared item by item. When all corresponding values meet the constraint requirements, an execution condition satisfaction flag is written; otherwise, an execution condition mismatch flag is written. The target object matching flag, operation type matching flag, execution order conformity flag, and execution condition satisfaction flag corresponding to the same alignment record are associated and recorded according to the action sequence number in the alignment record to form a progressive consistency record.
[0103] The alignment positions that do not meet the consistency conditions in the step-by-step consistency records are filtered out, and the corresponding single-step action positions and time positions are recorded to form a deviation localization sequence.
[0104] It should be noted that the target object matching flag, operation type matching flag, execution order conformity flag, and execution condition satisfaction flag are read from each stepwise consistency record. It is then determined whether there are target object mismatch flags, operation type mismatch flags, execution order offset flags, or execution condition mismatch flags in the same stepwise consistency record. When any mismatch flag exists, the action sequence number position of the corresponding stepwise consistency record is marked as the deviation position. Furthermore, the start time, end time, and action sequence number in the alignment record corresponding to that stepwise consistency record are read to extract the corresponding single-step action position and time position. After filtering all stepwise consistency records, the single-step action position, start time, and end time corresponding to each deviation position are recorded sequentially according to the ascending order of action sequence numbers, forming a deviation positioning sequence.
[0105] The deviations in the deviation location sequence are classified into object deviations, action deviations, sequence deviations and conditional deviations according to the corresponding comparison dimensions. The corresponding type identifier is written at each deviation location to form a deviation type label sequence.
[0106] It should be noted that the target object matching mark, operation type matching mark, execution order conformance mark, and execution condition satisfaction mark are read from the step-by-step consistency record corresponding to each deviation position in the deviation positioning sequence, and a deviation judgment correspondence is established according to the action sequence number corresponding to the deviation position. Deviation type discrimination is performed based on the mismatch mark category appearing in each deviation position. When the target object matching mark is a target object mismatch mark, the corresponding deviation position is judged as an object deviation; when the operation type matching mark is an operation type mismatch mark, the corresponding deviation position is judged as an action deviation; when the execution order conformance mark is an execution order offset mark, the corresponding deviation position is judged as a sequence deviation; when the execution condition satisfaction mark is an execution condition mismatch mark, the corresponding deviation position is judged as a condition deviation. The determined deviation type is written to the corresponding deviation position, and the action sequence number, single-step action position, time position, and deviation type are associated and recorded according to their original arrangement order in the deviation positioning sequence to form a deviation type mark sequence.
[0107] Based on the single-step action sequence of each deviation position in the deviation positioning sequence in the initial execution path, the corresponding execution steps and associated semantic anchor records are located to form a deviation association record.
[0108] It should be noted that, based on the action sequence number, single-step action position, and time position corresponding to each deviation position in the deviation positioning sequence, the deviation-related positioning process is executed line by line in the order of arrangement in the deviation positioning sequence. Specifically, the action sequence number, operation content, object content, sequence content, and constraint content corresponding to each single-step action in the initial execution path are read, and each deviation position in the deviation positioning sequence is matched item by item according to the action sequence number and single-step action position to determine the execution step corresponding to each deviation position. After completing the execution step matching, the candidate action chain set, candidate execution structure set, and parsing branch corresponding to the generation of the execution step are read. The set of semantic anchors is generated and traced back layer by layer from back to front along the generation link of the initial execution path. Based on the corresponding position of the action sequence number in the candidate action chain set, the corresponding position of the execution relationship in the candidate execution structure set, and the corresponding position of the parsing branch in the parsing branch set, the action semantic anchors, object semantic anchors, and constraint information corresponding to each deviation position are located and recorded. The action sequence number, single-step action position, time position, execution step position, and associated action semantic anchors, object semantic anchors, and constraint information corresponding to each deviation position are associated and recorded according to the original arrangement order in the deviation positioning sequence to form a deviation association record.
[0109] The deviation correlation records are classified, corrected, and reconstructed using parsing branches to generate a test execution report.
[0110] It should be noted that the deviation type identifier, execution step position, associated action semantic anchor, object semantic anchor, and constraint information corresponding to each deviation association record are read, and corresponding correction processing is performed according to the deviation type identifier: when the deviation type is an object deviation, an object semantic candidate that meets the constraint information requirements is selected from the object semantic candidates corresponding to the same statement position to replace the original object semantic anchor; when the deviation type is an action deviation, an action semantic candidate that matches the object semantic anchor is selected from the action semantic candidates corresponding to the same statement position to replace the original action semantic anchor; when the deviation type is a sequence deviation, the arrangement position of the corresponding statement in the parsing branch is adjusted to satisfy the sequential relationship defined by the sequence content; when the deviation type is a condition deviation, the constraint information is adjusted... The value range or triggering condition is made consistent with the attribute values corresponding to the current action semantic anchor and object semantic anchor; the correction parsing branch is regenerated based on the corrected action semantic anchor, object semantic anchor and constraint information, and the correction execution path is generated based on the correction parsing branch; whether the mismatch mark corresponding to the original deviation position is eliminated is used as the correction termination condition. When all the mismatch marks corresponding to the original deviation position are eliminated, the correction execution path is recorded as a valid correction path. When mismatch marks still exist, the current deviation association record is recorded as a correction failure record; the deviation type, deviation position, semantic anchor content before correction, semantic anchor content after correction and correction status corresponding to each deviation association record are read and summarized in the order of execution steps to form a test execution report.
[0111] In summary, this invention achieves multi-path semantic interpretation modeling of the semantic anchor set and combines path constraint verification and parsing credibility calculation to generate a parsing branch set, thereby enabling multi-path expansion and quantifiable filtering of semantic ambiguity in unstructured test instructions and improving the reliability of mapping test instructions to execution actions. Simultaneously, by performing semantic execution consistency judgment on the execution evidence sequence and performing semantic reverse correction processing based on the deviation location sequence and deviation type label sequence, it achieves reverse tracing of semantic anchors from the execution result and performing classification correction and parsing branch reconstruction, forming a closed-loop mechanism of "parsing—execution—feedback—correction" in the execution process. This effectively suppresses error propagation, improves the adaptive correction capability of the execution path, and enhances the overall accuracy of test execution.
[0112] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. An intelligent parsing and execution system for unstructured test instructions, characterized in that, include: The instruction reconstruction module acquires unstructured test instruction text and performs normalization and structural reconstruction processing to generate standardized instruction sequences. The semantic modeling module extracts semantic anchors from standardized instruction sequences to form a set of semantic anchors. It then performs multi-path semantic interpretation modeling on the set of semantic anchors to generate a set of parsing branches. The structure mapping module maps each parsing branch in the parsing branch set to its corresponding execution semantic structure, forming a candidate execution structure set. It then extracts the semantic elements from the candidate execution structure set and performs action mapping processing to form a candidate action chain set. The path execution module calculates the path priority of each candidate action chain in the candidate action chain set, outputs the initial execution path, senses the execution status of the initial execution path and collects execution feedback information to form an execution evidence sequence. The judgment and correction module performs semantic execution consistency judgment on the execution evidence sequence, forming a deviation location sequence and a deviation type label sequence. Based on the deviation location sequence and the deviation type label sequence, it performs semantic reverse correction processing and generates a test execution report.
2. The intelligent parsing and execution system for unstructured test instructions as described in claim 1, characterized in that, The specific steps for generating the standardized instruction sequence are as follows: Unstructured test instruction text is processed with unified encoding, whitespace character normalization, comment fragment isolation, and line break boundary recognition to form the original instruction sequence; Identify delay markers in the original instruction sequence, remove the line start numbers, and generate a regular statement sequence; Extract variable placeholders from regular statement sequences and split compound statements to generate standardized instruction sequences.
3. The intelligent parsing and execution system for unstructured test instructions as described in claim 2, characterized in that, The specific steps for forming the semantic anchor set are as follows: By parsing the statement structure, the operation description fragments, target reference fragments, and modification and limitation fragments in the standardized instruction sequence are identified, and a statement structure parsing sequence is generated. Semantic classification processing is performed on the parsed sequence of statement structure, mapping operation description fragments to action semantic anchors and target referential fragments to object semantic anchors, generating a basic semantic anchor sequence; The modification and constraint fragments in the statement structure parsing sequence are subjected to constraint parsing processing, and the parsed constraint information is associated with the basic semantic anchor sequence to form a semantic anchor set.
4. The intelligent parsing and execution system for unstructured test instructions as described in claim 3, characterized in that, The specific steps for generating the set of parsing branches are as follows: Identify semantic ambiguities in each semantic anchor point in the semantic anchor point set and perform semantic combination to generate a candidate semantic path sequence; Perform path constraint verification on the candidate semantic path sequence, calculate the parsing credibility of each candidate semantic path, and generate a set of parsing branches.
5. The intelligent parsing and execution system for unstructured test instructions as described in claim 3 or 4, characterized in that, The specific steps for forming the candidate execution structure set are as follows: Perform semantic relation parsing on the parsing branch set, and parse the combination, sequence and constraint relationships between semantic anchors in each parsing branch to generate semantic relation records; Transform the execution relationships in the semantic relationship records and perform constraint injection processing based on the constraint relationships to generate a set of candidate execution structures.
6. The intelligent parsing and execution system for unstructured test instructions as described in claim 5, characterized in that, The specific steps for forming the candidate action chain set are as follows: Extract the operation content, object content, sequence content, and constraint content corresponding to single-step execution from the candidate execution structure set to form a semantic element sequence; The semantic elements in the semantic element sequence are classified and chained to form a set of candidate action chains.
7. The intelligent parsing and execution system for unstructured test instructions as described in claim 6, characterized in that, The specific steps for outputting the initial execution path are as follows: Read the execution order, target object, and execution conditions of each single-step action record in each candidate action chain of the candidate action chain set, and count the historical successful execution records and environment matching information of the corresponding candidate action chain to generate a path indicator sequence; Calculate the path priority of the path indicator sequence, perform priority filtering, and output the initial execution path.
8. The intelligent parsing and execution system for unstructured test instructions as described in claim 7, characterized in that, The specific steps for forming the execution evidence sequence are as follows: The operation type corresponding to each single-step action is called sequentially according to the execution order in the initial execution path and applied to the corresponding target object. At the same time, the execution time and execution position of each single-step action are recorded to form an action execution record. During the execution of each single-step action, information on interface state changes, target object response information, and operation return information corresponding to the current single-step action are collected and associated with the corresponding single-step action to form a state feedback record. The execution times of the action execution records and the status feedback records are aligned and sequentially organized to form a sequence of execution evidence.
9. The intelligent parsing and execution system for unstructured test instructions as described in claim 7 or 8, characterized in that, The specific steps for forming the deviation positioning sequence and the deviation type label sequence are as follows: Establish a step-by-step correspondence between the execution evidence sequence and the initial execution path based on the order of single-step actions, and generate an alignment record for each corresponding position; Perform multi-dimensional consistency comparison processing on each alignment record, comparing the matching of target objects, operation types, execution order, and execution conditions to form progressively consistent records; The alignment positions that do not meet the consistency conditions in the step-by-step consistency records are filtered out, and the corresponding single-step action positions and time positions are recorded to form a deviation localization sequence. The deviations in the deviation location sequence are classified into object deviations, action deviations, sequence deviations and conditional deviations according to the corresponding comparison dimensions. The corresponding type identifier is written at each deviation location to form a deviation type label sequence.
10. The intelligent parsing and execution system for unstructured test instructions as described in claim 9, characterized in that, The specific steps for generating the test execution report are as follows: Based on the single-step action sequence of each deviation position in the deviation localization sequence in the initial execution path, the corresponding execution steps and associated semantic anchor point records are located to form a deviation association record; The deviation correlation records are classified, corrected, and reconstructed using parsing branches to generate a test execution report.