A method and system for generating test cases based on requirements documents and automatically performing UI testing.

By constructing a multi-agent collaborative architecture and an MCP global scheduling mechanism, the system achieves automatic parsing of requirement documents, intelligent generation of test cases, automatic execution of UI automated tests, and intelligent analysis of results. This solves the problems of low test case generation efficiency, uneven coverage, poor adaptability, and fragmented processes in existing technologies, thereby improving testing efficiency and coverage while reducing costs.

CN123114980APending Publication Date: 2026-11-17INSPUR QILU SOFTWARE IND
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611490341.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-23
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing technologies suffer from low test case generation efficiency, uneven coverage, poor adaptability, and fragmented processes. Furthermore, UI automated testing is disconnected from requirement documents and lacks agent collaboration and MCP global scheduling, resulting in low testing efficiency, insufficient coverage, high costs, and poor adaptability.

Method used

A multi-agent collaborative architecture and a global scheduling mechanism of the main control node MCP are constructed. Through the requirement parsing agent, test case generation agent, UI automation execution agent, and result analysis agent, the automatic parsing of requirement documents, intelligent generation of test cases, automatic execution of UI automation tests, and intelligent analysis of test results are realized, thus opening up the entire process and reducing manual intervention.

Benefits of technology

Significantly improves test case generation efficiency by over 80%, reduces UI automated test execution time by 70%, increases test coverage to 95%, reduces testing costs, ensures consistency between test cases and requirements, and improves software testing quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123114980A_ABST
    Figure CN123114980A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for generating test cases based on requirement documents and automatically performing UI testing. Belonging to the fields of software testing and artificial intelligence technology, it is implemented based on a multi-agent collaborative architecture and a master control node (MCP) global scheduling mechanism. The multi-agent collaborative architecture includes a requirement parsing agent, a test case generation agent, a UI automation execution agent, a result analysis agent, and a master scheduling agent, with each agent encapsulating unique skills. This invention achieves automatic parsing of requirement documents, intelligent generation of test cases, automatic execution of UI automation testing, and intelligent analysis and feedback of test results. It connects the entire requirement and testing process, reduces manual intervention, improves testing efficiency and coverage, lowers testing costs, and enables automatic adaptation after requirement updates, ensuring consistency between test cases, test scripts, and requirements, thereby improving software testing quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of software testing and artificial intelligence technology, specifically to a method and system for generating test cases based on requirements documents and automatically performing UI testing. Background Technology

[0002] Software testing is a core component for ensuring software product quality and reducing development risks. UI automated testing, in particular, has become one of the mainstream software testing methods due to its ability to replace repetitive manual operations and improve testing efficiency. Test case design is the foundation of UI automated testing, and its quality directly determines the testing effect. Currently, test case design largely relies on manual work by testers, requiring them to deeply understand requirements documents, analyze business logic, and combine experience to design test cases covering both normal and abnormal scenarios. This process lacks agent collaboration and specialized skill encapsulation, resulting in low levels of process intelligence. Existing technologies mainly suffer from the following shortcomings: First, test case generation is inefficient. Manually designing test cases requires a lot of manpower and time. Especially when faced with complex requirement documents or products that iterate frequently, the update speed of test cases is difficult to keep up with the pace of requirement iteration, which easily leads to test lag. There is a lack of autonomous parsing by agents and automated generation capabilities driven by skills. Second, the test case coverage is uneven. Due to the limited experience and cognition of testers, manually designed test cases are prone to missing edge scenarios and abnormal scenarios, resulting in insufficient testing and potential software quality problems. The scenario coverage is not achieved through multi-skill collaboration of Agent and global scheduling of MCP. Third, UI automated testing is disconnected from the requirements document. When the requirements document is updated, test cases and automated test scripts need to be manually modified, which is costly to adapt and prone to omissions and inconsistencies. There is a lack of skill linkage between agents and synchronization control mechanism of MCP. Fourth, the testing process is fragmented, with requirements analysis, test case generation, UI automation execution, and test result analysis being independent of each other. There is a lack of unified global intelligent scheduling of MCP and agent collaboration, requiring manual intervention to connect them, which further reduces testing efficiency and increases the probability of human error. The modular encapsulation of agent skills and the closed-loop collaboration of the whole process have not been achieved.

[0003] Furthermore, while some existing automated testing tools can generate simple test cases or automate UI execution, they cannot achieve a complete closed loop from requirements documentation to test case generation, UI automated test execution, and result analysis. Their ability to parse requirements documents is limited, making it difficult to accurately extract key test points. The generated test cases lack specificity and still require significant manual optimization. They also lack a professional agent architecture, layered skill encapsulation, and MCP master control scheduling, thus failing to achieve intelligent collaboration throughout the entire process. Therefore, there is an urgent need for a method that can connect the entire process of requirements documentation and UI automated testing through agent collaboration, professional skill-driven approaches, and MCP global scheduling, enabling automatic test case generation, automatic test execution, and intelligent result analysis. This would address the shortcomings of existing technologies, such as low efficiency, insufficient coverage, poor adaptability, and fragmented processes. Summary of the Invention

[0004] The technical objective of this invention is to address the above-mentioned shortcomings by providing a method and system for generating test cases based on requirements documents and automatically performing UI testing. This method enables automatic parsing of requirements documents, intelligent generation of test cases, automatic execution of UI automated testing, and intelligent analysis and feedback of test results. It connects the entire process of requirements and testing, reduces manual intervention, improves testing efficiency and coverage, reduces testing costs, and achieves automatic adaptation after requirements are updated, ensuring the consistency of test cases, test scripts, and requirements, thereby improving the quality of software testing.

[0005] The technical solution adopted by this invention to solve its technical problem is: A method for generating test cases based on requirements documents and automatically performing UI testing is implemented using a multi-agent collaborative architecture and a master control node (MCP) global scheduling mechanism. The multi-agent collaborative architecture includes a requirements parsing agent, a test case generation agent, a UI automation execution agent, a result analysis agent, and a master scheduling agent. Each agent encapsulates unique skills. The method includes the following steps: S1. Multi-Agent Deployment, Skills Encapsulation, and MCP Initialization Configuration: Build the MCP main control node, deploy each intelligent agent and assign functional permissions and data interaction rules to each agent; the main scheduling agent, as the core execution unit of the MCP, is responsible for global process scheduling and agent status monitoring; encapsulate exclusive skills for each agent; complete the initialization configuration of the rule base, test framework, test environment, encrypted communication, and collaborative logs. S2. Import and Automated Parsing of Requirements Documents: Users upload requirements documents in various formats to MCP, which then forwards them to the Requirements Parsing Agent. The Requirements Parsing Agent uses its own skills to perform document noise reduction, unstructured text structuring conversion, and extracts key points for UI interaction, data verification, and abnormal scenario testing based on NLP algorithms and the requirements parsing rule base. It then outputs a standardized requirements parsing report and sends it back to MCP. S3. Intelligent generation and optimization of test case sets: MCP sends the requirement analysis report to the test case generation agent through the main scheduling agent; the agent automatically generates standardized test cases by combining the test case template library and equivalence class / boundary value / scenario method test coverage criteria, and uses skills to complete test case deduplication, redundancy reduction, and supplementation of edge abnormal scenarios; after generating a complete test case set, it is verified for compliance by the main scheduling agent. If the verification fails, it is returned for re-optimization. S4. Automated Script Conversion and UI Test Execution: MCP sends the verified test case set to the UI automation execution agent; the agent executes sequentially: generating executable test scripts by adapting the script conversion skills to the Web / mobile / desktop automation framework, and optimizing script stability with multi-dimensional control positioning and exception handling skills; it supports parallel execution of multiple test cases, automatically retrying a preset number of times when positioning failures or script exceptions occur during execution, and recording operation logs, control status, and actual execution results throughout the process and reporting them to MCP in real time; S5. Intelligent Analysis and Report Output of Test Results: Test execution data is synchronized to the result analysis agent. The agent compares the actual execution results with the expected results in the requirement analysis report, automatically calculates the test case pass rate and test coverage, performs defect root cause classification on failed test cases, and generates a test analysis report containing anomaly screenshots, logs, and optimization and improvement plans. MCP summarizes the complete set of test data and pushes it to the user terminal for persistent storage. S6. Requirements Iteration Adaptation and Agent Self-Learning Upgrade: After the requirements document is updated, it is re-imported into MCP, automatically triggering the entire process of steps S2-S5. Each agent updates test cases and automation scripts synchronously based on the change points. MCP drives each agent to self-learn and iterate based on historical test data and user feedback, continuously optimizing the algorithm parameters and execution logic of each skill, and synchronously updating the MCP global scheduling strategy.

[0006] This method overcomes the problems of low test case generation efficiency, uneven coverage, poor requirement adaptability, and fragmented testing process in existing software UI automation testing technologies. It provides a method for generating test cases from requirement documents and automatically performing UI automation testing using intelligent agents. By constructing a multi-agent collaborative architecture, encapsulating the unique skills of each agent, and introducing a master control node (MCP) for global scheduling, it achieves automatic parsing of requirement documents, intelligent generation of test cases, automatic execution of UI automation tests, and intelligent analysis and feedback of test results. This method connects the entire process of requirements and testing, reduces manual intervention, improves testing efficiency and coverage, reduces testing costs, and enables automatic adaptation after requirement updates, ensuring the consistency of test cases, test scripts, and requirements, thereby improving the quality of software testing.

[0007] Furthermore, in step 1, each Agent is encapsulated with its own skills: Requirements Analysis: Agent configuration requirements preprocessing, NLP parsing, and extraction of key test points skills; Test Case Generation: Agent configuration test case generation, deduplication optimization, and supplementary skills for abnormal scenarios; UI Automation Execution: Agent configuration script conversion, multi-dimensional control positioning, exception retries, and parallel execution skills; Result Analysis: Agent configuration result comparison, defect root cause analysis, test metric calculation, and optimization suggestion generation skills.

[0008] Furthermore, in step S1, the data interaction between Agents and between MCP and each Agent adopts the AES-256 encryption communication mechanism, and the requirement document, parsing report, test case, scheduling instruction, and execution log are transmitted in full with encryption. The UI control recognition model adopts a deep learning pre-trained model and integrates control recognition and localization skills from the demand parsing agent and the UI automation execution agent. MCP adopts a distributed scheduling architecture that supports concurrent operation of multiple agents and skills.

[0009] Furthermore, the requirement parsing rule base described in step S2 supports user-defined configuration updates; The requirements analysis report includes priority identifiers for each functional module. The test case generation agent sorts test cases according to priority, and the UI automation execution agent executes test tasks in order of priority.

[0010] Furthermore, in step S3, the test case template library distinguishes between standardized templates for Web, mobile, desktop, and different business modules, and supports users to add or modify custom templates. The compliance checks performed by the main scheduling agent include test case format checks, scenario integrity checks, and expected result reasonableness checks. If a check fails, the specific reason for the exception is returned synchronously.

[0011] Furthermore, the automation framework in step S4 includes Playwright, Appium, and PyAutoGUI; Control positioning employs a multi-dimensional combination of ID, XPath, CSS, and text; the script incorporates page waiting and network fluctuation fault tolerance mechanisms. Parallel execution skills initiate multi-process synchronous execution for uncoupled test modules, with the default retry count configured to 3 times in case of exceptions.

[0012] Furthermore, in step S5, a distributed database is used to store the full test data, which has the ability to automatically back up and restore data. The test analysis report includes the execution performance of each Agent skill, statistics on the execution time of a single test case, and provides specific optimization solutions for inefficient skills and long-running test cases.

[0013] Furthermore, the method also includes a manual intervention mechanism: users can manually edit requirement analysis reports, test cases, and automation scripts through the MCP terminal, monitor the Agent's running status in real time, and pause or terminate the test process. All manual operation records are stored in the collaborative log for subsequent Agent iteration and optimization.

[0014] This invention also claims protection for a system that generates test cases based on requirements documents and automatically performs UI testing, including: The MCP main control and scheduling module is used for global process management, Agent instruction distribution, data transfer, scheduling log storage, and manual interaction entry point. The multi-intelligent agent module includes a requirement parsing agent unit, a test case generation agent unit, a UI automation execution agent unit, a result analysis agent unit, and a main scheduling agent unit. Each unit has a built-in corresponding skill execution engine. The rules and template storage module is used to store the requirement parsing rule library, test case template library, UI control deep learning recognition model, and automation framework configuration parameters; The distributed data storage module persistently saves requirement documents, parsing reports, test cases, automation scripts, execution logs, test reports, and Agent skill iteration parameters. The encrypted communication module uses the AES-256 algorithm to achieve end-to-end encrypted data transmission. The test environment scheduling module uniformly manages the test runtime environment of browsers, mobile emulators, and desktops, and supports multi-process parallel testing. This system can implement the methods described above.

[0015] The present invention also claims a computer-readable medium storing computer instructions that, when executed by a processor, enable the implementation of the above-described method.

[0016] Compared with existing technologies, the method and system of the present invention for generating test cases based on requirements documents and automatically performing UI testing have the following advantages: 1. By constructing a multi-agent collaborative architecture, encapsulating exclusive skills for each agent, and introducing an MCP master control node to achieve global scheduling, a closed loop is established for the entire process of requirement document parsing, test case generation, UI automation execution, and result analysis. This achieves full automation and intelligence of the testing process, significantly reducing manual intervention and solving the problems of fragmented testing processes and high manual costs in existing technologies. Through the professional driving force of agent skills and the efficient scheduling of MCP, the efficiency of test case generation is improved by more than 80%, and the execution time of UI automation tests is shortened by more than 70%, significantly improving software testing efficiency.

[0017] 2. By employing natural language processing algorithms combined with a requirement parsing rule base, and leveraging the specialized skills of the requirement parsing agent, precise parsing of requirement documents is achieved. This enables the automatic extraction of core information such as functional requirements and UI interaction requirements. Combined with the test case generation agent's multiple skills and test coverage criteria, test cases are generated. Simultaneously, test cases for edge scenarios and abnormal scenarios are supplemented. Through global management by MCP, full scenario coverage is ensured, effectively solving the defects of uneven coverage and missed scenarios in manually designed test cases. Test coverage is increased to over 95%, ensuring sufficient testing and reducing potential software quality risks.

[0018] 3. Achieve automatic adaptation to requirement updates. When the requirement document is updated, MCP schedules each Agent to synchronously start the corresponding skills to complete the re-parsing of requirements, update test cases, and optimize test scripts. This ensures the consistency between test cases, test scripts and requirements, avoids omissions and errors caused by manual synchronization modifications, significantly reduces the test adaptation cost after requirement iteration, adapts to the development needs of rapid software iteration, and records the change trajectory through MCP for easy follow-up.

[0019] 4. Optimize the generation and execution mechanism of UI automated test scripts. By using multi-dimensional controls of the UI automated execution agent to locate skills, capture exceptions, and execute skills in parallel, the stability and execution efficiency of test scripts are improved, and the test execution failure rate is reduced. At the same time, through MCP to drive the self-learning and upgrading of each agent, the skill parameters and execution logic of each agent are optimized synchronously, continuously improving the accuracy and stability of testing. It is adaptable to the testing needs of different types of UI applications (Web, mobile, desktop), has strong versatility, and can be widely promoted and applied.

[0020] 5. By introducing encrypted communication mechanisms, data backup mechanisms, manual intervention mechanisms, and MCP global monitoring mechanisms, the system ensures the security and integrity of test data, Agent skill parameters, and MCP scheduling instructions, while also adapting to testing needs in special scenarios and improving the practicality and reliability of the method. The generated test result analysis report includes detailed root cause analysis, optimization suggestions, and Agentskills execution performance statistics, which facilitates users to quickly locate defects, optimize testing processes, and iterate Agent skills and applications under test. Attached Figure Description

[0021] Figure 1 This is a flowchart illustrating a method for generating test cases based on requirements documents and automatically performing UI testing, as provided in an embodiment of the present invention. Detailed Implementation

[0022] The present invention will be further described below with reference to specific embodiments.

[0023] This invention provides a method for generating test cases based on requirement documents and automatically performing UI automated testing. This method is implemented based on a multi-agent collaborative architecture and a global scheduling mechanism of the main control node (MCP). The multi-agent collaborative architecture includes a requirement parsing agent, a test case generation agent, a UI automation execution agent, a result analysis agent, and a main scheduling agent. Each agent encapsulates unique skills, and data interaction and collaborative work are achieved through a preset communication protocol and the global control of the MCP. (See attached...) Figure 1 As shown, the method includes the following steps: S1. Agent Deployment, Skills Encapsulation and MCP Initialization Configuration: Deploy the main scheduling agent, requirement parsing agent, test case generation agent, UI automation execution agent and result analysis agent, build the MCP main control node, and clarify the functional permissions, interaction rules and scheduling permissions of each agent and the MCP.

[0024] The main scheduling agent, as the core execution unit of the MCP, is responsible for global process scheduling, agent status management, and data collaboration. The requirement parsing agent encapsulates specialized skills such as requirement preprocessing, NLP parsing, and test key point extraction, and is responsible for parsing requirement documents and extracting test key points. The test case generation agent encapsulates skills such as test case generation, deduplication optimization, and compliance verification, and is responsible for generating standardized test cases based on test key points. The UI automation execution agent encapsulates skills such as script conversion, control positioning, and test execution, and is responsible for UI automation script conversion and test execution of test cases. The result analysis agent encapsulates skills such as result comparison, root cause analysis, and report generation, and is responsible for verifying, analyzing, and providing feedback on test results.

[0025] Initialize and configure all Agents, skills, and MCPs, including: importing preset requirement parsing rule base, test case template library, UI control recognition model, and automated testing framework configuration parameters; calibrating the parameters of each Agent's skills to ensure skill execution accuracy and collaborative compatibility; setting the communication port, data interaction format, and encryption method for each Agent; configuring the MCP scheduling cycle and status monitoring threshold; configuring test environment parameters, including the deployment address of the UI application to be tested, test account permissions, and test environment dependencies (operating system, browser version, mobile emulator parameters, etc.); initializing Agent collaboration logs and MCP scheduling logs to record operation data, skill execution status, and exception information at each stage, facilitating subsequent traceability and optimization.

[0026] S2. Requirements Document Import and Automated Parsing by Agent: Users import software requirements documents into the MCP, which then forwards them to the requirements parsing agent. These requirements documents can be in Word, Excel, PDF, or Markdown formats, and both structured and unstructured requirements documents are supported. The requirements parsing agent activates its encapsulated skills and uses Natural Language Processing (NLP) algorithms combined with a requirements parsing rule base to perform layered parsing of the requirements document. The requirement analysis agent first removes redundant information and format noise using requirement preprocessing skills, converting unstructured text into structured text. Second, it extracts core information from the requirements using NLP parsing and test key point extraction skills, including functional requirements, UI interaction requirements, data validation requirements, and abnormal scenario requirements. UI interaction requirements include control operations (click, input, selection, swiping, etc.), page navigation logic, and control display rules. Finally, it standardizes the extracted requirement information using result standardization skills, generating a requirement analysis report that clarifies the test key points, UI control identifiers, interaction flows, and expected results for each functional module. This report is then fed back to the MCP (Multi-Channel Programming Platform), which synchronizes it to the main scheduling agent.

[0027] S3. Automatic Generation of Test Case Agents and Skills Optimization: MCP forwards the requirement analysis report to the test case generation agent through the main scheduling agent. The test case generation agent activates its encapsulated skills and, based on the requirement analysis report, combines the test case template library and test coverage criteria (including equivalence class partitioning, boundary value analysis, scenario-based testing, and error guessing) to automatically generate standardized test cases. For each key testing point, corresponding test cases are generated using test case generation skills. These test cases include a test number, test module, test scenario, preconditions, UI operation steps, input data, and expected results. Simultaneously, test case optimization skills are used to deduplicate and redundancy-correct the generated test cases, eliminating duplicate test scenarios and invalid test cases. Abnormal scenario supplementation skills are used to supplement test cases for edge scenarios and abnormal scenarios (such as illegal input data, abnormal control clicks, network interruption scenarios, etc.), improving test case coverage. After optimization, test case set generation skills are used to generate a test case set, which is then fed back to the MCP (Multi-Channel Programming Platform). The MCP uses the main scheduling agent to perform compliance verification on the test case set. If the verification passes, it proceeds to the next stage; otherwise, it returns to the test case generation agent, and the skills are restarted for re-optimization.

[0028] S4. UI Automation Test Script Conversion and Agent Auto-Execution: MCP forwards the validated test case set to the UI automation execution agent through the main scheduling agent. The UI automation execution agent then activates its encapsulated skills to perform the following operations: S41. Script Conversion: Through script conversion skills, based on a preset automated testing framework (supporting Web-based Playwright, Mobile-based Appium, Desktop-based PyAutoGUI, etc.), the UI operation steps in test cases are automatically converted into executable automated test scripts. The scripts contain UI control positioning statements, operation statements, data input statements, and expected result verification statements. Among them, UI control positioning uses multi-dimensional positioning skills, adopting multi-dimensional positioning methods (ID positioning, XPath positioning, CSS positioning, text positioning) to ensure the accuracy of control positioning and avoid positioning failure due to changes in UI control layout. S42. Script Optimization: Optimize the converted automated test scripts using the script optimization skills, adding waiting mechanisms and exception handling mechanisms to handle abnormal situations such as control loading delays and network fluctuations, ensuring the stability of the test scripts; at the same time, merge scripts of related test cases using the script merging skills to reduce script redundancy and improve execution efficiency. S43. Automatic Execution: By executing skills through tests, the UI automated execution agent calls the test environment that has been initialized and configured, starts the UI application to be tested, and executes the automated test scripts in the order of the test case set. The operation logs, control status, and actual execution results during the test process are recorded in real time. The execution process data and skill execution status are fed back to the MCP in real time, and the MCP updates the collaboration logs and scheduling logs synchronously.

[0029] S5. Intelligent Analysis of Test Results by Agent and Feedback from MCP: After the test execution is completed, the UI automated execution agent forwards complete test execution data (including execution results, operation logs, exception screenshots, and skill execution logs) to the result analysis agent. Simultaneously, the MCP synchronizes the expected results from the requirements analysis report to the result analysis agent. The result analysis agent then activates its own encapsulated skills, comparing the actual test execution results with the expected results one by one, and generates a test result analysis report. By comparing results, the Skills tool clearly identifies the number of passed test cases, failed test cases, and unexecuted test cases. Root cause analysis is then used to analyze the root causes of failed test cases, distinguishing between deviations in requirement parsing, unreasonable test case design, UI control anomalies, test script defects, and defects in the application under test itself. Screenshots and logs of the failure scenarios are also annotated. Simultaneously, the Skills tool calculates core metrics such as test coverage and pass rate, and generates optimization suggestions (including test case optimization directions, test script improvement plans, and defect fixes for the application under test). The results analysis agent feeds back the test results analysis report to the MCP. The MCP then uses the main scheduling agent to summarize the test case set, automated test scripts, and test results analysis report, and pushes them to the user terminal. At the same time, the results are stored in a preset database for easy access, traceability, and subsequent optimization by the user. The MCP also records the skill execution performance of each agent to provide data support for subsequent skill optimization.

[0030] S6. Requirements Update Adaptation and Agent / Skills Iteration and Upgrade: When the requirements document is updated, the user re-imports the updated requirements document into the MCP. The MCP triggers the process iteration mechanism, instructing each relevant agent to start the corresponding skills through the main scheduling agent, repeating steps S2-S5. The requirements parsing agent re-parses the updated requirements document and extracts the requirements change points; the test case generation agent automatically updates the test case set based on the requirements change points, deletes redundant test cases, and adds test cases related to the changes; the UI automation execution agent synchronously updates the automated test scripts to ensure the consistency of test cases, test scripts, and requirements. Meanwhile, based on historical test data, user feedback, and optimization suggestions, MCP schedules each Agent to perform self-learning upgrades, synchronously optimizing the skill parameters and execution logic of each Agent: the requirement parsing Agent optimizes the parsing algorithm and parsing skills to improve the accuracy of requirement extraction; the test case generation Agent optimizes the test case generation rules and corresponding skills to improve test coverage and targeting; the UI automation execution Agent optimizes the control positioning method, script stability, and related skills to reduce the test execution failure rate; and the result analysis Agent optimizes the root cause analysis algorithm and analysis skills to improve the accuracy of defect localization. MCP synchronously updates the scheduling strategy to ensure the efficiency of Agent collaboration and skill execution.

[0031] This invention provides a method for generating test cases based on a requirements document and automatically performing UI automated testing. Based on the method described above, in step S1, The default communication protocol uses an encrypted communication mechanism to encrypt the data exchanged between agents (requirement documents, parsing reports, test cases, execution data, etc.) and MCP scheduling instructions. The AES-256 encryption algorithm is used to prevent data leakage and tampering.

[0032] The UI control recognition model is pre-trained using a deep learning algorithm. The pre-training samples include screenshots and feature data of various UI controls (buttons, input boxes, drop-down boxes, pop-ups, etc.). After training, the model is integrated with the control recognition skills of the demand parsing agent and the location skills of the UI automation execution agent, supporting automatic recognition and identification extraction of UI controls.

[0033] MCP adopts a distributed scheduling architecture that supports parallel collaboration among multiple agents and concurrent execution of skills, thereby improving scheduling efficiency.

[0034] This invention provides a method for generating test cases based on a requirements document and automatically performing UI automated testing. Based on the method described in the above embodiments, in step S2, The requirement parsing rule base includes requirement classification rules, test key point extraction rules, and UI interaction requirement identification rules. Users can customize and update these rules according to the actual product type and test requirements, and synchronously adapt them to the relevant skills of the requirement parsing agent.

[0035] The requirement analysis report also includes requirement priority division. The test case generation agent prioritizes test cases based on requirement priority and sorts them by priority skills. The UI automation execution agent executes test cases in priority order, prioritizing core functional modules to improve testing efficiency. The MCP synchronously records priority execution status to optimize subsequent scheduling strategies.

[0036] This invention provides a method for generating test cases based on a requirements document and automatically performing UI automated testing. Based on the method described in the above embodiments, in step S3, The test case template library includes standardized test case templates for different types of applications (web applications, mobile applications, desktop applications) and different functional modules (login module, data entry module, query module, payment module, etc.). Users can customize, add, and modify templates to adapt to the testing needs of different scenarios, and synchronously update the template call skills of the test case generation Agent.

[0037] The compliance verification includes test case format verification, test scenario integrity verification, and expected result rationality verification. It is performed by the main scheduling agent through the verification skills. When the verification fails, the MCP provides feedback on the specific reason for the verification failure, which helps the test case generation agent to accurately optimize the corresponding skills and test cases.

[0038] This invention provides a method for generating test cases based on a requirements document and automatically performing UI automated testing. Based on the method described in the above embodiments, in step S4... The UI automation execution agent supports parallel execution of test cases. By executing skills in parallel, multiple test processes can be started simultaneously for unrelated test modules, and the corresponding automated test scripts can be executed in parallel, which greatly shortens the test execution time.

[0039] During test execution, if an exception occurs such as test script execution failure or control positioning failure, the UI automation execution agent will automatically trigger a retry mechanism through exception handling skills. The number of retries can be preset (default 3 times). If a retry fails, it will be marked as a test failure, the exception information will be recorded, and subsequent test cases will continue to be executed to avoid a single exception from interrupting the entire test process. The exception information will be synchronously reported to MCP for subsequent traceability and optimization.

[0040] This invention provides a method for generating test cases based on a requirements document and automatically performing UI automated testing. Based on the method described above, in step S5, The database is a distributed database that supports the storage and fast querying of large amounts of test data (test cases, execution logs, result reports, Agent skill parameters, MCP scheduling logs, etc.), and also supports data backup and recovery functions to prevent test data loss.

[0041] The test result analysis report also includes test time statistics and Agent skill performance statistics. For test cases with long execution times and skills with low performance, optimization suggestions are generated to shorten the test cycle and optimize Agent skill performance.

[0042] This invention provides a method for generating test cases based on requirements documents and automatically performing UI automated testing. Based on the method described above, this method also includes a manual intervention mechanism. Users can manually edit and optimize the requirements parsing report, test case set, and automated test scripts through the MCP terminal. After editing, the code is submitted to the MCP, which triggers subsequent processes. Simultaneously, users can monitor the running status of each agent and the execution status of skills through the MCP. During test execution, users can manually pause or terminate the test process, view real-time test progress and execution data, adapt to testing requirements in special scenarios, and the MCP synchronously records manual intervention operations to optimize subsequent scheduling and agent skill configuration.

[0043] This invention also provides a system for generating test cases based on requirements documents and automatically performing UI testing, comprising: The MCP main control and scheduling module is used for global process management, Agent instruction distribution, data transfer, scheduling log storage, and manual interaction entry point. The multi-intelligent agent module includes a requirement parsing agent unit, a test case generation agent unit, a UI automation execution agent unit, a result analysis agent unit, and a main scheduling agent unit. Each unit has a built-in corresponding skill execution engine. The rules and template storage module is used to store the requirement parsing rule library, test case template library, UI control deep learning recognition model, and automation framework configuration parameters; The distributed data storage module persistently saves requirement documents, parsing reports, test cases, automation scripts, execution logs, test reports, and Agent skill iteration parameters. The encrypted communication module uses the AES-256 algorithm to achieve end-to-end encrypted data transmission. The test environment scheduling module uniformly manages the test runtime environment of browsers, mobile emulators, and desktops, and supports multi-process parallel testing. This system can implement the method described in the above embodiments for generating test cases based on requirements documents and automatically performing UI testing.

[0044] This invention also provides a computer-readable medium storing computer instructions. When executed by a processor, these instructions implement the method described above for generating test cases based on requirements documents and automatically performing UI testing. Specifically, a system or apparatus equipped with a storage medium storing software program code that implements the functions of any of the embodiments described above can be provided, enabling the system or apparatus's computer (or CPU or MPU) to read and execute the program code stored in the storage medium.

[0045] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of the present invention.

[0046] Storage media embodiments for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.

[0047] Furthermore, it should be clear that not only can the program code read by the computer be executed, but also the operating system or other components operating on the computer can be instructed based on the program code to perform some or all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0048] Furthermore, it is understood that the program code read from the storage medium is written to the memory set in the expansion board inserted into the computer or to the memory set in the expansion unit connected to the computer. Then, based on the instructions of the program code, the CPU or other components installed on the expansion board or expansion unit execute some and all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0049] The present invention has been shown and described in detail above with reference to the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above embodiments, those skilled in the art will know that more embodiments of the present invention can be obtained by combining the code review methods in the different embodiments. These embodiments are also within the protection scope of the present invention.

Claims

1. A method for generating test cases based on requirements documents and automatically performing UI testing, characterized in that, This method is implemented based on a multi-agent collaborative architecture and a master control node (MCP) global scheduling mechanism. The multi-agent collaborative architecture includes a requirement parsing agent, a test case generation agent, a UI automation execution agent, a result analysis agent, and a master scheduling agent. Each agent encapsulates its own unique skills. The method includes the following steps: S1. Multi-Agent Deployment, Skills Encapsulation, and MCP Initialization Configuration: Build the MCP main control node, deploy each intelligent agent and assign functional permissions and data interaction rules to each agent; the main scheduling agent, as the core execution unit of the MCP, is responsible for global process scheduling and agent status monitoring; encapsulate exclusive skills for each agent; complete the initialization configuration of the rule base, test framework, test environment, encrypted communication, and collaborative logs. S2. Import and Automated Parsing of Requirements Documents: Users upload requirements documents in various formats to MCP, which then forwards them to the Requirements Parsing Agent. The Requirements Parsing Agent uses its own skills to perform document noise reduction, unstructured text structuring conversion, and extracts key points for UI interaction, data verification, and abnormal scenario testing based on NLP algorithms and the requirements parsing rule base. It then outputs a standardized requirements parsing report and sends it back to MCP. S3. Intelligent generation and optimization of test case sets: MCP sends the requirement analysis report to the test case generation agent through the main scheduling agent; The Agent automatically generates standardized test cases by combining a test case template library and equivalence class / boundary value / scenario-based test coverage criteria. Skills are used to deduplicat test cases, reduce redundancy, and supplement edge and abnormal scenarios. After generating a complete test case set, it undergoes compliance verification by the main scheduling agent. If the verification fails, it is returned for re-optimization. S4. Automated Script Conversion and UI Test Execution: MCP sends the verified test case set to the UI automation execution agent; the agent executes in sequence: through script conversion skills, it adapts to the Web / mobile / desktop automation framework to generate executable test scripts, and optimizes script stability with the help of multi-dimensional control positioning and exception capture skills; It supports parallel execution of multiple test cases, automatically retrying a preset number of times when location failure or script exception occurs during operation, and records operation logs, control status and actual execution results throughout the process and reports them to MCP in real time. S5. Intelligent Analysis and Report Output of Test Results: Test execution data is synchronized to the result analysis agent. The agent compares the actual execution results with the expected results in the requirement analysis report, automatically calculates the test case pass rate and test coverage, performs defect root cause classification on failed test cases, and generates a test analysis report containing anomaly screenshots, logs, and optimization and improvement plans. MCP summarizes the complete set of test data and pushes it to the user terminal for persistent storage. S6. Requirements Iteration Adaptation and Agent Self-Learning Upgrade: After the requirements document is updated, it is re-imported into MCP, which automatically triggers the entire process of steps S2-S5. Each Agent updates test cases and automation scripts synchronously based on the change points. MCP is driven by historical test data and user feedback to learn and iterate on each agent, continuously optimizing the algorithm parameters and execution logic of each skill, and updating the MCP global scheduling strategy in sync.

2. The method for generating test cases based on requirements documents and automatically performing UI testing according to claim 1, characterized in that, In step 1, each Agent is encapsulated with its own skills: Requirements analysis: Agent configuration requirements preprocessing, NLP parsing, and extraction of key test points skills; Test case generation: Agent configuration test case generation, deduplication optimization, and supplementary skills for abnormal scenarios; UI automation execution: Agent configuration script conversion, multi-dimensional control positioning, exception retries, and parallel execution of skills; Result analysis: Agent configuration result comparison, defect root cause analysis, test metric calculation, and optimization suggestion generation skills.

3. The method for generating test cases based on requirements documents and automatically performing UI testing according to claim 1, characterized in that, In step S1, the data interaction between Agents and between MCP and each Agent adopts the AES-256 encryption communication mechanism, and the requirement document, parsing report, test case, scheduling instruction and execution log are transmitted in full with encryption. The UI control recognition model adopts a deep learning pre-trained model and integrates control recognition and localization skills from the demand parsing agent and the UI automation execution agent. MCP adopts a distributed scheduling architecture that supports concurrent operation of multiple agents and skills.

4. The method for generating test cases based on requirements documents and automatically performing UI testing according to claim 1, characterized in that, The requirement parsing rule base described in step S2 supports user-defined configuration updates; The requirements analysis report includes priority identifiers for each functional module. The test case generation agent sorts test cases according to priority, and the UI automation execution agent executes test tasks in order of priority.

5. The method for generating test cases based on requirements documents and automatically performing UI testing according to claim 1, characterized in that, In step S3, the test case template library distinguishes between standardized templates for Web, mobile, desktop, and different business modules, and supports users to add or modify custom templates. The compliance checks performed by the main scheduling agent include test case format checks, scenario integrity checks, and expected result reasonableness checks. If a check fails, the specific reason for the exception is returned synchronously.

6. The method for generating test cases based on requirements documents and automatically performing UI testing according to claim 1, characterized in that, The automation framework in step S4 includes Playwright, Appium, and PyAutoGUI; Control positioning employs a multi-dimensional combination of ID, XPath, CSS, and text; the script incorporates page waiting and network fluctuation fault tolerance mechanisms. Parallel execution skills initiate multi-process synchronous execution for uncoupled test modules, with the default retry count configured to 3 times in case of exceptions.

7. The method for generating test cases based on requirements documents and automatically performing UI testing according to claim 1, characterized in that, In step S5, a distributed database is used to store the full test data, which has the ability to automatically back up and restore data. The test analysis report includes the execution performance of each Agent skill, statistics on the execution time of a single test case, and provides specific optimization solutions for inefficient skills and long-running test cases.

8. The method for generating test cases based on requirements documents and automatically performing UI testing according to claim 1, characterized in that, It also features a manual intervention mechanism: users can manually edit requirement analysis reports, test cases, and automation scripts through the MCP terminal, monitor the Agent's running status in real time, and pause or terminate the test process. All manual operation records are stored in the collaborative log for subsequent Agent iteration and optimization.

9. A system that generates test cases based on requirements documents and automatically performs UI testing, characterized in that: include: The MCP main control and scheduling module is used for global process management, Agent instruction distribution, data transfer, scheduling log storage, and manual interaction entry point. The multi-intelligent agent module includes a requirement parsing agent unit, a test case generation agent unit, a UI automation execution agent unit, a result analysis agent unit, and a main scheduling agent unit. Each unit has a built-in corresponding skill execution engine. The rules and template storage module is used to store the requirement parsing rule library, test case template library, UI control deep learning recognition model, and automation framework configuration parameters; The distributed data storage module persistently saves requirement documents, parsing reports, test cases, automation scripts, execution logs, test reports, and Agent skill iteration parameters. The encrypted communication module uses the AES-256 algorithm to achieve end-to-end encrypted data transmission. The test environment scheduling module uniformly manages the test runtime environment of browsers, mobile emulators, and desktops, and supports multi-process parallel testing. The system is capable of implementing the method described in any one of claims 1 to 8.

10. A computer-readable medium, characterized in that, The computer-readable medium stores computer instructions that, when executed by a processor, enable the implementation of the method described in any one of claims 1 to 8.