Automatic software development system based on multi-agent cooperation

An automated software development system based on multi-agent collaboration solves the problems of misunderstanding of requirements and poor information transmission in traditional software development, realizes an efficient and automated software development process, generates high-quality code and test cases, and improves the efficiency and quality of software development.

CN121349876APending Publication Date: 2026-01-16BEIJING FORESTRY UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511473523.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-15
Publication Date
2026-01-16

AI Technical Summary

Technical Problem

Traditional software development suffers from problems such as misunderstandings of requirements, inconsistent design quality, code quality heavily influenced by individual abilities, low testing efficiency, and poor information flow, leading to long development cycles, high costs, and difficulty in guaranteeing quality.

Method used

An automated software development system based on multi-agent collaboration is adopted, including a requirements analysis agent, a detailed design agent, a project development agent, and a shared workspace. Through natural language processing, UML modeling, function-level development processes, and automated testing, it realizes the automatic generation of requirements specification documents, system architecture design, code development, and test case generation.

Benefits of technology

It improved the accuracy and standardization of requirements, generated high-quality design specification documents, enabled automated and incremental code development, and improved test coverage and accuracy, thereby shortening the software development cycle and improving software quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121349876A_ABST
    Figure CN121349876A_ABST
Patent Text Reader

Abstract

The invention provides an automatic software development system based on multi-agent cooperation, and the system comprises a demand analysis agent which is used for receiving a natural language demand input by a shared working area, generating a demand specification document containing an acceptance standard based on the natural language demand, and sending the demand specification document to the shared working area; the detailed design agent is used for receiving a demand specification document input by the shared working area, performing system design based on the demand specification document, generating a design specification document and sending the design specification document to the shared working area; the project development agent is used for receiving a design specification document input by the shared working area, performing code development based on the design specification document, generating an executable code and sending the executable code to the shared working area; and the shared working area is used for storing and forwarding the natural language demand input by the user and the output of the demand analysis intelligent agent, the detailed design intelligent agent and the project development intelligent agent. The development efficiency can be improved, the labor cost is reduced, and the software quality is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of software engineering technology, and more specifically, to an automated software development system based on multi-agent collaboration. Background Technology

[0002] Traditional software development typically involves multiple phases, such as requirements analysis, design, coding, and testing, each requiring personnel with different professional backgrounds. In the requirements analysis phase, developers need to communicate extensively with users, translating their natural language requirements into software requirements specifications. This process is prone to misunderstandings, leading to inaccurate requirements.

[0003] During the design phase, system architecture and class diagrams need to be designed based on the requirements specification document. This process relies heavily on the experience and skill level of the developers, resulting in inconsistent design quality. In the coding phase, developers need to write code based on the design documents. Code quality is significantly affected by individual technical abilities, and development efficiency is difficult to guarantee. In the testing phase, testers need to write test cases based on the requirements specification document. The coverage and accuracy of test cases directly affect software quality, but manually writing test cases is inefficient and prone to omissions. Furthermore, poor information flow between different stages of the software development process can easily lead to information loss or misunderstandings, resulting in long development cycles, high costs, and difficulty in guaranteeing quality.

[0004] Therefore, the reliance on manual operation at each stage of software development is inefficient and prone to errors; poor information flow between stages leads to long development cycles and high costs; and the lack of unified automation tools to integrate the entire software development process makes it difficult to guarantee software quality. Summary of the Invention

[0005] This invention provides an automated software development system based on multi-agent collaboration to address the problems of low efficiency and poor software quality in existing automated software development processes. An automated software development system based on multi-agent collaboration includes:

[0006] A requirements analysis agent is used to receive natural language requirements input from the shared workspace, generate a requirements specification document containing acceptance criteria based on the natural language requirements, and send it to the shared workspace.

[0007] A detailed design agent is used to receive the requirement specification document input from the shared workspace, perform system design based on the requirement specification document, generate a design specification document and send it to the shared workspace.

[0008] The project development agent is used to receive design specification documents input from the shared workspace, develop code based on the design specification documents, generate executable code, and send it to the shared workspace.

[0009] A shared workspace is used to store and forward the natural language requirements input by the user, as well as the outputs of the requirements analysis agent, detailed design agent, and project development agent.

[0010] Furthermore, the demand analysis agent includes:

[0011] Demand extension unit, used to generate standardized user story sets based on natural language requirements;

[0012] The use case generation unit is used to generate use case diagrams based on the standardized user story set, and to convert the use case diagrams into natural language before submitting them for user review.

[0013] The requirement confirmation unit is used to adjust the standardized user story set and regenerate the use case diagram based on the user's review feedback until the user confirms it.

[0014] The acceptance criteria generation unit is used to generate acceptance criteria for each user story based on a standardized set of user stories after user confirmation, using the Gherkin language.

[0015] The requirement matrix generation unit is used to divide the standardized user story set into modules and prioritize them, and generate functional requirement information and non-functional requirement information.

[0016] The document integration unit is used to integrate the standardized user story set, use case diagram, acceptance criteria, functional requirements information and non-functional requirements information to form a requirements specification document.

[0017] Furthermore, the acceptance criterion generation unit includes:

[0018] The scene generation subunit is used to generate one or more Gherkin scenes for each user story;

[0019] The specification defines sub-units, which are executable specifications that describe user behavior using the Given-When-Then keyword structure, and obtains acceptance criteria.

[0020] Furthermore, the detailed design of the intelligent agent includes:

[0021] The architecture design unit is used to design the architecture based on the user story set and use case diagram in the requirements specification document, generate the system architecture diagram, and generate component specifications based on the system architecture diagram. The component specifications include component names, component functions, and component interface specifications.

[0022] The class diagram generation unit is used to identify entities, attributes and relationships in the software system to be developed based on the user story set, and generate a conceptual class diagram;

[0023] The sequence diagram generation unit is used to transform the execution flow of each user story into an interaction sequence between components based on the user story set, concept class diagram, and system architecture diagram, and generate a detailed sequence diagram.

[0024] The design document integration unit is used to integrate the system architecture diagram, component specifications, conceptual class diagram, and detailed sequence diagram to form a design specification document.

[0025] Furthermore, the sequence map generation unit includes:

[0026] The priority processing subunit is used to determine the sequence diagram generation order of the user stories according to the priority of the user story set;

[0027] The component mapping subunit is used to map components in the system architecture diagram to objects in the detailed sequence diagram.

[0028] The message definition subunit is used to determine the data structure of each interaction message in the detailed sequence diagram based on the class attributes defined in the conceptual class diagram and the component interface specifications defined in the component specification.

[0029] The sequence generation subunit is used to establish message passing relationships between component objects according to the sequence diagram generation order, based on the mapped objects and the determined interaction message data structure, and generate a detailed sequence diagram corresponding to each user story.

[0030] Furthermore, the intelligent agent developed in the project includes:

[0031] The directory generation unit is used to generate a hierarchical code directory structure based on the system architecture diagram in the design specification document.

[0032] The component mapping unit is used to map the components defined in the system architecture diagram to the corresponding code files in the hierarchical code directory structure according to the component specifications, and to establish the binding relationship between the components and the code files.

[0033] The task decomposition unit is used to decompose each user story into incremental development tasks for one or more code files based on the detailed sequence diagram in the design specification document and the binding relationship.

[0034] The code generation unit is used to generate executable code for each of the incremental development tasks using a function-level development process.

[0035] Furthermore, the code generation unit includes:

[0036] The planning subunit is used to analyze the requirements of the incremental development task, determine one or more target functions to be created or modified, and design the function name, input parameters, return value type and functional logic description for each target function.

[0037] The encoding subunit is used to generate initial function code based on the functional logic description using a large language model or code template engine;

[0038] The code building subunit is used to integrate the generated initial function code into its corresponding target code file to obtain the final executable code.

[0039] Furthermore, the system also includes a test and acceptance agent, which receives executable code and acceptance criteria from the shared workspace and the requirements specification document, generates test cases based on the acceptance criteria and executable code, executes tests, and outputs a test report.

[0040] Furthermore, the test and acceptance agent includes:

[0041] The unit test case generation unit is used to generate unit test cases based on the acceptance criteria in the requirements specification document.

[0042] The interface test case generation unit is used to generate interface test cases based on the acceptance criteria and the dependency relationship between the interface code files.

[0043] The test execution unit is used to call an external encoder tool, taking the executable code and the test cases as input, to perform unit tests and interface tests.

[0044] The report generation unit is used to receive unit test and interface test results, generate test reports, and send them to the shared workspace.

[0045] Furthermore, the shared workspace includes:

[0046] The subscription management unit is used to define the subscription relationships between the requirements analysis agent, the detailed design agent, and the project development agent.

[0047] The subscription execution unit is used to forward the natural language requirements input by the user to the requirements analysis agent; and to send the requirements specification document to the detailed design agent and the test acceptance agent based on the subscription relationship, send the design specification document to the project development agent, and send the test report to the user terminal.

[0048] The embodiments of the present invention have at least the following beneficial effects:

[0049] 1. By using a requirements analysis agent to transform natural language requirements into standardized user story sets, use case diagrams, and acceptance criteria, biases in understanding requirements are avoided, and the accuracy and standardization of requirements are improved, thereby enhancing the overall efficiency and quality of software development.

[0050] 2. Detailed design of intelligent agents: Based on the requirements specification document, system architecture design, class diagram generation, and sequence diagram generation are performed. This can generate high-quality, well-structured design specification documents, reducing the reliance on developers' experience in the design phase and improving the overall efficiency and quality of software development.

[0051] 3. The project development agent develops code according to the design specifications and uses a function-level development process to generate executable code, which realizes automated and incremental development of code development, improves code readability and maintainability, and reduces human coding errors. At the same time, the testing and acceptance agent can automatically generate test cases and execute tests based on acceptance criteria, which improves test coverage and accuracy, thereby effectively shortening the software development cycle and improving the final quality of the software.

[0052] In this invention, the above-described technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of this invention will be set forth in the following description, and some advantages may become apparent from the description or be learned by practicing the invention. The objects and other advantages of this invention can be realized and obtained from what is particularly pointed out in the description and drawings. Attached Figure Description

[0053] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts.

[0054] Figure 1 This is a schematic diagram of the structure of an automated software development system based on multi-agent collaboration, provided in an embodiment of the present invention. Detailed Implementation

[0055] The principles and spirit of the invention will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are provided merely to enable those skilled in the art to better understand and implement the invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided to make the invention more thorough and complete, and to fully convey the scope of the invention to those skilled in the art.

[0056] It should be noted that the number of any elements in the accompanying drawings is for illustrative purposes only and not as a limitation, and any naming is for distinction only and has no limiting meaning.

[0057] The following is for reference. Figure 1 , Figure 1 This is a schematic diagram of the structure of an automated software development system based on multi-agent collaboration, provided in an embodiment of the present invention. Figure 1 As shown, an automated software development system based on multi-agent collaboration includes:

[0058] The requirements analysis agent receives natural language requirements input from the shared workspace, generates a requirements specification document containing acceptance criteria based on the natural language requirements, and sends it to the shared workspace.

[0059] The requirements analysis agent receives natural language requirements and transforms them into standardized requirements specification documents. It uses natural language processing technology to understand the user's input and generates a requirements specification document containing acceptance criteria. Natural language requirements are unstructured software functional requirements described by the user in natural language. Acceptance criteria are specific standards used to verify whether the software functions meet the user's requirements, typically written in Gherkin for automated testing.

[0060] Specifically, the demand analysis agent includes:

[0061] The requirement extension unit is used to generate standardized user story sets based on natural language requirements. User stories are a standard requirement representation format used in agile development to describe functional requirements. A standardized user story set is a collection of user stories that have undergone standardization and have a consistent structure. User stories can be used to guide the model to decompose requirements and format the output by calling application programming interfaces (APIs) of large-scale language models, such as OpenAI's GPT-4 API.

[0062] The use case generation unit is responsible for generating use case diagrams based on the standardized user story set, and then converting these diagrams into natural language before submitting them for user review. A use case diagram is a unified modeling language diagram used to visualize the interaction relationships between system functions (use cases) and external actors (roles). Based on the generated user story set, the use case generation unit uses UML modeling tools such as PlantUML to automatically generate use case diagrams. After generating the diagrams, the unit uses a large language model to convert the graphical elements into coherent natural language descriptions and submits them to the user through a web user interface.

[0063] The requirement confirmation unit is used to adjust the standardized user story set and regenerate the use case diagram based on user review feedback until the user confirms it. The requirement confirmation unit receives user review feedback, adjusts the user story set according to the feedback, and iteratively regenerates the use case diagram by re-invoking the language model or using a rule-based engine such as Drools, until the user finally confirms it.

[0064] The Acceptance Criteria Generation Unit is used to generate acceptance criteria for each user story based on the standardized user story set after user confirmation, using the Gherkin language. Specifically, the Acceptance Criteria Generation Unit writes acceptance conditions for each confirmed user story in the confirmed standardized user story set using the Gherkin language. Gherkin is a structured, domain-specific language for behavior-driven development.

[0065] Furthermore, the acceptance criteria generation unit includes:

[0066] The scenario generation subunit is used to generate one or more Gherkin scenarios for each user story. A user story typically encompasses a normal flow, an alternative flow, and an abnormal flow; therefore, each user story can be divided into one or more independent test scenarios. For example, for the user story "User Login," the scenario generation subunit can divide it into multiple scenarios such as "Successful Login," "Login Failed with Incorrect Password," "Attempted Login with a Non-existent Username," and "Account Temporarily Locked After Consecutive Incorrect Password Entry." In implementation, the scenario generation subunit can generate Gherkin scenarios by calling OpenAI's GPT-4 model application programming interface.

[0067] The specification definition subunit is used to describe executable specifications for user behavior using the Given-When-Then keyword structure, thus obtaining acceptance criteria. The specification definition subunit adopts the Gherkin language syntax framework. Each text uses the Given, When, and Then keywords. The Given keyword is used to set the initial context and system state for scenario execution; the When keyword is used to describe the key operation performed by the user or the decisive event triggered by the system; and the Then keyword is used to assert the explicit result or state change that the system must present after this operation. During implementation, the Jinja2 template engine can be used. By predefining sentence templates for different types of scenarios and populating the templates with the Gherkin scenarios generated by the scenario generation subunit, the acceptance criteria can be obtained.

[0068] The requirement matrix generation unit is used to modularize and prioritize the standardized user story set, generating functional and non-functional requirement information. This unit employs classification algorithms, such as decision trees or keyword matching, to modularly categorize user stories within the set, and uses priority ranking methods, such as the MoSCoW rule, to generate functional and non-functional requirement information. Functional requirement information is a document that systematically lists all functional points, their module affiliation, priority, and other attributes in tabular form. Functional points are identified using NLP models such as spaCy and BERT, and mapped using a pre-built functional point lexicon. Non-functional requirement information is a document describing the system's quality attribute requirements in terms of performance, security, and reliability.

[0069] The document integration unit is used to integrate the standardized user story sets, use case diagrams, acceptance criteria, functional requirements information, and non-functional requirements information to form a requirements specification document. The document integration unit calls an automated document generation library, such as python-docx for Python or a LaTeX typesetting system, to integrate the standardized user story sets, use case diagrams, Gherkin acceptance criteria, and functional and non-functional requirements information into a requirements specification document, and then sends it to the shared workspace.

[0070] A detailed design agent is used to receive the requirement specification document input from the shared workspace, perform system design based on the requirement specification document, and generate a design specification document to be sent to the shared workspace.

[0071] The system undergoes a detailed design process, including a subscription requirement specification document for the intelligent agent. Based on this requirement specification document, a detailed design specification document is generated, which defines the system's architecture, components, and interaction flow.

[0072] Furthermore, the detailed design of the intelligent agent includes:

[0073] The architecture design unit is used to design the architecture based on the user story set and use case diagram in the requirements specification document, generate the system architecture diagram, and generate component specifications based on the system architecture diagram. The component specifications include component name, component function, and component interface specification.

[0074] A system architecture diagram describes the components of a system and the relationships and communication paths between them. A component refers to a software module or service in the system that can be deployed independently and has a specific function. Based on the system architecture diagram, the architecture design unit generates a component specification for each component. The component specification defines the component's name, function, and the interface specifications it provides to the outside world. The interface specifications include the API endpoint address, supported HTTP methods, and the data format and structure of requests and responses.

[0075] During implementation, the architecture design unit can choose a microservice architecture or a layered architecture based on the user story set and use case diagram in the requirements specification document, and use UML diagram generation tools, such as PlantUML, to draw the system architecture diagram.

[0076] The class diagram generation unit is used to identify entities, attributes, and relationships in the software system to be developed based on the user story set, and generate a conceptual class diagram. The class diagram generation unit uses natural language processing technology, such as the spaCy library, to perform entity recognition and relationship extraction on the user story set, thereby identifying the entities, attributes, and relationships in the system. Entities can be users or orders; the characteristics of an entity are its attributes, such as username or total order amount; relationships are the associations between entities, such as "a user has multiple orders," and a conceptual class diagram is generated accordingly. A conceptual class diagram is a UML diagram used to describe entities, attributes, and relationships.

[0077] The sequence diagram generation unit is used to transform the execution flow of each user story into an interaction sequence between components based on the user story set, concept class diagram, and system architecture diagram, generating a detailed sequence diagram. According to the business process described in each user story, and combined with the generated concept class diagram and system architecture diagram, the sequence diagram generation unit transforms the functional execution process into an interaction sequence of components or object instances passed in chronological order under a specific scenario, generating a detailed sequence diagram. A detailed sequence diagram is a UML interaction diagram that shows the detailed process of message passing to complete a specific function in chronological order.

[0078] Furthermore, the sequence map generation unit includes:

[0079] The priority processing subunit is used to determine the sequence diagram generation order of user stories based on the priority of the user story set. The priority processing subunit determines the generation order of sequence diagrams according to the user story priority order defined in the requirement matrix of the requirement specification document.

[0080] The component mapping subunit is used to map the components in the system architecture diagram to objects in the detailed sequence diagram. The component mapping subunit instantiates each component defined in the system architecture diagram through a logical component, such as UserService, and maps it to an object in the sequence diagram. In the sequence diagram, the object is an instance of the component that participates in the interaction at runtime.

[0081] The message definition subunit is used to determine the data structure of each interaction message in the detailed sequence diagram based on the class attributes defined in the conceptual class diagram and the component interface specifications defined in the component specification. Interaction messages are the carriers of communication between objects, and the data structure defines how the message content is organized, such as field names, types, and constraints. The message definition subunit extracts entity attribute information from the conceptual class diagram and parses the input and output parameters of the interface from the component specification. It defines the data structure carried by each interaction message in the sequence diagram using tools such as JSON Schema or XML Schema. The data structure includes field names, field types, and constraints. The field name is the key in the data structure, the field type defines the data type of each field, and the constraints are the validation rules in the data structure.

[0082] The sequence generation subunit is used to establish message passing relationships between component objects according to the sequence diagram generation order, based on the mapped objects and the determined interaction message data structure, and generate a detailed sequence diagram corresponding to each user story. The sequence generation subunit establishes message passing sequences among the interacting objects according to priority, automatically generates corresponding PlantUML script code, and finally renders a visual detailed sequence diagram by the PlantUML engine.

[0083] The design document integration unit is used to integrate the system architecture diagram, component specifications, conceptual class diagrams, and detailed sequence diagrams to form a design specification document. The design document integration unit uses document generation tools, such as LaTeX, to integrate the system architecture diagram, component specifications, conceptual class diagrams, and all detailed sequence diagrams into a design specification document, and then sends it to a shared workspace.

[0084] The project development agent receives design specification documents from the shared workspace, develops code based on these documents, generates executable code, and sends it back to the shared workspace. The project development agent subscribes to design specification documents and transforms the technical design into compileable and runnable executable code, i.e., source code files in a specific programming language.

[0085] The project develops intelligent agents including:

[0086] The directory generation unit is used to generate a layered code directory structure based on the system architecture diagram in the design specification document. According to the hierarchical structure indicated by the system architecture diagram in the design specification document, the directory generation unit automatically creates the corresponding layered code directory structure by programmatically calling the file system operation interface. The layered code directory structure refers to the source code folders and package paths created according to software architecture layers, such as the presentation layer, business logic layer, and data persistence layer.

[0087] The component mapping unit is used to map the components defined in the system architecture diagram to the corresponding code files in the hierarchical code directory structure according to the component specifications, and to establish the binding relationship between the components and the code files.

[0088] The component mapping unit reads the component specifications and builds a mapping table, usually stored in a JSON or YAML configuration file, binding each component to a specific code file in a hierarchical code directory structure.

[0089] The task decomposition unit is used to break down each user story into incremental development tasks targeting one or more code files, based on the detailed sequence diagram and binding relationships in the design specification document. The task decomposition unit analyzes the detailed sequence diagram in the design specification document and, according to the message flow between objects shown in the detailed sequence diagram, decomposes each user story into a series of specific incremental development tasks targeting one or more bound code files. Incremental development tasks are independently implementable functional units, such as declaring the `authenticate` method in the `UserService` interface or implementing the `findByUsername` method in the `UserRepository` class.

[0090] The code generation unit is used to generate executable code for each incremental development task using a function-level development process. The code generation unit processes each incremental development task sequentially, using a function-level development process to generate the final executable code. A function-level development process refers to planning, generating, and integrating code at the atomic unit level of functions or methods.

[0091] Furthermore, the code generation unit includes:

[0092] The planning subunit is used to analyze the requirements of the incremental development task, determine one or more target functions to be created or modified, and design the function name, input parameters, return value type and functional logic description for each target function.

[0093] An objective function refers to a specific function or method to be generated or edited. The planning subunit analyzes the incremental development task, identifies one or more objective functions that need to be created or modified, and designs a function name, input parameter names and data types, return value type, and a clear functional logic description for each objective function. The functional logic description is a detailed explanation of the algorithmic steps, business rules, and boundary conditions to be executed within the function, using natural or structured language. During implementation, this can be achieved by sending analytical prompts containing detailed context to a large-scale language model, such as OpenAI's Codex model.

[0094] The encoding subunit is used to generate initial function code based on the functional logic description, using a large language model or a code template engine. The encoding subunit, based on the functional logic description output by the planning subunit, calls the large language model API or uses a template engine-based code generator, such as Jinja2, to generate initial function code that conforms to the syntax specifications of the target programming language.

[0095] The code building subunit is used to integrate the generated initial function code into its corresponding target code file to obtain the final executable code. The code building subunit can integrate the generated initial function code into its corresponding target code file using abstract syntax trees such as Python's libcst or Java's Eclipse JDT library, and then use build tools such as Java's Maven and Gradle or Python's setuptools to compile, resolve dependencies, and package the entire target code file to finally obtain the executable code.

[0096] The test and acceptance agent receives executable code and acceptance criteria from the requirements specification document in the shared workspace. Based on the acceptance criteria and executable code, it generates test cases, executes tests, and outputs a test report. The test and acceptance agent also subscribes to both the executable code and the acceptance criteria in the requirements specification document for automated verification of software quality.

[0097] Furthermore, the testing and acceptance of intelligent agents includes:

[0098] The unit test case generation unit is used to generate unit test cases based on the acceptance criteria in the requirements specification document. Unit test cases are automated test scripts for functions or methods in the code. The unit test case generation unit parses the scenarios written in the Gherkin language in the acceptance criteria and transforms them into executable unit test cases using testing frameworks such as Cucumber for Java or Behave for Python.

[0099] The interface test case generation unit is used to generate interface test cases based on the acceptance criteria and the dependencies between interface code files. Interface test cases are test scripts used to verify the correctness of interfaces between modules, components, or services. The interface test case generation unit can generate interface test cases by using the HTTPAPI test analysis acceptance criteria generated by the RestAssured library and the dependencies between code files.

[0100] The test execution unit is used to call external encoder tools, taking the executable code and test cases as input, to execute unit tests and interface tests. External encoder tools include build tools and test runners, such as executing the `mvntest` or `pytest` command in a continuous integration environment, taking the executable code and all generated test cases as input, to automatically execute unit tests and interface tests.

[0101] The report generation unit receives unit test and interface test results, generates test reports, and sends them to the shared workspace. After testing, the report generation unit collects the test results and converts them into test reports using a test report generation library, such as AllureReport. Test reports include information such as test pass rate, test cases, error logs, and stack traces.

[0102] The shared workspace is used to store and forward user-input natural language requirements, as well as the outputs of the requirements analysis agent, detailed design agent, and project development agent. The shared workspace is the system's data storage and forwarding center, storing user-input requirements and the outputs of each agent to ensure effective collaboration between them.

[0103] Shared workspaces specifically include:

[0104] The subscription management unit is used to define the subscription relationships between the requirements analysis agent, the detailed design agent, and the project development agent. During system initialization, the subscription management unit defines and maintains the subscription relationships between all agents. The subscription relationship specifies what types of documents or messages a certain agent needs to receive. The subscription management unit can store the subscription relationships in a key-value database, such as Redis or a relational database.

[0105] The subscription execution unit is used to forward the natural language requirements input by the user to the requirements analysis agent; and to send the requirements specification document to the detailed design agent and the test acceptance agent based on the subscription relationship, send the design specification document to the project development agent, and send the test report to the user terminal.

[0106] When a user inputs a natural language requirement, the subscription execution unit forwards it to the requirement analysis agent. When the requirement analysis agent sends the requirement specification document to the shared workspace, the subscription execution unit queries the subscription relationship and forwards the requirement specification document to both the detailed design agent and the test and acceptance agent simultaneously via a message queue middleware such as RabbitMQ's Topic Exchange. Similarly, the subscription execution unit forwards the generated design specification document to the project development agent; and when the test report is generated, it forwards the test report to the user terminal.

[0107] The above embodiments of the present invention have at least the following beneficial effects: The requirements analysis agent transforms natural language requirements into standardized user story sets, use case diagrams, and acceptance criteria, avoiding misunderstandings of requirements and improving the accuracy and standardization of requirements, thereby improving the overall efficiency and quality of software development; the detailed design agent performs system architecture design, class diagram generation, and sequence diagram generation based on the requirements specification document, generating high-quality, clearly structured design specification documents, reducing reliance on developer experience during the design phase, and improving the overall efficiency and quality of software development; the project development agent develops code according to the design specification document, using a function-level development process to generate executable code, achieving automated and incremental code development, improving code readability and maintainability, reducing manual coding errors; simultaneously, the testing and acceptance agent can automatically generate test cases and execute tests based on acceptance criteria, improving test coverage and accuracy, thereby effectively shortening the software development cycle and improving the final quality of the software.

[0108] The above description is merely a selection of preferred embodiments of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention as described in the embodiments is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of the present invention.

Claims

1. An automated software development system based on multi-agent collaboration, characterized in that, The system comprises: a requirement analysis agent configured to receive natural language requirements input by a user into a shared workspace, generate a requirement specification document containing acceptance criteria based on the natural language requirements, and send the requirement specification document to the shared workspace; a detailed design agent configured to receive the requirement specification document input by the user into the shared workspace, perform system design based on the requirement specification document, and generate a design specification document and send the design specification document to the shared workspace; a project development agent configured to receive the design specification document input by the user into the shared workspace, perform code development based on the design specification document, and generate executable code and send the executable code to the shared workspace; a shared workspace configured to store and forward the natural language requirements input by the user and the outputs of the requirement analysis agent, the detailed design agent, and the project development agent.

2. The system of claim 1, wherein, The requirement analysis agent comprises: a requirement expansion unit configured to generate a set of standardized user stories based on the natural language requirements; a use case generation unit configured to generate a use case diagram based on the set of standardized user stories, convert the use case diagram into natural language, and submit the use case diagram to the user for review; a requirement confirmation unit configured to adjust the set of standardized user stories and regenerate the use case diagram according to the review feedback from the user until the user confirms; an acceptance criteria generation unit configured to generate acceptance criteria for each user story using Gherkin language based on the set of standardized user stories confirmed by the user; a requirement matrix generation unit configured to divide the set of standardized user stories into modules, sort the modules according to priorities, and generate functional requirement information and non-functional requirement information; a document integration unit configured to integrate the set of standardized user stories, the use case diagram, the acceptance criteria, the functional requirement information, and the non-functional requirement information to form a requirement specification document.

3. The system of claim 2, wherein, The acceptance criteria generation unit comprises: a scenario generation subunit configured to generate one or more Gherkin scenarios for each user story; a specification definition subunit configured to describe executable specifications of user behaviors using Given-When-Then keyword structure to obtain the acceptance criteria.

4. The system of claim 1, wherein, The detailed design agent comprises: an architecture design unit configured to perform architecture design based on the set of user stories and the use case diagram in the requirement specification document, generate a system architecture diagram, and generate component specification descriptions based on the system architecture diagram, wherein the component specification descriptions include component names, component functions, and component interface specifications; a class diagram generation unit configured to identify entities, attributes, and relationships in the software system to be developed based on the set of user stories, and generate a concept class diagram; a sequence diagram generation unit configured to convert the execution flow of each user story into interaction sequences between components based on the set of user stories, the concept class diagram, and the system architecture diagram, and generate detailed sequence diagrams; a design document integration unit configured to integrate the system architecture diagram, the component specification descriptions, the concept class diagram, and the detailed sequence diagrams to form a design specification document.

5. The system of claim 4, wherein, The sequence diagram generation unit comprises: a priority processing subunit configured to determine the sequence diagram generation order of user stories according to the priority of the set of user stories; a component mapping subunit configured to map components in the system architecture diagram to objects in the detailed sequence diagrams. The message definition subunit is configured to determine data structures of the interaction messages in the detailed sequence diagram based on the class attributes defined in the concept class diagram and the component interface specifications defined in the component specification. The sequence generation subunit is configured to establish message transmission relationships between the component objects based on the mapped objects and the determined data structures of the interaction messages, and generate the detailed sequence diagram corresponding to each user story in the sequence diagram generation order.

6. The system of claim 1, wherein, The project development agent comprises: A directory generation unit configured to generate a hierarchical code directory structure according to the system architecture diagram in the design specification document; A component mapping unit configured to map the components defined in the system architecture diagram to corresponding code files in the hierarchical code directory structure according to the component specification, and establish a binding relationship between the components and the code files; A task decomposition unit configured to decompose each user story into an incremental development task for one or more code files according to the detailed sequence diagram in the design specification document and the binding relationship; A code generation unit configured to generate executable code for each incremental development task using a function-level development process.

7. The system of claim 6, wherein, The code generation unit comprises: A planning subunit configured to analyze the requirements of the incremental development task, determine one or more target functions to be created or modified, and design a function name, input parameters, return value type and functional logic description for each target function; A coding subunit configured to generate initial function code using a large language model or a code template engine according to the functional logic description; A code construction subunit configured to integrate the generated initial function code into the corresponding target code file to obtain final executable code.

8. The system of claim 1, wherein, The system further comprises a test and acceptance agent configured to receive the executable code input by the shared workspace and the acceptance criteria in the requirement specification document, generate test cases based on the acceptance criteria and executable code, and execute the test to output a test report.

9. The system of claim 8, wherein, The test and acceptance agent comprises: A unit test case generation unit configured to generate unit test cases according to the acceptance criteria in the requirement specification document; An interface test case generation unit configured to generate interface test cases according to the dependency relationship between the acceptance criteria and the interface code files; A test execution unit configured to call an external encoder tool to execute unit testing and interface testing with the executable code and the test cases as inputs; A report generation unit configured to receive the unit testing and interface testing results, generate a test report and send it to the shared workspace.

10. The system of claim 9, wherein, The shared workspace comprises: A subscription management unit configured to define the subscription relationship of the requirement analysis agent, the detailed design agent and the project development agent; A subscription execution unit configured to forward the natural language requirements input by the user to the requirement analysis agent, and send the requirement specification document to the detailed design agent and the test and acceptance agent based on the subscription relationship, send the design specification document to the project development agent, and send the test report to the user terminal.

Citation Information

Cited By

  • Collaborative dialogue driven specification and software automatic co-construction method and device

    CN121935357A