A label arrangement and backtracking processing method, system, device and medium for switch automation testing

By introducing test case review access control, tag configuration and fidelity verification into automated switch testing, filtering conflict detection, backtracking classification and confidence calculation, the problems of resource waste and erroneous submission defects caused by unreliable classification results in automated switch testing are solved, and efficient test resource management and accurate handling of failure items are achieved.

CN123164041APending Publication Date: 2026-11-24SHEN ZHOU SHU MA WANG LUO BEI JING YOU XIAN GONG SI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611331566.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

In existing automated testing of switches, the reliability of failure classification results cannot be quantified, which may lead to incorrect classification conclusions, wasted testing resources, and defective submissions.

Method used

The test scripts for access control verification are written into the test case library through test case review, and labels are configured and loyalty verification is performed. Scripts that match the labels are filtered and conflict detection is performed. Test plans are generated, execution output is collected for backtracking and classification, classification confidence is calculated, and failure items are handled accordingly.

Benefits of technology

It enables quantitative measurement and tiered handling of the reliability of failure classification results, reducing the waste of testing resources and the problem of defective submissions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123164041A_ABST
    Figure CN123164041A_ABST
Patent Text Reader

Abstract

This application discloses a label arrangement and backtracking processing method, system, device, and medium for automated switch testing, relating to the field of automated switch testing technology. The method includes: acquiring test cases; writing test cases that have passed access control verification into a test case library; generating test scripts and configuring labels based on the test cases in the test case library; storing test scripts that have passed fidelity verification into a script library; selecting test scripts from the script library according to user testing intent; performing conflict detection on the test resources involved in the selected test scripts and generating a test plan; when failures occur in the output of executing the test plan, backtracking and classifying the failures to obtain classification labels, and calculating the classification confidence corresponding to the classification labels; grouping the failures into queues based on the classification confidence; and, under the constraint of access control verification, distributing and processing the failures in each queue according to the classification labels. This application can reduce the waste of testing resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automated testing technology for switches, and in particular to a method, system, device and medium for tag arrangement and backtracking processing in automated testing of switches. Background Technology

[0002] Switches are core communication devices in building computer networks, covering functions such as data forwarding, virtual LAN partitioning, routing protocol processing, and access control. To ensure the quality of switch products, extensive testing is required during research and development and release. As product functions continue to increase, manual testing is no longer sufficient to meet efficiency requirements, and automated testing is widely used in the verification of switch products, leading to a continuous expansion of test assets such as test cases and test scripts.

[0003] In existing automated testing solutions for switches, testers typically first write test cases, then create automated test scripts based on these test cases. The execution engine then schedules the scripts to run on the device under test, and finally analyzes the execution results. When failures occur in the execution results, testers usually manually check the logs to determine the cause of the failure, or use log analysis tools or large models to help categorize the cause of the failure, and then take appropriate action based on the categorization results, such as modifying test cases, modifying scripts, adjusting the test environment, or submitting defects.

[0004] However, in the existing technology, whether manual judgment or tool-assisted judgment is used, the reliability of the failure classification results cannot be quantitatively measured. Classification conclusions with low confidence are treated the same as those with high confidence, which can easily lead to incorrect handling of failure items based on unreliable classification conclusions, or even incorrect submission of defects to the defect management system, resulting in a waste of testing resources. Summary of the Invention

[0005] This application provides a method, system, device, and medium for tag arrangement and backtracking processing in automated testing of switches, which can reduce the waste of testing resources.

[0006] To achieve the above objectives, this application adopts the following technical solution: Firstly, this application provides a method for tag arrangement and backtracking processing in automated testing of switches, including: Obtain test cases and write the test cases that pass the access control verification into the test case library; Test scripts are generated based on test cases in the test case library, tags are configured for the test scripts, and fidelity verification is performed on the test scripts. Test scripts that pass the fidelity verification are stored in the script library. Based on the user's input test intent, filter test scripts with tags that match the test intent from the script library; Conflict detection is performed on the test resources involved in the selected test scripts. If no conflict is found, the test resources are locked and a test plan is generated based on the selected test scripts. Collect the output of the test plan. When a failure occurs in the output, backtrack and classify the failure to obtain the classification label corresponding to the failure, and calculate the classification confidence corresponding to the classification label. Based on the classification confidence level and the preset confidence threshold, the failed items are assigned to either the mandatory review queue or the suggested handling queue. Under the constraints of access control, and according to the classification labels, the failed items that passed the review in the mandatory review queue and the failed items in the suggested processing queue are sorted and processed separately.

[0007] Optionally, the method further includes: Perform a completeness check on at least one of the following: identifier, module, preconditions, execution steps, expected results, priority, and associated requirements of the test case; Perform at least one of the following quality checks on the test cases: typo check, pairing check, and copy residue check; Test cases that pass the integrity check and the quality check are identified as test cases that pass the access control verification test case audit.

[0008] Optionally, the fidelity verification of the test script includes: Perform a step alignment check on the test script to verify whether the number and order of steps in the test script are consistent with the number and order of steps in the corresponding test cases. Perform an in-step coverage check on the test script to verify whether the input and output sub-items of each step of the test case are completely covered in the test script; Perform a step completeness check on the test script to verify whether each step of the test script includes input description comments, output description comments, and action and result checks. Perform a custom specification check on the test script to verify whether the test script conforms to the preset script specification rule set; The test script is subjected to a robustness check to verify its cleanup and recovery capabilities in continuous execution scenarios, as well as its timeout handling, exception capture, and failure cleanup capabilities in sudden abnormal scenarios. After the test script passes the step alignment check, in-step coverage check, step completeness check, custom specification check, and robustness check, the fidelity score of the test script is calculated. When the fidelity score of the test script reaches a preset score threshold, the test script is confirmed as having passed the fidelity verification.

[0009] Optionally, the conflict detection of test resources involved in the selected test scripts includes: Perform serial port mutual exclusion detection on the test resources involved in the selected test scripts. If the same serial port resource is requested by multiple test scripts, it is determined that there is a conflict. A topology type matching check is performed on the test resources involved in the selected test scripts. If the topology type corresponding to the test script does not match the topology type of the available resources, a conflict is determined to exist. The test resources involved in the selected test scripts are checked for port allocation using traffic tools. If the total number of requests to the traffic tool ports exceeds the total number of available ports, a conflict is determined to exist. The device version compatibility of the test resources involved in the selected test scripts is checked. If the version of the switch device under test is incompatible with the version required by the test script, a conflict is determined to exist.

[0010] Optionally, the step of backtracking and classifying the failed items to obtain the corresponding classification labels for the failed items includes: Based on environmental rules, the failure items are matched according to rules. If the environmental rules support that the failure item is an environmental problem or a resource problem, then the category label corresponding to the failure item is determined to be an environmental problem or a resource problem. If the environmental rules do not support environmental or resource issues, then the failure items are matched for similarity based on the historical failure case library to obtain historical similarity support. If the historical similarity support reaches a preset similarity threshold, then the classification label of the corresponding historical failure case in the historical failure case library will be used as the classification label of the failure item. If the historical similarity support does not reach the preset similarity threshold, the failure item is predicted based on the classification model to obtain the model category probability, and the classification label corresponding to the failure item is determined according to the model category probability.

[0011] Optionally, calculating the classification confidence score corresponding to the classification label includes: Based on the support strength of the environmental rules for the classification labels, obtain the rule support strength; The rule support strength, the historical similarity support, and the model class probability are weighted and fused together, and the classification confidence corresponding to the classification label is obtained by combining the conflict and incompleteness penalty coefficient.

[0012] Optionally, the step of triaging failed items that passed review in the mandatory review queue and failed items in the suggested processing queue according to the classification labels includes: If the classification label indicates an environmental or resource issue, then resource adjustments or test rescheduling will be carried out. If the category label indicates a use case defect, the failure item corresponding to the category label will be returned to the use case review access control for re-review; If the category label indicates a script defect, the failed item corresponding to the category label will be returned to the fidelity check for re-verification; If the category label indicates a functional defect, the failure item corresponding to the category label is submitted to the defect management system.

[0013] Secondly, this application provides a tag arrangement and backtracking processing system for automated testing of switches, including: The test case acquisition module is used to acquire test cases and write the test cases that have passed the access control verification into the test case library; The test script generation module is used to generate test scripts based on test cases in the test case library, configure tags for the test scripts, perform fidelity verification on the test scripts, and store the test scripts that pass the fidelity verification into the script library. The test intent matching module is used to filter test scripts with tags that match the test intent from the script library based on the test intent input by the user. The conflict detection module is used to perform conflict detection on the test resources involved in the selected test scripts. If no conflict exists, the test resources are locked and a test plan is generated based on the selected test scripts. The failure classification module is used to collect the output of the test plan. When a failure occurs in the output, the failure is back-classified to obtain the classification label corresponding to the failure and to calculate the classification confidence corresponding to the classification label. The queue partitioning module is used to partition the failed items into a mandatory review queue or a suggested handling queue based on the classification confidence level and a preset confidence level threshold. The triage module is used to triage and process failed items that have passed the review in the mandatory review queue and failed items in the suggested processing queue according to the classification labels under the constraint of the access control confirmation.

[0014] Thirdly, this application provides a computing device, including a memory and a processor; The memory stores one or more computer programs, the one or more computer programs including instructions; when the instructions are executed by the processor, the computing device performs the method as described in any one of the first aspects.

[0015] Fourthly, this application provides a computer-readable storage medium for storing a computer program for performing the method as described in any one of the first aspects.

[0016] As can be seen from the above technical solution, this application has at least the following beneficial effects: This application writes test cases that pass access control verification through test case review into a test case library. Furthermore, test scripts generated from test cases in the library must undergo fidelity verification before being stored in the script library. Therefore, all test cases and test scripts entering the execution phase undergo quality control. Inconsistencies between test scripts and test cases are detected and intercepted before being stored in the library, reducing the probability of execution failures due to inconsistencies from the source. Moreover, because test scripts with matching tags are selected from the script library based on the user-inputted test intent, and conflict detection is performed on the test resources involved in the selected test scripts before generating the test plan, test resources are locked and a test plan is generated only when no conflicts exist. Therefore, test scripts executed simultaneously will not compete for resources, avoiding execution failures and misjudgments caused by resource conflicts. Simultaneously, when failure items appear in the execution output, they are back-classified to obtain classification labels, and the classification confidence corresponding to these labels is calculated. The classification confidence, in a calculable numerical form, represents the system's degree of certainty regarding the classification conclusion. Then, based on the classification confidence... Failures are categorized into either a mandatory review queue or a suggested handling queue based on preset confidence thresholds. Therefore, classification conclusions with low confidence are subject to mandatory manual review, while those with high confidence are placed in the suggested handling queue awaiting processing. Failures are graded according to the confidence level of their classification conclusions, with low-confidence conclusions no longer treated the same as high-confidence conclusions. Furthermore, the triage and handling of failures is conducted under the constraint of a confirmation gate. Regardless of which queue a failure is placed in, submission of a defect to the defect management system must be confirmed. Classification confidence cannot be used to bypass confirmation; therefore, even high-confidence failures will not be automatically submitted as defects, thus avoiding the problem of erroneous defect submissions. In summary, this application achieves quantitative measurement and graded handling of the confidence level of failure classification results, reducing the waste of testing resources.

[0017] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single embodiment. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one embodiment. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions, and beneficial effects described in this embodiment can be combined in any suitable manner. Those skilled in the art will understand that embodiments can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular embodiment. In other embodiments, additional technical features and beneficial effects may be identified in specific embodiments that do not embody all embodiments. Attached Figure Description

[0018] Figure 1 This application provides a schematic flowchart of a tag arrangement and backtracking method for automated testing of switches. Figure 2 A schematic diagram of a tag arrangement and backtracking processing system for automated testing of switches is provided in an embodiment of this application; Figure 3 This is a schematic diagram of a computing device provided in an embodiment of this application. Detailed Implementation

[0019] The terms "first," "second," and "third," etc., used in this application specification and accompanying drawings are used to distinguish different objects, not to limit a specific order.

[0020] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0021] This application provides a tag orchestration and backtracking method for automated testing of switches, which can be executed by a processing device. This processing device can be a terminal or a server. Terminals include, but are not limited to, smartphones, tablets, laptops, personal digital assistants, or smart wearable devices. The server can be a cloud server, such as a central server in a central cloud computing cluster or an edge server in an edge cloud computing cluster. Alternatively, the server can be a server in a local data center. A local data center refers to a data center directly controlled by the user.

[0022] To make the technical solution of this application clearer and easier to understand, the following description, in conjunction with the accompanying drawings, introduces a tag arrangement and backtracking method for automated testing of switches provided by an embodiment of this application. Figure 1 As shown in the figure, this is a schematic flowchart of a tag arrangement and backtracking method for automated testing of switches provided in an embodiment of this application. The method includes: S101, Obtain test cases and write the test cases that pass the access control verification into the test case library.

[0023] It's important to note that a test case is a complete description of a testing activity, specifying under what conditions what operations are performed on the switch and what results are expected. A test case typically includes a test case identifier, its module, preconditions, execution steps, expected results, priority, and associated requirements. The test case identifier is a unique number that distinguishes different test cases; the module indicates which function of the switch the test case targets, such as VLAN or routing protocol functionality; the preconditions are the states that the switch under test and the test environment must meet before executing the test case, such as port connectivity and basic configuration being distributed; the execution steps are the sequence of operations to be performed during testing; the expected results are the correct results that each execution step should produce; the priority indicates the importance of the test case; and the associated requirements indicate the product requirements corresponding to the test case.

[0024] Test case review access control refers to a quality verification checkpoint set up before test cases are added to the test case library. Only test cases that pass all verifications at this checkpoint are allowed to be written into the test case library; test cases that fail verification are not allowed to enter the script generation stage. In this application, access control refers to a verification checkpoint, and only those that pass verification are allowed to proceed to the next stage.

[0025] Specifically, the requirements document can be imported, test cases can be generated according to a preset test case template, and the generated test cases can be subjected to integrity checks and quality checks. Integrity checks refer to verifying the completeness of at least one of the following: test case identifier, module, preconditions, execution steps, expected results, priority, and related requirements. For example, checking if a test case lacks an expected result; if so, it is considered to have failed the integrity check. Quality checks include at least one of the following: typo checks, pairing checks, and copy residue checks. Typo checks are used to find writing errors in the test case text; pairing checks are used to find if content that should appear in pairs is missing its other half, such as an operation to enable a function but lacking the corresponding disable or restore operation; copy residue checks are used to find text unrelated to this test case left over from copying content from other test cases, such as the appearance of other module names in the test case. Test cases that pass the integrity and quality checks are identified as test cases that pass the test case review and access control verification. After user confirmation, the status of the test case is set to "passed" and added to the test case library.

[0026] Through the above steps, all test cases entering the test case library have undergone dual verification of completeness and quality, reducing the probability of defective test cases flowing into the script generation stage.

[0027] S102: Generate test scripts based on test cases in the test case library, configure tags for the test scripts, perform fidelity verification on the test scripts, and store the test scripts that pass the fidelity verification into the script library.

[0028] It's important to note that test scripts are automated programs that can be run directly by the execution engine, such as those generated based on the pytest testing framework. Tags are appended to test scripts to describe script attributes, such as the module the script belongs to, the required topology type, required resources, and applicable device versions. These tags are used for matching when filtering scripts. Fidelity verification refers to validating the degree to which the test script faithfully adheres to the corresponding test cases; that is, verifying whether the script completely and accurately implements the steps and checkpoints specified in the test cases.

[0029] Specifically, fidelity verification can include step alignment checks, in-step coverage checks, step completeness checks, custom specification checks, and robustness checks, and can automatically generate a step comparison table between scripts and test cases for verification.

[0030] The step alignment check verifies whether the number and order of steps in the test script match the number and order of steps in the corresponding test cases. In other words, it requires a one-to-one correspondence between script steps and test case steps. For example, if a test case contains three execution steps, the script should also contain three corresponding steps, and the order of the first step (configuration operation), the second step (traffic triggering), and the third step (result collection) must not be reversed. Inconsistent step numbers or mismatched order are considered blocking items, and the verification will fail immediately.

[0031] In-step coverage checks are used to verify whether the input and output sub-items of each step in a test case are fully covered in the test script. Input sub-items refer to the various operations that need to be sent to the switch under test in a step, and output sub-items refer to the various return results that need to be checked in that step. In the embodiments provided in this application, a step in the script is allowed to contain multiple actions or multiple assertions, as long as each input and output sub-item of the test case step is covered. For example, if a step in a test case requires sending two configuration commands and checking two responses, the corresponding step in the script must include the sending actions for these two commands and the checks for these two responses. If there are any uncovered sub-items, they are counted as missing items or determined to be blocking items according to preset rules.

[0032] The step completeness check verifies whether each step of the test script includes input description comments, output description comments, and action and result checks. Input description comments describe the input content for that step, output description comments describe the expected output content, actions refer to the actual operations performed in that step, and result checks are statements that assert the result of that step. Missing actions or result checks are considered blocking items; missing description comments result in point deductions. Configuring input and output description comments for each step not only facilitates manual script reading but also allows for the extraction and display of input and output description comments for failed steps when script execution fails, enabling users to quickly understand the test requirements for that step.

[0033] Custom specification checks are used to verify whether test scripts conform to a preset set of script specification rules. This set of rules can be configured by the project team based on their own Python scripts, such as function naming conventions, comment formatting conventions, and log printing conventions. Scripts that do not conform to the specifications will be penalized or deemed as blocking items.

[0034] Robustness checks verify the test script's ability to clean up and recover in continuous execution scenarios, as well as its ability to handle timeouts, catch exceptions, and clean up failures in the event of sudden anomalies. For example, when a test script executes multiple test cases consecutively, the configuration issued in this execution should be cleaned up after each test case is completed, restoring the switch under test to its state before execution. When sudden anomalies such as the device under test becoming unresponsive occur during execution, the test script should have the ability to time out, catch exceptions, and clean up failures to prevent residual anomalies from affecting other test cases. Failure to meet robustness requirements will result in point deductions or be designated as a blocking item.

[0035] When performing the above checks on the test script, if any blocking items are present, the fidelity check will fail immediately, and the script must not be included in the database; if no blocking items are present, the fidelity score of the test script will be calculated. The fidelity score can be denoted as... The calculation method can be as follows:

[0036] in, The coverage score is used to characterize the pass rate of the in-step coverage check and the step alignment check; The annotation score is used to characterize the completeness of the input and output annotations. The quality score is used to characterize the pass rate of custom specification checks and robustness checks; , , These are the weighting coefficients for the corresponding scores. As an example, , , The preset score thresholds can be set to values ​​of 0.5, 0.2, and 0.3. A value of 80 is possible. This is the fidelity score for the test script. Reaching the preset score threshold, i.e. Upon user confirmation, the test script is deemed to have passed the loyalty verification and is written into the script library; when At that time, the test script must not be added to the database.

[0037] Through the above steps, each test script entering the database undergoes multi-dimensional verification of step alignment, in-step coverage, step completeness, standardization, and robustness, and meets the fidelity score requirements, thereby reducing the probability of execution failure due to script quality issues.

[0038] S103: Based on the test intent input by the user, filter test scripts from the script library that have tags that match the test intent.

[0039] It's important to note that the test intent is a description of the goal the user hopes to achieve in this test, such as performing regression testing on a specific functional module of a certain switch model under a certain version. Specifically, the test intent can be matched with the tags of various test scripts in the script library to filter out test scripts whose tags match the test intent. For example, if the user's input test intent is to perform regression testing on the routing protocol module for version V2, then test scripts tagged with "routing protocol module" and applicable to versions including V2 will be filtered out.

[0040] By following the steps above, users no longer need to manually select scripts one by one. They only need to express their testing intentions to automatically complete the script selection, which improves the efficiency of switch testing and avoids the mistake of selecting or omitting scripts when selecting them manually.

[0041] S104: Perform conflict detection on the test resources involved in the selected test scripts. If no conflict is found, lock the test resources and generate a test plan based on the selected test scripts.

[0042] It should be noted that test resources refer to the hardware and software resources required to execute the test scripts, such as the switch under test, serial console, ports of traffic tools, and test topology. Conflict detection refers to checking whether the resource requirements of each test script can be met simultaneously before generating the test plan. Resource locking means reserving and allocating the test resources that pass the detection to the current test plan, ensuring that these resources are not occupied by other test tasks during execution.

[0043] Specifically, conflict detection may include at least one of serial port mutual exclusion detection, topology type matching detection, traffic tool port allocation detection, and device version compatibility detection.

[0044] Regarding serial port mutual exclusion detection, it should be noted that the serial port is the channel through which testers or scripts log in to the switch under test to perform command-line operations. Since only one task can use the same serial port at the same time, if the same serial port resource is requested by multiple test scripts, a conflict is determined to exist.

[0045] Regarding topology type matching detection, it should be noted that topology type refers to the connection relationship between devices under test (DUT) and between DUT and the testing instrument, such as single-device topology or dual-device interconnection topology. If the topology type corresponding to the test script does not match the topology type of the available resources, a conflict is determined to exist.

[0046] Regarding port allocation detection using traffic tools, it's important to note that traffic tools are instruments or software used to send test traffic to the switch under test; for example, Trex can be used. Since the number of ports available for a traffic tool is limited, if the total number of requests from various test scripts to a traffic tool port exceeds the available total, i.e., the port is oversold, a conflict is considered to exist.

[0047] For device version compatibility testing, if the device version of the switch under test is incompatible with the version required by the test script, a conflict is determined to exist.

[0048] If a conflict is detected, no test plan is generated, and the user is notified of the reason for the conflict so that the user can adjust the script scope or wait for the resources to be released. If no conflict is detected, the relevant test resources are locked, a test plan is generated based on the selected test scripts, and the execution engine is triggered to execute the test plan. The execution engine can be, for example, Jenkins.

[0049] By following the steps above, resource conflicts can be eliminated before test execution, avoiding execution failures and misjudgments caused by multiple scripts competing for the same resource, and reducing the waste of test resources due to invalid execution.

[0050] S105: Collect the output of the test plan. When a failure occurs in the output, backtrack and classify the failure to obtain the corresponding classification label and calculate the classification confidence corresponding to the classification label.

[0051] In the embodiments provided in this application, the output generated by the execution engine running the test script can be collected in real time or near real time, and the output includes the execution result of each test case. When a failure item appears in the output, that is, when the execution result of a certain test case is Fail, the input description comments and output description comments corresponding to the failure item can be extracted and displayed to the user, so that the user can quickly understand the original input content and expected output content of the failure step.

[0052] Furthermore, the backtracking and classification of failures refers to inferring the cause category of the failure based on the various traces left by the failure during execution. Classification labels are used to indicate the cause category of the failure. In the embodiments provided in this application, the classification labels can include at least environmental problems, resource problems, test case defects, script defects, and functional defects. Among these, environmental problems refer to failures caused by abnormal test environments, such as loose cables or malfunctioning instruments; resource problems refer to failures caused by test resources not meeting requirements; test case defects refer to failures caused by errors in the test case itself; script defects refer to failures caused by errors in the implementation of the test script; and functional defects refer to failures caused by actual problems with the tested function of the switch under test.

[0053] As an optional implementation, backtracking classification can be performed in the order of rule matching, historical similarity matching, and model prediction. First, rule matching is performed on the failed items based on environmental rules. These environmental rules are pre-configured rules used to identify environmental and resource problems, such as when the execution output shows features like device connection timeouts or flow meters not responding. If the environmental rules support the failed item as either an environmental or resource problem, then the corresponding classification label for the failed item is determined as either an environmental or resource problem. If the environmental rules do not support either environmental or resource problem, then similarity matching is performed on the failed items based on a historical failure case library. This library stores the features of past failed items and their manually confirmed classification labels. The similarity between the current failed item and each historical failed case is calculated to obtain the historical similarity support. If the historical similarity support reaches a preset similarity threshold, then the classification label of the historical failed case with the highest similarity is used as the classification label for the current failed item. If the historical similarity support does not reach the preset similarity threshold, the failure item is predicted based on the classification model. The classification model can be a pre-trained text classification model or a large model. The log text of the failure item, the failure step information, etc. are input into the classification model to obtain the model category probability, that is, the probability that the failure item belongs to each category given by the model. The classification label corresponding to the failure item is determined according to the model category probability. For example, the category with the highest probability can be selected.

[0054] Through the above steps, the failed items are first matched with rules that are highly deterministic and interpretable, then matched with similarity based on historical evidence, and finally predicted by the model. This ensures that the classification labels are derived based on rules and historical experience, and can also cover new failure patterns that have never appeared before.

[0055] After obtaining the category labels, calculate the category confidence corresponding to the category labels.

[0056] In the embodiments provided in this application, the classification confidence level can be denoted as C, with a value ranging from 0 to 1. It is used to represent the degree of confidence in classifying the failure item into the current classification label L. The larger the C value, the higher the confidence in the classification conclusion. It is important to distinguish that the classification confidence level C is not the severity level of the defect, nor is it the same as the aforementioned fidelity score F. The fidelity score F measures the fidelity of the script to the use case before the script is entered into the database, while the classification confidence level C measures the degree of confidence in the classification conclusion of the failure item after execution failure occurs. The two operate at different stages and measure different objects.

[0057] Specifically, when calculating the classification confidence C, we can first obtain the rule support strength based on the support strength of the environmental rules for the classification label, denoted as . Then increase the strength of rule support. Historical similarity support and model class probabilities Perform weighted fusion and combine it with conflict and incompleteness penalty coefficients. We obtain the classification confidence C corresponding to the classification label.

[0058] in, The strength of support for the current classification label L by environmental regulations is determined by different branches of L. The stronger the hit of environmental rules, the better the environmental regulations support the current classification label L. The higher the value, for example, from 0.85 to 1.0; when L represents a use case defect, script defect, or functional defect, the more fully the environment rule excludes environment-related causes because it does not support the environment class. The higher the value, for example, between 0.80 and 0.95, the lower it should be if environmental indicators are unclear. The value of . Historical similarity support is obtained by mapping the similarity score of the current failure item to the most similar historical failure case to the interval between 0 and 1. This represents the probability that the model assigns to the classification label L, with a value ranging from 0 to 1. This is the conflict / incompleteness penalty coefficient, used to lower the confidence level when various types of evidence contradict each other or are incomplete. As an example, when various types of evidence are consistent... Take 1.0 when the evidence is incomplete or contradictory. The range is 0.6 to 0.8. The formula for calculating the classification confidence score C is as follows:

[0059] in, This means truncating x to the interval between 0 and 1, that is, taking 0 when x is less than 0 and taking 1 when x is greater than 1, to ensure that the value of C falls between 0 and 1; 0.4, 0.3, and 0.3 are respectively , , The weighting coefficients.

[0060] As a numerical example, suppose the category label L of a failure item is "functional defect". According to the above value selection rules, since it has been fully excluded due to environmental reasons, we take... Historical similarity support The model's probability of functional defects All evidence is consistent, therefore... Substituting into the formula, we get C = 0.4 × 0.90 + 0.3 × 0.70 + 0.3 × 0.95 = 0.855, approximately 0.86. As a comparison, if the same failure item has incomplete evidence, take... Then C = (0.4 × 0.90 + 0.3 × 0.70 + 0.3 × 0.95) × 0.7 ≈ 0.60.

[0061] Through the above steps, the reliability of the classification conclusions can be expressed in a calculable and reproducible numerical form, allowing the classification conclusions of different failure items to be compared and graded according to their degree of certainty.

[0062] S106. Based on the classification confidence level and the preset confidence threshold, the failed items are assigned to either the mandatory review queue or the suggested handling queue.

[0063] Specifically, the preset confidence threshold can be denoted as: For example, it can be set to a value of 0.70. When the classification confidence C of the failed item is less than... When this happens, the failed item is placed in the mandatory review queue. Failed items in the mandatory review queue must be manually reviewed; automatic submission of defects without manual review is prohibited. When C is greater than or equal to... When a failure occurs, it is placed in the suggested handling queue. Failures in the suggested handling queue can be handled after batch confirmation by the user, but they still need to pass the confirmation access control before being submitted to the defect management system. Using the numerical example above, when C is approximately 0.86, it is greater than 0.70, and the failure enters the suggested handling queue; when C is approximately 0.60, it is less than 0.70, and the failure enters the mandatory review queue.

[0064] As an optional implementation, the user can be shown the category label L, category confidence C, and each component of the failed item on the display interface. , , l and The values, rule identifiers, similar historical failure cases, and input and output explanations for the failure steps are provided to help users understand the basis for the classification conclusions when reviewing or confirming them.

[0065] Through the above steps, classification conclusions with low confidence levels are required to be manually reviewed, while classification conclusions with high confidence levels are placed in the recommended disposal queue. This achieves graded processing of failures according to their confidence level, avoiding treating low-confidence conclusions and high-confidence conclusions the same.

[0066] S107, under the constraint of access control, according to the classification labels, the failed items that have passed the review in the mandatory review queue and the failed items in the suggested processing queue are sorted and processed.

[0067] It should be noted that the confirmation access control refers to the manual confirmation checkpoint set up in the triage and processing stage. Any failed item must be confirmed by the user before it can be submitted to the defect management system. The classification confidence level is not used to bypass the confirmation. That is, no matter how high the classification confidence level is, a defect will not be submitted automatically without confirmation.

[0068] Specifically, the handling of failed tests can be categorized into four types based on classification tags: If the classification tag indicates an environmental or resource issue, resource adjustments or test rescheduling will be implemented, such as notifying the scheduling module to adjust resource allocation or rescheduling the test plan; if the classification tag indicates a test case defect, the failed item will be returned to the test case review gate for re-review, and after correcting the test case, it will pass the test case review gate again; if the classification tag indicates a script defect, the failed item will be returned to the fidelity verification for re-verification, and after correcting the script, it will pass the fidelity verification again before being added to the database; if the classification tag indicates a functional defect, the failed item will be submitted to the defect management system after user confirmation, and the defect management system can be, for example, Jira. Furthermore, the test report generated after test execution can be uploaded to the project documentation system, such as Confluence.

[0069] It should be noted that the backtracking classification process and the classification confidence calculation process are interconnected. The backtracking classification process is responsible for obtaining the classification label L of the failed item, and the classification confidence calculation process is responsible for calculating C and classifying the failed item into the corresponding queue. After both are completed, the process enters the triage process under the confirmation gate constraint. A high classification confidence does not mean that the defect can be automatically submitted.

[0070] Through the above steps, different types of failures are guided to their respective handling paths. Use case issues and script issues are returned for correction and re-submitted for corresponding access control verification. Environment and resource issues are fed back to the scheduling stage. Functional defects are submitted to the defect management system only after manual confirmation. This ensures that various issues are handled in a targeted manner and avoids the submission of defects by mistake.

[0071] As an optional implementation, the various processes in the above method can be completed collaboratively by multiple intelligent agents. For example, a commanding intelligent agent can schedule multiple specialized intelligent agents, with different specialized intelligent agents undertaking steps such as use case generation, script generation, scheduling execution, and failure analysis.

[0072] Based on the above description, this application has the following beneficial effects: First, since only test cases that pass the access control verification are written into the test case library, and test scripts generated based on test cases in the test case library must also pass the fidelity verification before being stored in the script library, the test cases and test scripts that enter the execution phase are all subject to quality control. Inconsistencies between test scripts and test cases are discovered and intercepted before being stored in the library, reducing execution failures caused by inconsistencies between scripts and test cases from the source.

[0073] Secondly, since test scripts with matching tags are selected from the script library based on the user's input test intent, and conflict detection is performed on the test resources involved in the selected test scripts before generating the test plan, the test resources are locked and the test plan is generated only when there is no conflict. Therefore, there will be no resource contention between test scripts executed at the same time, avoiding execution failure and misjudgment caused by resource conflicts.

[0074] Furthermore, when a failure occurs in the execution output, the failure is back-classified to obtain a classification label, and the classification confidence corresponding to the classification label is calculated. The classification confidence is a calculable numerical value that represents the system's degree of certainty regarding the classification conclusion. Then, based on the classification confidence and the preset confidence threshold, the failure is assigned to either a mandatory review queue or a suggested handling queue. Therefore, classification conclusions with low certainty are required to be manually reviewed, while classification conclusions with high certainty enter the suggested handling queue to await handling. Failures are processed in a graded manner according to the certainty of the classification conclusion, and low-certainty conclusions are no longer treated the same as high-certainty conclusions.

[0075] Finally, since the handling of failed items is conducted under the constraint of a confirmation gate, regardless of which queue a failed item is assigned to, submission of a defect to the defect management system must be confirmed. Classification confidence cannot be used to bypass confirmation; therefore, even failed items with high confidence will not be automatically submitted as defects, thus avoiding the problem of erroneous defect submissions. In summary, this application achieves quantitative measurement and hierarchical handling of the reliability of failed classification results, solving the problem of low-confidence classification conclusions being treated equally, leading to erroneous handling or even erroneous defect submissions.

[0076] The above text combined Figure 1 This application provides a detailed description of a tag arrangement and backtracking method for automated testing of switches, and the system and equipment provided in this application will be described below with reference to the accompanying drawings.

[0077] like Figure 2 As shown in the figure, this is a schematic diagram of the tag arrangement and backtracking processing system for automated testing of switches provided in an embodiment of this application. The tag arrangement and backtracking processing system 200 for automated testing of switches includes: The test case acquisition module 210 is used to acquire test cases and write the test cases that pass the access control verification into the test case library. The test script generation module 220 is used to generate test scripts based on test cases in the test case library, configure tags for the test scripts, perform fidelity verification on the test scripts, and store the test scripts that pass the fidelity verification into the script library. The test intent matching module 230 is used to filter test scripts with tags that match the test intent from the script library based on the test intent input by the user. The conflict detection module 240 is used to perform conflict detection on the test resources involved in the selected test scripts. If there is no conflict, the test resources are locked and a test plan is generated based on the selected test scripts. The failure classification module 250 is used to collect the output of the test plan execution. When a failure item appears in the output, the failure item is back-classified to obtain the classification label corresponding to the failure item, and the classification confidence corresponding to the classification label is calculated. The queue partitioning module 260 is used to partition the failed items into a mandatory review queue or a suggested handling queue based on the classification confidence level and a preset confidence level threshold. The triage module 270 is used to triage and process failed items that have passed the review in the mandatory review queue and failed items in the suggested processing queue according to the classification labels under the constraint of the access control confirmation.

[0078] Optionally, the switch automated testing tag orchestration and traceability processing system 200 also includes: The test case review and access control verification module is used to perform integrity checks on at least one of the following: identifier, module, preconditions, execution steps, expected results, priority, and related requirements of the test case; and to perform quality checks on at least one of the following: typo check, pairing check, and copy residue check of the test case; and to determine the test cases that pass the integrity check and the quality check as the test cases that pass the test case review and access control verification.

[0079] Optional, the test script generation module 220 is specifically used for: Perform a step alignment check on the test script to verify whether the number and order of steps in the test script are consistent with the number and order of steps in the corresponding test cases. Perform an in-step coverage check on the test script to verify whether the input and output sub-items of each step of the test case are completely covered in the test script; Perform a step completeness check on the test script to verify whether each step of the test script includes input description comments, output description comments, and action and result checks. Perform a custom specification check on the test script to verify whether the test script conforms to the preset script specification rule set; The test script is subjected to a robustness check to verify its cleanup and recovery capabilities in continuous execution scenarios, as well as its timeout handling, exception capture, and failure cleanup capabilities in sudden abnormal scenarios. After the test script passes the step alignment check, in-step coverage check, step completeness check, custom specification check, and robustness check, the fidelity score of the test script is calculated. When the fidelity score of the test script reaches a preset score threshold, the test script is confirmed as having passed the fidelity verification.

[0080] Optional, the collision detection module 240 is specifically used for: Perform serial port mutual exclusion detection on the test resources involved in the selected test scripts. If the same serial port resource is requested by multiple test scripts, it is determined that there is a conflict. A topology type matching check is performed on the test resources involved in the selected test scripts. If the topology type corresponding to the test script does not match the topology type of the available resources, a conflict is determined to exist. The test resources involved in the selected test scripts are checked for port allocation using traffic tools. If the total number of requests to the traffic tool ports exceeds the total number of available ports, a conflict is determined to exist. The device version compatibility of the test resources involved in the selected test scripts is checked. If the version of the switch device under test is incompatible with the version required by the test script, a conflict is determined to exist.

[0081] Optional, the failure category module 250, specifically used for: Based on environmental rules, the failure items are matched according to rules. If the environmental rules support that the failure item is an environmental problem or a resource problem, then the category label corresponding to the failure item is determined to be an environmental problem or a resource problem. If the environmental rules do not support environmental or resource issues, then the failure items are matched for similarity based on the historical failure case library to obtain historical similarity support. If the historical similarity support reaches a preset similarity threshold, then the classification label of the corresponding historical failure case in the historical failure case library will be used as the classification label of the failure item. If the historical similarity support does not reach the preset similarity threshold, the failure item is predicted based on the classification model to obtain the model category probability, and the classification label corresponding to the failure item is determined according to the model category probability.

[0082] Optionally, the failure category module 250 is also specifically used for: Based on the support strength of the environmental rules for the classification labels, obtain the rule support strength; The rule support strength, the historical similarity support, and the model class probability are weighted and fused together, and the classification confidence corresponding to the classification label is obtained by combining the conflict and incompleteness penalty coefficient.

[0083] Optional, the diversion and processing module 270 is specifically used for: If the classification label indicates an environmental or resource issue, then resource adjustments or test rescheduling will be carried out. If the category label indicates a use case defect, the failure item corresponding to the category label will be returned to the use case review access control for re-review; If the category label indicates a script defect, the failed item corresponding to the category label will be returned to the fidelity check for re-verification; If the category label indicates a functional defect, the failure item corresponding to the category label is submitted to the defect management system.

[0084] According to the embodiments of this application, a tag orchestration and backtracking processing system for automated switch testing can be implemented by correspondingly executing the methods described in the embodiments of this application. Furthermore, the other operations and / or functions of each module / unit of the automated switch testing tag orchestration and backtracking processing system are respectively for implementing… Figure 1 For the sake of brevity, the corresponding processes of each method in the illustrated embodiments will not be described in detail here.

[0085] This application also provides a computing device.

[0086] like Figure 3 As shown in the figure, this is a schematic diagram of a computing device provided in an embodiment of this application. The computing device 300 includes a bus 301, a processor 302, a communication interface 303, and a memory 304. The processor 302, the memory 304, and the communication interface 303 communicate with each other via the bus 301.

[0087] Bus 301 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 3 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0088] The processor 302 can be any one or more of the following processors: central processing unit (CPU), graphics processing unit (GPU), microprocessor (MP), or digital signal processor (DSP).

[0089] Communication interface 303 is used for communication with external devices.

[0090] Memory 304 may include volatile memory, such as random access memory (RAM). Memory 304 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0091] The memory 304 stores executable code, and the processor 302 executes the executable code to perform the aforementioned label arrangement and backtracking processing method for automated switch testing.

[0092] Specifically, in achieving Figure 2 In the case of the illustrated embodiment, and Figure 2 When the modules or units of the tag orchestration and backtracking processing system for automated switch testing described in the embodiment are implemented in software, the following steps are performed: Figure 2 The software or program code required for the functions of each module / unit can be partially or entirely stored in memory 304. Processor 302 executes the program code corresponding to each unit stored in memory 304, and executes the aforementioned tag arrangement and backtracking processing method for automated switch testing.

[0093] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the aforementioned tag arrangement and backtracking processing method for automated switch testing.

[0094] The descriptions of the processes or structures corresponding to the above figures each have their own emphasis. For parts of a process or structure that are not described in detail, please refer to the relevant descriptions of other processes or structures.

[0095] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be covered within the scope of protection of this application.

Claims

1. A method for tag arrangement and backtracking processing in automated testing of switches, characterized in that, The method includes: Obtain test cases and write the test cases that pass the access control verification into the test case library; Test scripts are generated based on test cases in the test case library, tags are configured for the test scripts, and fidelity verification is performed on the test scripts. Test scripts that pass the fidelity verification are stored in the script library. Based on the user's input test intent, filter test scripts with tags that match the test intent from the script library; Conflict detection is performed on the test resources involved in the selected test scripts. If no conflict is found, the test resources are locked and a test plan is generated based on the selected test scripts. Collect the output of the test plan. When a failure occurs in the output, backtrack and classify the failure to obtain the classification label corresponding to the failure, and calculate the classification confidence corresponding to the classification label. Based on the classification confidence level and the preset confidence threshold, the failed items are assigned to either the mandatory review queue or the suggested handling queue. Under the constraints of access control, and according to the classification labels, the failed items that passed the review in the mandatory review queue and the failed items in the suggested processing queue are sorted and processed separately.

2. The method according to claim 1, characterized in that, The method further includes: Perform a completeness check on at least one of the following: identifier, module, preconditions, execution steps, expected results, priority, and associated requirements of the test case; Perform at least one of the following quality checks on the test cases: typo check, pairing check, and copy residue check; Test cases that pass the integrity check and the quality check are identified as test cases that pass the access control verification test case audit.

3. The method according to claim 1, characterized in that, The fidelity verification of the test script includes: Perform a step alignment check on the test script to verify whether the number and order of steps in the test script are consistent with the number and order of steps in the corresponding test cases. Perform an in-step coverage check on the test script to verify whether the input and output sub-items of each step of the test case are completely covered in the test script; Perform a step completeness check on the test script to verify whether each step of the test script includes input description comments, output description comments, and action and result checks. Perform a custom specification check on the test script to verify whether the test script conforms to the preset script specification rule set; The test script is subjected to a robustness check to verify its cleanup and recovery capabilities in continuous execution scenarios, as well as its timeout handling, exception capture, and failure cleanup capabilities in sudden abnormal scenarios. After the test script passes the step alignment check, in-step coverage check, step completeness check, custom specification check, and robustness check, the fidelity score of the test script is calculated. When the fidelity score of the test script reaches a preset score threshold, the test script is confirmed as having passed the fidelity verification.

4. The method according to claim 1, characterized in that, The conflict detection of test resources involved in the selected test scripts includes: Perform serial port mutual exclusion detection on the test resources involved in the selected test scripts. If the same serial port resource is requested by multiple test scripts, it is determined that there is a conflict. A topology type matching check is performed on the test resources involved in the selected test scripts. If the topology type corresponding to the test script does not match the topology type of the available resources, a conflict is determined to exist. The test resources involved in the selected test scripts are checked for port allocation using traffic tools. If the total number of requests to the traffic tool ports exceeds the total number of available ports, a conflict is determined to exist. The device version compatibility of the test resources involved in the selected test scripts is checked. If the version of the switch device under test is incompatible with the version required by the test script, a conflict is determined to exist.

5. The method according to claim 1, characterized in that, The backtracking and classification of the failed items to obtain the corresponding classification labels for the failed items includes: Based on environmental rules, the failure items are matched according to rules. If the environmental rules support that the failure item is an environmental problem or a resource problem, then the category label corresponding to the failure item is determined to be an environmental problem or a resource problem. If the environmental rules do not support environmental or resource issues, then the failure items are matched for similarity based on the historical failure case library to obtain historical similarity support. If the historical similarity support reaches a preset similarity threshold, then the classification label of the corresponding historical failure case in the historical failure case library will be used as the classification label of the failure item. If the historical similarity support does not reach the preset similarity threshold, the failure item is predicted based on the classification model to obtain the model category probability, and the classification label corresponding to the failure item is determined according to the model category probability.

6. The method according to claim 5, characterized in that, The calculation of the classification confidence score corresponding to the classification label includes: Based on the support strength of the environmental rules for the classification labels, obtain the rule support strength; The rule support strength, the historical similarity support, and the model class probability are weighted and fused together, and the classification confidence corresponding to the classification label is obtained by combining the conflict and incompleteness penalty coefficient.

7. The method according to claim 6, characterized in that, The step of triaging and processing failed items that passed review in the mandatory review queue and failed items in the suggested processing queue according to the classification labels includes: If the classification label indicates an environmental or resource issue, then resource adjustments or test rescheduling will be carried out. If the category label indicates a use case defect, the failure item corresponding to the category label will be returned to the use case review access control for re-review; If the category label indicates a script defect, the failed item corresponding to the category label will be returned to the fidelity check for re-verification; If the category label indicates a functional defect, the failure item corresponding to the category label is submitted to the defect management system.

8. A tag arrangement and backtracking system for automated testing of switches, characterized in that, The system includes: The test case acquisition module is used to acquire test cases and write the test cases that have passed the access control verification into the test case library; The test script generation module is used to generate test scripts based on test cases in the test case library, configure tags for the test scripts, perform fidelity verification on the test scripts, and store the test scripts that pass the fidelity verification into the script library. The test intent matching module is used to filter test scripts with tags that match the test intent from the script library based on the test intent input by the user. The conflict detection module is used to perform conflict detection on the test resources involved in the selected test scripts. If no conflict exists, the test resources are locked and a test plan is generated based on the selected test scripts. The failure classification module is used to collect the output of the test plan. When a failure occurs in the output, the failure is back-classified to obtain the classification label corresponding to the failure and to calculate the classification confidence corresponding to the classification label. The queue partitioning module is used to partition the failed items into a mandatory review queue or a suggested handling queue based on the classification confidence level and a preset confidence level threshold. The triage module is used to triage and process failed items that have passed the review in the mandatory review queue and failed items in the suggested processing queue according to the classification labels under the constraint of the access control confirmation.

9. A computing device, characterized in that, Including memory and processor; The memory stores one or more computer programs, the one or more computer programs including instructions; when the instructions are executed by the processor, the computing device performs the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program for performing the method as described in any one of claims 1 to 7.