Agent-based demand analysis and test case co-generation system
By using an agent-based system for collaborative generation of requirements analysis and test cases, the problems of manual dependence and insufficient automation in traditional methods are solved. This system enables the transformation from natural language requirements documents to structured data and the generation of test cases, thereby improving the quality and efficiency of software testing.
Patent Information
- Application Number
- CN202610389139.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-27
- Publication Date
- 2026-06-26
AI Technical Summary
Traditional requirements analysis and test case design rely on manual operations, which are prone to information omissions, errors, and inefficiency. They are difficult to adapt to large-scale requirements documents and rapid iterative software development models, and lack standardization and automation methods, which affects software quality and development schedule.
A system based on intelligent agents is adopted for the collaborative generation of requirements analysis and test cases. The Langchain4j intelligent agent and NLP parsing submodule realize the transformation of natural language into structured data. The system combines equivalence class analysis and orthogonal list generation submodules to generate standardized test cases. The Drools rule engine is used to identify and verify business rule conflicts. The data storage and management module provides full-link automation support.
It achieves end-to-end automation from requirement input to test case output, improves the standardization and coverage of test case design, reduces reliance on manual design, and improves the quality and efficiency of software testing.
Smart Images

Figure CN122285506A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software testing technology, specifically to a system for collaborative generation of requirements analysis and test cases based on intelligent agents. Background Technology
[0002] In the software development lifecycle, requirements analysis and test case design are key steps in ensuring software quality. Requirements analysis aims to accurately understand users' expectations for the functionality, performance, and reliability of the software system and translate them into clear requirements specifications. Test case design, based on the requirements specifications, involves designing a series of test cases that comprehensively cover the software's functions and verify its correctness, ensuring that the software can operate normally under various expected and unexpected conditions. As software systems continue to grow in scale and complexity, and as software development models iterate rapidly, higher demands are placed on the automation and standardization of requirements analysis and test case design.
[0003] Current traditional technical solutions suffer from several technical shortcomings. First, requirement documents are primarily in natural language, and the extraction of business processes, rules, and field constraints relies on manual operations. Due to the lack of standardized procedures, omissions and errors are common during manual information extraction, leading to incomplete data. Second, test case design relies heavily on the experience of designers, lacking unified technical standards and automation. Differences in understanding requirements and design methods among designers make it difficult to guarantee the structural consistency and coverage of test cases. Third, logical contradictions between business rules must be manually investigated one by one, lacking automated identification mechanisms. As business rules become increasingly complex, manual contradiction investigation becomes inefficient and prone to overlooking potential logical contradictions, leading to errors during software operation. Fourth, when dealing with large-scale requirement documents, the operational complexity of manual analysis increases dramatically with the document size. Traditional methods are ill-suited to the rapid iteration of software development, failing to respond promptly to requirement changes and impacting software development progress and quality. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of existing technologies by providing an agent-based system for collaborative generation of requirements analysis and test cases. This system achieves a complete automated technology chain through real-time data transmission and deep logical coupling. The requirements interaction and input module is responsible for receiving, preprocessing, and displaying test results for requirement documents. The intelligent requirements analysis module, leveraging the Langchain4j agent and NLP parsing submodule, accurately converts natural language requirement documents into structured data. The test case generation and optimization module uses equivalence class analysis and orthogonal array generation submodules to generate standardized candidate test case sets. The rule conflict detection and verification module, through the Drools rule engine and static verification submodule, completes business rule conflict detection and test case validity verification. The data storage and management module, acting as a data hub, provides data storage, retrieval, and synchronization support for all modules, achieving end-to-end automation from requirement input to test case output. This effectively solves problems in traditional solutions such as reliance on manual requirements analysis, lack of standardized test case design, difficulty in automatically identifying business rule conflicts, and insufficient inter-module collaboration.
[0005] To address the aforementioned technical problems, this invention provides the following technical solution: a system for collaborative generation of intelligent agent-based requirements analysis and test cases, comprising: Requirements Interaction and Input Module: Supports uploading and format / content validation of requirements documents in multiple formats of natural language, can display test-related visual results and support real-time editing of test cases, can connect to external requirements management tools to synchronize document changes, and can transfer validated document data to the intelligent requirements parsing module; The intelligent demand parsing module includes a Langchain4j agent and an NLP parsing submodule. The Langchain4j agent schedules tasks and aggregates results through AgentPool. The NLP parsing submodule extracts entity-relationship-attribute triples based on the domain fine-tuning large model, and transforms natural language into directed graphs, logical expressions, and structured constraint lists, which are then stored in the data storage and management module. Test case generation and optimization module: includes equivalence class analysis submodule and orthogonal array generation submodule. The equivalence class analysis submodule divides equivalence classes and generates boundary values. The orthogonal array generation submodule extracts test factors and level values for optimization and combination, and together generate a set of candidate test cases to be passed to the rule conflict detection and verification module. Rule conflict detection and verification module: includes Drools rule engine and static verification submodule. Drools rule engine identifies rule conflicts and decides priority. Static verification submodule verifies test case consistency and coverage. After generating a report, it is associated with the test case set and temporarily stored in data storage and management module. Data storage and management module: It adopts a dual database architecture of graph database and document database to store structured requirement relationship data and test intermediate data. It supports real-time data synchronization between modules, automatic backup and historical version rollback, and provides data support for each module.
[0006] Furthermore, the Langchain4j agent constructs a distributed task scheduling mechanism through AgentPool, which splits the document parsing task into paragraphs and distributes them to the NLP parsing submodule. At the same time, it monitors the parsing progress of each paragraph in real time, and aggregates and integrates the results after all paragraphs have been parsed. The NLP parsing submodule is based on a large model that has been fine-tuned in the software testing domain. It optimizes the parsing accuracy by injecting a terminology library from the software testing domain. The terminology library contains specialized terms related to requirement parsing and test case design. By using Prompt engineering technology, entity-relationship-attribute triples are extracted from the requirement document to clarify the relationship logic between the core elements of the requirement.
[0007] Furthermore, the NLP parsing submodule extracts entity-relation-attribute triples based on the domain fine-tuning large model, transforms natural language into directed graphs, logical expressions, and a list of structured constraints, and stores them in the data storage and management module. The specific steps are as follows: For the business process description in the requirements document, the mind chain technology is used to transform it into a directed graph structure. The nodes of the directed graph correspond to the business operation steps, and the edges correspond to the triggering conditions and branching logic between the steps. For the business rule descriptions in the requirements document, convert them into executable logical expressions; For field constraint descriptions in the requirements document, the system automatically identifies the numerical range, format requirements, and required attributes to form a structured constraint list. Directed graphs, logical expressions, and structured constraint lists are synchronously stored in the data storage and management module via a dedicated interface.
[0008] Furthermore, in the test case generation and optimization module, the equivalence class analysis submodule reads the structured constraint list from the data storage and management module, and defines valid and invalid equivalence classes according to preset partitioning principles. The preset principles include establishing one valid class and two invalid classes when the input conditions specify a range of values, and establishing one valid class and one invalid class when the input conditions specify a format requirement. The submodule scans the logical definition of field constraints through static code analysis technology, dynamically generates an equivalence class table, and marks the test purpose and corresponding field constraint basis of each equivalence class. At the same time, the submodule extracts the boundary values and neighborhood values in the field constraints to form test points covering boundary scenarios.
[0009] Furthermore, in the test case generation and optimization module, the orthogonal array generation submodule reads the business rule logical expression and structured constraint list from the data storage and management module, extracts test factors and level values, where test factors are the core dimensions affecting test results, and level values are the selectable values for each test factor. Based on the number of test factors and level values, the minimum number of rows in the standard orthogonal array is automatically selected, and the test combinations are optimized using the AllPairs algorithm. All possible test combinations are filtered to retain the minimum set of test cases that satisfy the pairwise factor interaction coverage. For mixed-level scenarios where the number of level values for different test factors is inconsistent, the standard orthogonal array is structurally modified using a parallel method. By splitting high-level factors into multiple equal-level sub-factors, the integrity and interaction coverage of test combinations in mixed scenarios are ensured. The equivalence classes and boundary value test points generated by the equivalence class analysis submodule collaborate with the test combinations optimized by the orthogonal array generation submodule to form a candidate test case set containing valid equivalence class test cases, invalid equivalence class test cases, and boundary value test cases. After associating the test case set with the corresponding requirement constraint information, it is transmitted to the rule conflict detection and verification module through a standardized data interface.
[0010] Furthermore, in the test case generation and optimization module, the orthogonal array generation submodule optimizes the test combinations using the AllPairs algorithm. Calculate the minimum number of rows in an orthogonal array, where To optimize the number of test case groups, For the number of test factors, For the first The number of level values for each test factor is used to filter all possible test combinations and retain the minimum set of test cases that satisfy the pairwise factor interaction coverage.
[0011] Furthermore, in the rule conflict detection and verification module, the Drools rule engine reads the business rule logical expressions generated by the intelligent requirement parsing module, and uses a subgraph isomorphism algorithm to traverse and scan the logical relationships of all rules to identify logical contradictions between rules. Logical contradictions include undefined priorities, overlapping conditions, and contradictory results. For the identified logical contradictions, the engine automatically adjudicates according to the user-preset rule priority strategy and generates a conflict list. The static verification submodule, on the one hand, uses static analysis tools to compare the candidate test cases with the original requirement document descriptions in the data storage and management module to verify whether the candidate test cases deviate from the requirement scope. On the other hand, it quantifies the coverage of the candidate test cases to ensure coverage of all business process paths, business rule conditions, and field constraints. It generates reminder information for coverage items that do not reach the preset coverage threshold, and integrates the conflict list with the coverage and consistency verification results to generate a rule conflict report and a test case verification report, which are temporarily stored in the data storage and management module through the data interface.
[0012] Furthermore, in the rule conflict detection and verification module, the Drools rule engine uses a subgraph isomorphism algorithm to traverse and scan the logical relationships of all rules. Let the logical subgraphs corresponding to two business rules be... , If a node mapping function exists And for any ,have At the same time, the preconditions of the two rules , There is an intersection and the result , If there is an inconsistency, it is determined to be a rule conflict.
[0013] Furthermore, in the rule conflict detection and verification module, for the identified conflicts, through... The priority adjudication formula calculates the priority score, where For the first The rules are assigned priority scores; the higher the score, the higher the priority. As the importance weight of the rules, Score the importance of the rules. Weighting based on the rule's effective time. This is the rule's effective time factor.
[0014] Compared with existing technologies, this agent-based requirement analysis and test case collaborative generation system has the following beneficial effects: First, the equivalence class analysis submodule in the test case generation optimization module divides valid and invalid equivalence classes according to preset principles and generates boundary value test points. Static code analysis technology dynamically generates an equivalence class table with detailed annotations, ensuring comprehensive test case coverage and clear objectives. The orthogonal array generation submodule uses the AllPairs algorithm to select the standard orthogonal array with the minimum number of rows. For mixed-level scenarios, a parallel method is used to effectively optimize multi-factor test combinations. The two submodules work collaboratively, generating a set of candidate test cases that includes valid equivalence classes, invalid equivalence classes, and boundary value test cases. This complete and comprehensive structure reduces reliance on manual test case design, improves the standardization of test case design, and provides a high-quality test case foundation for subsequent testing.
[0015] Second, this invention utilizes the Drools rule engine in the rule conflict detection and verification module to automatically identify logical contradictions between business rules through a subgraph isomorphism algorithm. Based on preset strategy adjudication priorities, it generates a conflict list labeled with conflict rule identifiers, types, and adjudication results, solving the problem of low efficiency in traditional manual conflict investigation. The static verification submodule verifies the consistency between candidate test cases and the requirements document, and quantifies coverage to ensure coverage of all business process paths, business rule conditions, and field constraints. The generated rule conflict report and test case verification report indicate risk levels and modification suggestions, providing clear direction for test case optimization, improving the effectiveness and reliability of test cases, and ensuring the quality of software testing.
[0016] Other advantages, objectives and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination or study, or may be learned from the practice of the invention. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0018] Figure 1 To generate a system structure diagram based on agent-based requirements analysis and test case collaboration; Figure 2 A flowchart for a system that collaboratively generates requirements analysis and test cases based on intelligent agents. Detailed Implementation
[0019] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.
[0020] This invention provides a system for collaborative generation of requirements analysis and test cases based on intelligent agents, such as... Figure 1As shown, the system includes a requirement interaction and input module, an intelligent requirement parsing module, a test case generation and optimization module, a rule conflict detection and verification module, and a data storage and management module. Through real-time data transmission and deep logical coupling, a complete automated technology chain is formed. The requirement interaction and input module is responsible for receiving, preprocessing, and displaying test results for requirement documents. The intelligent requirement parsing module, leveraging the Langchain4j agent and NLP parsing submodule, achieves accurate conversion of natural language requirement documents into structured data. The test case generation and optimization module uses the equivalence class analysis submodule and orthogonal array generation submodule to generate standardized alternative test case sets. The rule conflict detection and verification module, through the Drools rule engine and static verification submodule, completes business rule conflict detection and test case validity verification. The data storage and management module, as the data hub, provides data storage, retrieval, and synchronization support for each module, achieving end-to-end automation from requirement input to test case output. This effectively solves problems in traditional solutions such as manual requirement parsing, lack of standardized test case design, difficulty in automatically identifying business rule conflicts, and insufficient inter-module collaboration. The following is a specific implementation of the agent-based requirement analysis and test case collaborative generation system provided by this invention: Requirements analysis and testing for the order management system, such as Figure 2 As shown, users upload requirement documents for the e-commerce platform's order management system through the system's visual interactive interface provided by the requirement interaction and input module. This module is configured to support common text and format document types during deployment. The validation rules cover both format completeness and content validity. First, a comprehensive check of the document format is performed to identify issues such as garbled characters, incomplete pages, and format incompatibility. Documents with abnormal formats receive clear error messages and guidance on correction through the visual interface. After format validation, the content validity is further validated through keyword matching and semantic scanning. This checks whether the document contains parsable natural language requirement descriptions, and whether core business processes and rules are clearly stated, ensuring the document has analytical value. A validation date is also generated. The system provides a viewing entry on the interface for users to review the specific verification results. Furthermore, it has pre-configured interface parameters with commonly used requirement management tools on e-commerce platforms, enabling real-time monitoring and synchronization of requirement changes. Upon successful verification, a visual interface returns a successful upload feedback message to the user. The system also fully synchronizes the document data to the intelligent requirement parsing module via a standardized data interface, initiating the parsing task. Simultaneously, the system initializes the visual display templates within the interface, including a column-based business process diagram, a test case classification list, and coverage statistics charts, awaiting subsequent data loading. When the requirement document in external tools is updated, the system automatically triggers a re-parsing process, and the parsing status is synchronized to the visual interface in real time, ensuring users are promptly informed.
[0021] After receiving document data, the intelligent requirement parsing module relies on the deployed Langchain4j framework to achieve distributed task scheduling, progress monitoring, and result aggregation. The framework has a built-in task queue and retry mechanism to ensure orderly collaboration among multiple modules and a stable parsing process. The Langchain4j agent first performs a structured decomposition of the document according to business dimensions, dividing it into independent subtasks based on core business scenarios such as order process, payment verification, inventory scheduling, discount rules, and after-sales association. These subtasks are assigned to the NLP parsing submodule, which monitors the parsing progress and status of each subtask in real time. The parsing progress is synchronously fed back to the visualization interface of the requirement interaction and input module. The retry mechanism is automatically triggered for subtasks that fail to be parsed to avoid omissions or duplicate parsing. The NLP parsing submodule connects to a large model API that has been fine-tuned specifically in the software testing field. It has a well-configured terminology library in the software testing field and sets parsing parameters such as text segmentation threshold and core element extraction confidence threshold. After loading the model and terminology library, it performs in-depth parsing of the document segment by segment: accurately extracting entity-relationship-attribute triples through Prompt engineering technology, sorting out core business objects, inter-object relationship logic, and key attribute features; targeting The business process described in natural language is constructed using Chain-of-Thought technology to build a structured directed graph, clarifying the business operation steps corresponding to nodes, the triggering conditions and branch logic corresponding to edges, and fully preserving the relationship between the main process and all abnormal branches. For conditional business rule descriptions, they are transformed into standardized executable logical expressions, clarifying the preconditions, execution logic and output results. For field constraint descriptions, the system automatically identifies constraint types such as numerical range, format specifications, required attributes, and enumeration restrictions, and organizes them into a structured constraint list, marking the business scenarios corresponding to the constraints. For ambiguous requirements identified during the parsing process, the submodule automatically marks and records them in the parsing log. The log can be supplemented by users through the visual interface of the requirement interaction and input module. After all subtasks are parsed, the Langchain4j agent aggregates and integrates the structured data, handles cross-segment logical relationships and data complementarity, and classifies and stores the directed graph, logical expressions, structured constraint list and other data into the corresponding database through a dedicated interface. At the same time, it generates a business process diagram that conforms to UML specifications and synchronizes it to the visual interface of the requirement interaction and input module for preview.
[0022] The test case generation and optimization module reads structured constraint lists, business rule logical expressions, and directed graph data of business processes from the data storage and management module. This module is configured with detailed equivalence class partitioning principles, boundary value extraction strategies, and orthogonal table selection and modification rules. The equivalence class analysis submodule, according to preset principles, partitions valid and invalid equivalence classes for different types of field constraints one by one, ensuring that the input scenarios corresponding to each constraint are fully covered. Based on the boundary value extraction strategy, it accurately extracts the boundary values and neighborhood values of various constraints as core test points, ensuring the effective verification of boundary scenarios and critical states. Through static code analysis technology, it scans the logical definitions of field constraints and dynamically generates an equivalence class table. The table clearly marks the test purpose, constraint basis, applicable business scenarios, and association rules of each equivalence class. It also supports users to manually supplement custom equivalence classes through requirement interaction and the visual interface of the input module. The orthogonal table generation submodule comprehensively extracts test factors from the structured data and clarifies the level values corresponding to each test factor. Based on the number of test factors and the number of level values, it optimizes the test combination through the AllPairs algorithm. Calculate the minimum number of rows in an orthogonal array, where To optimize the number of test case groups, For the number of test factors, For the first The system counts the number of level values for each test factor and filters all possible test combinations, retaining the minimum set of test cases that satisfy pairwise factor interaction coverage, significantly reducing redundant test cases. For mixed-level scenarios where the number of level values for different test factors varies, a parallel approach is used to restructure the standard orthogonal array, ensuring the completeness and rationality of the test combinations, while maintaining a modification log to record the adjustment process. Two sub-modules collaboratively integrate valid equivalence class test cases, invalid equivalence class test cases, and boundary value test cases to form a standardized set of alternative test cases. Each test case is associated with corresponding requirement constraints, test objectives, applicable scenarios, and associated business rule IDs, and is transmitted to the rule conflict detection and verification module through a standardized data interface. The test case set generation progress is synchronized to the visualization interface.
[0023] After receiving the candidate test case set, the rule conflict detection and verification module, relying on the integrated Drools rule engine, completes conflict detection, priority adjudication, and logical verification of business rules. The engine supports dynamic loading and hot updates of rules to ensure that the verification logic is synchronized with the requirements. This module has been configured with a rule priority weight system, scoring criteria, and adjudication mechanism; configured with coverage threshold standards and a reminder trigger mechanism when the threshold is not reached; and configured with consistency verification dimensions, covering semantic consistency between test cases and requirement descriptions, field constraint matching consistency, and rule execution logic consistency. The Drools rule engine reads all business rule logical expressions from the data storage and management module and performs a comprehensive traversal scan of the logical relationships between rules through a subgraph isomorphic conflict detection algorithm. Let the logical subgraph corresponding to two business rules be... , If a node mapping function exists And for any ,have At the same time, the preconditions of the two rules , There is an intersection and the result , Inconsistencies are identified as rule conflicts, and various logical conflicts such as undefined priorities, overlapping conditions, and contradictory results are identified. Based on a pre-defined weighting system and scoring criteria, a rule priority adjudication algorithm is used. The system calculates the priority score of conflict rules, determines the priority of rules based on their scores, generates a detailed conflict list, and clearly marks the conflict rule identifier, conflict type, decision result, and basis. The static verification submodule uses professional static analysis tools to align and compare the candidate test cases with the original requirements document description one by one, verifying whether the test cases deviate from the requirements scope and whether the test logic is consistent with the requirements. Inconsistent test cases are marked for confirmation and associated with the corresponding requirements fragments. Through coverage quantification logic, the system calculates the actual percentage of process paths, business rule conditions, and field constraints covered by the test cases, generating accurate coverage metrics. If there are dimensions that do not reach the preset threshold, targeted reminders and optimization suggestions are automatically generated. The conflict list, coverage metrics, and consistency verification results are integrated to generate a structured rule conflict report and test case verification report. The reports can be exported to PDF format through the visual interface of the requirements interaction and input module, clearly marking the level, scope of impact, and modification suggestions of various risks. After being associated with the candidate test case set, the reports are temporarily stored in the data storage and management module.
[0024] After receiving various types of data from other modules, the data storage and management module, relying on the deployed Neo4j graph database and MongoDB document database, and combined with the server's configured scalable storage resources, processes the data according to a preset storage strategy: Structured requirement relationship data, such as directed graphs, logical expressions, and structured constraint lists generated by the intelligent requirement parsing module, is stored in the Neo4j graph database according to the business element association logic. The database is indexed and optimized to ensure clear and traceable relationships between business process nodes, rules, and field constraints, and query response time is controlled within a preset range. Unoptimized test case combinations and alternative test case sets output by the test case generation and optimization module, as well as conflict lists and verification reports generated by the rule conflict detection and verification module, are cached according to timestamps and business scenarios. The module supports data compression storage to save space. Furthermore, it is configured with a real-time data synchronization mechanism, initiating an event-driven data synchronization process. When data in the database is updated, a synchronization notification is immediately triggered, pushing the updated data to the requirement interaction and input module and other related modules, ensuring real-time consistency of data used by all modules. Simultaneously, a complete backup of all currently stored data is performed according to a preset automatic backup cycle. Backup files are stored encrypted, generating timestamped backup versions. Integrity verification of the backup data is also performed, recording backup version information and verification results in the backup log, establishing a comprehensive historical version traceability system. Users can quickly roll back to a specified version by timestamp through the visual interface of the requirement interaction and input module, ensuring data security and traceability.
[0025] The requirement interaction and input module reads business process diagrams, alternative test case sets, coverage metrics, and rule conflict reports from the data storage and management module. Relying on the server's stable network transmission capabilities, it displays these in a structured manner according to preset templates through its own system's visual interactive interface: The business process diagram adopts a layered display method, clearly presenting each operation step, triggering condition, and associated rule, and supports hovering the mouse to view step details; The test case list is categorized and displayed according to dimensions such as equivalence class type, test purpose, and associated business scenarios. Each test case is labeled with the corresponding constraint basis, test logic, associated requirement ID, and verification status, and the interface supports batch operation of test cases; The coverage metrics are presented intuitively in the form of a pie chart and detailed table, with dimensions that do not meet the standard marked with a red warning and associated with details of the uncovered items; The rule conflict report is displayed in order of risk level, detailing the conflict content, involved rule IDs, adjudication results, and modification suggestions, and supports jumping to view associated test cases. Users can conduct a comprehensive review of candidate test cases through this visual interface. They can view the associated requirement fragments, verification results, and conflict impacts of each test case, confirm the ruling results of rule conflicts, and make modifications directly on the interface if they have any suggestions. The relevant modification information is transmitted to the data storage and management module in real time through the data synchronization mechanism to ensure data consistency throughout the entire process. After the review is completed, the interface supports exporting the final test case set in a preset format. The exported file contains complete fields such as test case ID, test purpose, input conditions, expected results, and associated requirement ID. It can be directly connected to external test execution tools to provide standardized and comprehensive test case support for the subsequent testing execution of the e-commerce platform order management system.
[0026] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.
Claims
1. A system for collaborative generation of requirements analysis and test cases based on intelligent agents, characterized in that, The system includes: Requirements Interaction and Input Module: Supports uploading and format / content validation of requirements documents in multiple formats of natural language, can display test-related visual results and support real-time editing of test cases, can connect to external requirements management tools to synchronize document changes, and can transfer validated document data to the intelligent requirements parsing module; The intelligent demand parsing module includes a Langchain4j agent and an NLP parsing submodule. The Langchain4j agent schedules tasks and aggregates results through AgentPool. The NLP parsing submodule extracts entity-relationship-attribute triples based on the domain fine-tuning large model, and transforms natural language into directed graphs, logical expressions, and structured constraint lists, which are then stored in the data storage and management module. Test case generation and optimization module: includes equivalence class analysis submodule and orthogonal array generation submodule. The equivalence class analysis submodule divides equivalence classes and generates boundary values. The orthogonal array generation submodule extracts test factors and level values for optimization and combination, and together generate a set of candidate test cases to be passed to the rule conflict detection and verification module. Rule conflict detection and verification module: includes Drools rule engine and static verification submodule. Drools rule engine identifies rule conflicts and decides priority. Static verification submodule verifies test case consistency and coverage. After generating a report, it is associated with the test case set and temporarily stored in data storage and management module. Data storage and management module: It adopts a dual database architecture of graph database and document database to store structured requirement relationship data and test intermediate data. It supports real-time data synchronization between modules, automatic backup and historical version rollback, and provides data support for each module.
2. The agent-based requirement analysis and test case collaborative generation system according to claim 1, characterized in that, The Langchain4j agent constructs a distributed task scheduling mechanism through AgentPool, which splits the document parsing task into paragraphs and distributes them to the NLP parsing sub-module. At the same time, it monitors the parsing progress of each paragraph in real time, and aggregates and integrates the results after all paragraphs have been parsed. The NLP parsing submodule is based on a large model that has been fine-tuned in the field of software testing. It optimizes parsing accuracy by injecting a terminology library from the software testing field, which contains specialized terms related to requirements parsing and test case design. By using Prompt engineering techniques, it extracts entity-relationship-attribute triples from the requirements document to clarify the logical relationships between the core elements of the requirements.
3. The agent-based requirement analysis and test case collaborative generation system according to claim 1, characterized in that, The NLP parsing submodule extracts entity-relation-attribute triples based on the domain fine-tuning large model, transforms natural language into directed graphs, logical expressions, and structured constraint lists, and stores them in the data storage and management module. The specific steps are as follows: For the business process description in the requirements document, the mind chain technology is used to transform it into a directed graph structure. The nodes of the directed graph correspond to the business operation steps, and the edges correspond to the triggering conditions and branching logic between the steps. For the business rule descriptions in the requirements document, convert them into executable logical expressions; For field constraint descriptions in the requirements document, the system automatically identifies the numerical range, format requirements, and required attributes to form a structured constraint list. Directed graphs, logical expressions, and structured constraint lists are synchronously stored in the data storage and management module via a dedicated interface.
4. The agent-based requirement analysis and test case collaborative generation system according to claim 1, characterized in that, In the test case generation and optimization module, the equivalence class analysis submodule reads the structured constraint list from the data storage and management module, and defines valid and invalid equivalence classes according to preset partitioning principles. The preset principles include establishing one valid class and two invalid classes when the input conditions specify a range of values, and establishing one valid class and one invalid class when the input conditions specify a format requirement. The submodule scans the logical definition of field constraints through static code analysis technology, dynamically generates an equivalence class table, and marks the test purpose and corresponding field constraint basis of each equivalence class. At the same time, the submodule extracts the boundary values and neighborhood values in the field constraints to form test points covering boundary scenarios.
5. The agent-based requirement analysis and test case collaborative generation system according to claim 1, characterized in that, In the test case generation and optimization module, the orthogonal array generation submodule reads the business rule logical expression and structured constraint list from the data storage and management module, and extracts test factors and level values. The test factors are the core dimensions that affect the test results, and the level values are the selectable values for each test factor. Based on the number of test factors and the number of level values, the standard orthogonal array with the minimum number of rows is automatically selected. The test combinations are optimized using the AllPairs algorithm. All possible test combinations are filtered to retain the minimum set of test cases that satisfy the pairwise factor interaction coverage. For mixed-level scenarios where the number of level values for different test factors is inconsistent, a parallel approach is used to restructure the standard orthogonal array. By splitting high-level factors into multiple equal-level sub-factors, the integrity and interactive coverage of test combinations in mixed scenarios are ensured. The equivalence classes and boundary value test points generated by the equivalence class analysis submodule collaborate with the test combinations optimized by the orthogonal array generation submodule to form a set of alternative test cases containing valid equivalence class test cases, invalid equivalence test cases, and boundary value test cases. After associating the corresponding requirement constraint information, this test case set is transmitted to the rule conflict detection and verification module through a standardized data interface.
6. The agent-based requirement analysis and test case collaborative generation system according to claim 5, characterized in that, In the test case generation and optimization module, the orthogonal array generation submodule optimizes the test combinations using the AllPairs algorithm. Calculate the minimum number of rows in an orthogonal array, where To optimize the number of test case groups, For the number of test factors, For the first The number of level values for each test factor is used to filter all possible test combinations and retain the minimum set of test cases that satisfy the pairwise factor interaction coverage.
7. The agent-based requirement analysis and test case collaborative generation system according to claim 1, characterized in that, In the rule conflict detection and verification module, the Drools rule engine reads the business rule logic expression generated by the intelligent requirement parsing module, and scans the logical correlation of all rules through the subgraph isomorphism algorithm to identify logical contradictions between rules. Logical contradictions include undefined priority, overlapping condition conflicts, and result contradictions. For the identified logical contradictions, the engine automatically adjudicates according to the user-preset rule priority strategy and generates a conflict list. The static verification submodule uses static analysis tools to compare candidate test cases with the original requirements document descriptions in the data storage and management module to verify whether the candidate test cases deviate from the requirements scope. On the other hand, it quantifies the coverage of candidate test cases to ensure coverage of all business process paths, business rule conditions, and field constraints. It generates reminder information for coverage items that do not reach the preset coverage threshold and integrates the conflict list with the coverage and consistency verification results to generate rule conflict reports and test case verification reports, which are then temporarily stored in the data storage and management module through the data interface.
8. The agent-based requirement analysis and test case collaborative generation system according to claim 7, characterized in that, In the rule conflict detection and verification module, the Drools rule engine uses a subgraph isomorphism algorithm to traverse and scan the logical relationships of all rules. Let the logical subgraphs corresponding to two business rules be... , If a node mapping function exists And for any ,have At the same time, the preconditions of the two rules , There is an intersection and the result , If there is an inconsistency, it is determined to be a rule conflict.
9. The agent-based requirement analysis and test case collaborative generation system according to claim 7, characterized in that, In the rule conflict detection and verification module, for the identified conflicts, through... The priority adjudication formula calculates the priority score, where For the first The rules are assigned priority scores; the higher the score, the higher the priority. As the importance weight of the rules, Score the importance of the rules. Weighting based on the rule's effective time. This is the rule's effective time factor.