A bidirectional association method between requirements documents and code
Patent Information
- Application Number
- CN202611011618.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-08
- Publication Date
- 2026-09-01
AI Technical Summary
[0005]本申请的目的旨在至少能解决上述的技术缺陷之一,特别是现有技术中软件开发领域因自动化水平不高,导致需求文档与代码双向关联的效果不好的技术缺陷
[0063] Based on any of the above embodiments, the solution first uses natural language processing and static code analysis technologies to parse requirements and code into structured information. Then, it uses an AI model to understand their semantics and calculate similarity, automatically generating high-confidence candidate associations, significantly reducing the cost of manually establishing mapping relationships. Subsequently, manual review and confirmation form an authoritative final mapping, ensuring the accuracy of the association. This mapping is further integrated into the development environment, enabling convenient two-way navigation between development and requirement review scenarios, greatly improving communication and verification efficiency. More importantly, the solution designs an automated change detection and impact analysis closed loop. When requirements or code change, the association can be dynamically updated and an analysis report can be pushed, thereby achieving continuous and automated maintenance of association relationships, forming a complete technical closed loop, and significantly improving the traceability and change management efficiency of software projects.
Smart Images

Figure CN122672755A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software development, and in particular to a method for bidirectional association between requirements documents and code. Background Technology
[0002] Throughout the software development lifecycle, there has long been a disconnect between requirements documentation and code implementation. Product managers describe requirements in natural language, and developers translate them into code, but the mapping between the two often relies on a manually maintained requirements traceability matrix.
[0003] However, current manual methods have some limitations. Firstly, maintenance costs are high; the requirement tracing matrix requires continuous manual updates, and as projects iterate, the correspondence between requirements and code easily becomes outdated, leading to a loss of traceability. Secondly, change impact analysis is difficult; when requirements change, it's hard to quickly locate the affected code modules; conversely, code refactoring cannot accurately assess the impact on requirements, easily introducing defects. Furthermore, communication efficiency is low; developers need to repeatedly consult requirement documents when reading code, and product managers need to find corresponding logic in the code when verifying requirement implementation, lacking convenient navigation mechanisms. Moreover, there is a lack of automation support; traditional tools cannot automatically understand the semantic relationship between requirement descriptions and code structure, relying on manual annotation, which is inefficient and error-prone.
[0004] In summary, the low level of automation has resulted in poor bidirectional association between requirements documents and code. Therefore, there is an urgent need for a method that can use artificial intelligence technology to automatically establish and maintain bidirectional association between requirements documents and code in order to improve the traceability and change management efficiency of software engineering. Summary of the Invention
[0005] The purpose of this application is to at least address one of the aforementioned technical deficiencies, particularly the technical deficiency in the prior art where the low level of automation in software development leads to poor bidirectional association between requirement documents and code.
[0006] Firstly, this application provides a method for bidirectional association between requirements documents and code, the method comprising:
[0007] Receive the requirements document and the corresponding code branch;
[0008] The requirement document and the code branch are parsed to obtain requirement item information corresponding to the requirement document and code element information corresponding to the code branch;
[0009] Based on a pre-trained natural language understanding model, semantic vector processing is performed on each of the aforementioned requirement items and each of the aforementioned code element information to determine candidate association information corresponding to each of the aforementioned requirement items and each of the aforementioned code element information;
[0010] The candidate association information includes the pairing relationship, similarity information, confidence information, and association basis information between each of the requirement item information and each of the code element information;
[0011] The candidate association information is modified, confirmed, or rejected to form a target association mapping and persistently stored.
[0012] As an optional implementation, parsing the requirement document and the code branch to obtain requirement item information corresponding to the requirement document and code element information corresponding to the code branch includes:
[0013] The requirement document is parsed using natural language processing to extract the requirement title, requirement description, and acceptance criteria, and then it is divided into multiple independent requirement items.
[0014] Static code analysis is performed on the code branch to extract code element information from the code branch, and the name, comment information, method body content and call relationship of each code element are obtained.
[0015] The code element information includes classes, methods, and interfaces;
[0016] Furthermore, the step of performing semantic vector processing on each of the aforementioned requirement item information and each of the aforementioned code element information based on a pre-trained natural language understanding model to determine candidate association information corresponding to each of the aforementioned requirement item information and each of the aforementioned code element information includes:
[0017] Based on the pre-trained natural language understanding model, the text content of each requirement item and the identification information of each code element are semantically vectorized to generate corresponding requirement semantic vectors and code semantic vectors.
[0018] Based on the semantic vectorization representation, the semantic similarity between each of the requirement item information and each of the code element information is calculated;
[0019] The semantic similarity is corrected based on the code structure features of each code element;
[0020] The code structure features include method call chain features and class inheritance relationship features.
[0021] As an optional implementation, the method further includes:
[0022] Integrate the plugin in the integrated development environment, and based on the final association mapping, create visual markers and bidirectional jump paths corresponding to each of the aforementioned requirement items and code element information.
[0023] As an optional implementation, the step of integrating the plugin in the integrated development environment and creating visual markers and bidirectional jump paths corresponding to each of the aforementioned requirement items and code element information based on the final association mapping includes:
[0024] Integrate plugins within an integrated development environment;
[0025] The plugin loads the final association mapping upon startup and establishes an index relationship in memory.
[0026] Within the code editor of the integrated development environment, the code element currently being edited or where the cursor is located is identified. If the code element exists in the final association mapping, a visual marker is added.
[0027] Create the first jump path from the code side to the requirements side;
[0028] The first jump path responds to an operation triggered by the visual identifier or a preset shortcut key, opening the associated requirement document and locating the corresponding requirement item information;
[0029] Create a second jump path from the requirements side to the code side;
[0030] The second jump path responds to the operation of clicking the requirement item information through the requirement viewing interface, guiding the integrated development environment to jump to the location of the associated code element information;
[0031] Furthermore, when the final association mapping is updated, the plugin receives an update notification and refreshes the index relationship and the visualization identifier in its memory.
[0032] As an optional implementation, the step of performing modification, confirmation, or rejection operations on the candidate association information to form a target association mapping and persistently store it includes:
[0033] The candidate association information list is displayed through a visual interface, sorted according to the similarity information or the confidence information.
[0034] In the visualization interface, a detailed view containing the original text of the requirement item information, the code element information, and the description of the association basis is matched for each of the candidate association information;
[0035] Through the visual interface, interactive operation information regarding each of the candidate association information is received;
[0036] The interactive operation information includes performing acceptance, rejection, manual creation, modification, or deletion operations on each of the candidate association information;
[0037] The target association mapping is generated based on the interactive operation information, and the target association mapping is stored in a database or metadata file in the form of structured data.
[0038] As an optional implementation, the method further includes:
[0039] Based on event-driven or timed scanning methods, detect changes to the requirement document or the code branch, and determine the document change data or code change data;
[0040] The methods for obtaining the document change data include:
[0041] Based on document difference identification, identify the changed requirement items that have been added, modified, or deleted in the requirement document, and use them as the document change data;
[0042] The methods for obtaining the code change data include:
[0043] Based on version control difference analysis, information on changed code elements that have been added, modified, or deleted in the code branch is determined and used as the code change data.
[0044] When a change is detected in either the requirement document or the code branch, the target association mapping generation process is re-executed based on the document change data or the code change data to generate a change impact analysis report and push it to a preset terminal.
[0045] Secondly, this application provides a bidirectional association device for requirements documents and code, comprising:
[0046] The processing module is used to receive the requirements document and the corresponding code branch;
[0047] The processing module is further configured to parse the requirement document and the code branch to obtain requirement item information corresponding to the requirement document and code element information corresponding to the code branch;
[0048] The processing module is further configured to perform semantic vector processing on each of the requirement items and each of the code element information according to a pre-trained natural language understanding model, and determine candidate association information corresponding to each of the requirement items and each of the code element information;
[0049] The candidate association information includes the pairing relationship, similarity information, confidence information, and association basis information between each of the requirement item information and each of the code element information;
[0050] The processing module is also used to perform correction, confirmation or rejection operations on the candidate association information, form a target association mapping and persist it.
[0051] As an optional implementation, the specific method by which the processing module parses the requirement document and the code branch to obtain requirement item information corresponding to the requirement document and code element information corresponding to the code branch includes:
[0052] The requirement document is parsed using natural language processing to extract the requirement title, requirement description, and acceptance criteria, and then it is divided into multiple independent requirement items.
[0053] Static code analysis is performed on the code branch to extract code element information from the code branch, and the name, comment information, method body content and call relationship of each code element are obtained.
[0054] The code element information includes classes, methods, and interfaces;
[0055] Furthermore, the processing module performs semantic vector processing on each of the required item information and each of the code element information based on a pre-trained natural language understanding model to determine the specific method of candidate association information corresponding to each of the required item information and each of the code element information, including:
[0056] Based on the pre-trained natural language understanding model, the text content of each requirement item and the identification information of each code element are semantically vectorized to generate corresponding requirement semantic vectors and code semantic vectors.
[0057] Based on the semantic vectorization representation, the semantic similarity between each of the requirement item information and each of the code element information is calculated;
[0058] The semantic similarity is corrected based on the code structure features of each code element;
[0059] The code structure features include method call chain features and class inheritance relationship features.
[0060] Thirdly, this application provides a computer device including one or more processors and a memory storing computer-readable instructions that, when executed by the one or more processors, perform the steps of the method described in the first aspect.
[0061] Fourthly, this application provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the method described in the first aspect.
[0062] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0063] Based on any of the above embodiments, the solution first uses natural language processing and static code analysis technologies to parse requirements and code into structured information. Then, it uses an AI model to understand their semantics and calculate similarity, automatically generating high-confidence candidate associations, significantly reducing the cost of manually establishing mapping relationships. Subsequently, manual review and confirmation form an authoritative final mapping, ensuring the accuracy of the association. This mapping is further integrated into the development environment, enabling convenient two-way navigation between development and requirement review scenarios, greatly improving communication and verification efficiency. More importantly, the solution designs an automated change detection and impact analysis closed loop. When requirements or code change, the association can be dynamically updated and an analysis report can be pushed, thereby achieving continuous and automated maintenance of association relationships, forming a complete technical closed loop, and significantly improving the traceability and change management efficiency of software projects. Attached Figure Description
[0064] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0065] Figure 1 A flowchart illustrating a method for bidirectional association between requirements documents and code provided in one embodiment of this application;
[0066] Figure 2 A schematic diagram of the overall process architecture of the bidirectional association method between requirements documents and code provided in one embodiment of this application;
[0067] Figure 3 This is an internal structural diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0068] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0069] Throughout the software development lifecycle, a long-standing information gap exists between requirements documentation and code implementation. Product managers describe requirements in natural language, and developers translate them into code, but the mapping between the two often relies on manually maintained requirements traceability matrices. Existing technologies have the following shortcomings:
[0070] High maintenance costs: The requirement traceability matrix needs to be continuously updated manually. As the project iterates, the correspondence between requirements and code is easily outdated, leading to a loss of traceability.
[0071] Analysis of the impact of changes is difficult: when requirements change, it is difficult to quickly locate the affected code modules; conversely, when refactoring code, it is also difficult to accurately assess the impact on requirements, which can easily introduce defects.
[0072] Low communication efficiency: Developers need to repeatedly consult the requirements document when reading the code, and product managers also need to find the corresponding logic in the code when verifying the implementation of the requirements, lacking a convenient jump mechanism.
[0073] Lack of automation support: Traditional tools cannot automatically understand the semantic relationship between requirement description and code structure, relying on manual annotation, which is inefficient and prone to errors.
[0074] Therefore, there is an urgent need for a method that can automatically establish and maintain a two-way association between requirements documents and code using artificial intelligence technology to improve the traceability and change management efficiency of software engineering. This application provides an AI-driven two-way association system between requirements documents and code, aiming to achieve intelligent mapping between requirements and code, convenient navigation, and automated change impact analysis.
[0075] In summary, the technical concept of this application lies in constructing a complete technical closed loop of "intelligent analysis - manual confirmation - environmental integration - dynamic maintenance," aiming to solve the long-standing pain points in the software development lifecycle, such as information fragmentation, difficulty in traceability, and high maintenance costs between requirement documents and code implementation. First, the system intelligently parses and discovers associations between the input requirement documents and code branches. Specifically, the system uses natural language processing technology to deconstruct the requirement documents into independent and clearly defined requirement items, while using static code analysis technology to extract elements such as classes and methods in the code and their structural relationships. Then, through a pre-trained natural language understanding model, the requirement text and code element identifiers are mapped to the same semantic space for similarity calculation, and corrected by combining structural features such as code call chains and inheritance relationships, thereby automatically and intelligently generating candidate association pairs of "requirement items - code elements." This process is the first to deeply apply AI to the semantic association mining of requirements and code, greatly reducing the heavy workload and subjective errors of manually building and maintaining traceability matrices, and laying an intelligent data foundation for high-quality bidirectional association.
[0076] Subsequently, the solution introduced a crucial human-machine collaboration element. The system, through a visual review interface, clearly displays the AI-generated candidate associations, their confidence levels, and supporting information, allowing users to accept, reject, modify, or manually create associations. This design combines the efficient computing power of AI with the domain expertise and final decision-making authority of technical personnel, ensuring that the generated final association mapping possesses both the efficiency of automation and the accuracy of human review. The reviewed and confirmed association mappings are persistently stored, forming a core asset for project traceability.
[0077] To realize the practical application of associated value, the solution innovatively integrates the final association mapping deep into the developers' daily work environment—the Integrated Development Environment (IDE). By developing an IDE plugin, visual markers are added to associated code elements within the code editor, providing one-click bidirectional navigation from code to requirements documents and from requirements to implementation code. While writing or reading code, developers can instantly access the corresponding requirement context and quickly locate the implementation logic. This changes the inefficient work mode of repeatedly switching tools and manually searching for corresponding relationships, greatly improving development and collaboration efficiency and integrating associated data into the development process.
[0078] Finally, to address the inevitable continuous changes during software development, the solution incorporates an automated change response and maintenance loop. The system automatically detects additions, deletions, and modifications to requirements documents or source code through event listening or scheduled scanning mechanisms. Once a change is detected, the correlation analysis engine is triggered to re-analyze the changed parts, assess the impact of the change on existing mappings, and automatically generate a visual change impact analysis report, indicating the relationships that need updating or review. The system pushes the report to the relevant responsible parties and guides them to the review interface to complete the mapping update, thus achieving full automation from change detection and impact analysis to mapping update notifications. This transforms the relationship between requirements and code from a static snapshot into a living system that evolves and is dynamically maintained in real time along with project iterations, ensuring high-reliability traceability at all times and providing strong support for accurate change impact assessment.
[0079] In summary, this solution organically integrates natural language processing, code analysis, machine learning, and development tool integration technologies to construct a complete technical system encompassing intelligent association discovery, human-machine collaborative confirmation, deep integration with the development environment, and automatic change response capabilities. It not only solves the cost and accuracy problems of manually maintaining the traceability matrix, but also makes traceability readily accessible through environment integration and ensures its long-term sustainability through automated change maintenance, thereby systematically improving the traceability and change management efficiency of software engineering.
[0080] The methods provided in this application will be described in detail below based on the corresponding implementation methods in some practical application scenarios.
[0081] Figure 1 This is a flowchart illustrating a method for bidirectional association between requirements documents and code, provided in one embodiment of this application. Figure 2 This diagram illustrates the overall workflow architecture of a bidirectional association method between requirement documents and code, provided in one embodiment of this application. In short, this application can include two phases: In the initial setup phase, the user provides a requirement document and corresponding code branch. AI analysis generates association candidates, which are then manually reviewed and confirmed to form a persistent association mapping. An IDE plugin is then activated to enable bidirectional navigation. In the continuous maintenance phase, the system automatically detects changes to the requirement document or code branch. Upon detection of a change, the system immediately or periodically re-analyzes the association, outputs an impact analysis report, and prompts for manual review and mapping updates. Figure 1 As shown, this application provides a method for bidirectional association between requirements documents and code, the method comprising:
[0082] S101. Receive the requirements document and the corresponding code branch;
[0083] S102. Parse the requirement document and the code branch to obtain requirement item information corresponding to the requirement document and code element information corresponding to the code branch; as an optional implementation, parsing the requirement document and the code branch to obtain requirement item information corresponding to the requirement document and code element information corresponding to the code branch includes:
[0084] The requirement document is parsed using natural language processing to extract the requirement title, requirement description, and acceptance criteria, and then it is divided into multiple independent requirement items.
[0085] Static code analysis is performed on the code branch to extract code element information from the code branch, and the name, comment information, method body content and call relationship of each code element are obtained.
[0086] The code element information includes classes, methods, and interfaces;
[0087] S103. Based on the pre-trained natural language understanding model, perform semantic vector processing on each of the aforementioned requirement items and each of the aforementioned code element information to determine candidate association information corresponding to each of the aforementioned requirement items and each of the aforementioned code element information;
[0088] The candidate association information includes the pairing relationship, similarity information, confidence information, and association basis information between each of the requirement item information and each of the code element information;
[0089] Furthermore, the step of performing semantic vector processing on each of the aforementioned requirement item information and each of the aforementioned code element information based on a pre-trained natural language understanding model to determine candidate association information corresponding to each of the aforementioned requirement item information and each of the aforementioned code element information includes:
[0090] Based on the pre-trained natural language understanding model, the text content of each requirement item and the identification information of each code element are semantically vectorized to generate corresponding requirement semantic vectors and code semantic vectors.
[0091] Based on the semantic vectorization representation, the semantic similarity between each of the requirement item information and each of the code element information is calculated;
[0092] The semantic similarity is corrected based on the code structure features of each code element;
[0093] The code structure features include method call chain features and class inheritance relationship features.
[0094] The method described in this implementation further refines the core parsing and intelligent association steps. In the parsing phase, natural language processing is used on the requirements document to accurately extract the requirements title, description, and acceptance criteria, dividing them into independent requirements items. This achieves a refined and structured understanding of the requirements document, making each requirement clearly identifiable. Static analysis of code branches extracts elements such as classes, methods, and interfaces, along with their names, comments, method body content, and call relationships, comprehensively capturing the structural and semantic information of the code. This refined parsing lays the foundation for subsequent high-quality association. In the association generation phase, semantic vectorization is performed on both the requirement item text and code element identifiers, mapping them to a unified semantic space. This makes the natural language of the requirement description and the technical language of the code comparable. Based on this, semantic similarity is calculated, allowing for an assessment of the matching degree between the requirements and the code at the semantic level. Furthermore, by combining code structure features such as method call chains and class inheritance relationships to correct similarity, the association judgment is not only based on textual semantics, but also takes into account the actual architectural role and functional context of the code in the project. This significantly enhances the accuracy, rationality, and credibility of the generated candidate association information, providing higher-quality recommendation results for manual review.
[0095] S104. Perform modification, confirmation, or rejection operations on the candidate association information to form a target association mapping and persist it.
[0096] As an optional implementation, the step of performing modification, confirmation, or rejection operations on the candidate association information to form a target association mapping and persistently store it includes:
[0097] The candidate association information list is displayed through a visual interface, sorted according to the similarity information or the confidence information.
[0098] In the visualization interface, a detailed view containing the original text of the requirement item information, the code element information, and the description of the association basis is matched for each of the candidate association information;
[0099] Through the visual interface, interactive operation information regarding each of the candidate association information is received;
[0100] The interactive operation information includes performing acceptance, rejection, manual creation, modification, or deletion operations on each of the candidate association information;
[0101] The target association mapping is generated based on the interactive operation information, and the target association mapping is stored in a database or metadata file in the form of structured data.
[0102] The method described in this implementation specifically outlines a human-machine collaborative decision-making process for transforming AI-generated candidate associations into authoritative final mappings. A visual interface displays a list of candidate associations sorted by similarity or confidence level, along with a detailed view containing the original requirement, code elements, and association criteria. This provides users with comprehensive, clear, and organized decision-making information, making manual review efficient and targeted. The interface receives user interactions such as accepting, rejecting, modifying, or deleting each candidate association. Building upon AI recommendations, it provides technical personnel with ultimate control and correction capabilities, allowing the integration of factors that AI struggles to fully capture, such as domain knowledge and project-specific logic, into the association decision-making process. Finally, based on these interactions, a target association mapping is generated and persistently stored in a structured format. This solidifies the confirmed associations into stable data assets that can be used long-term and accessed by other modules (such as IDE plugins), completing the crucial transformation from intelligent recommendation to authoritative finalization.
[0103] As an optional implementation, the method further includes:
[0104] Integrate the plugin in the integrated development environment, and based on the final association mapping, create visual markers and bidirectional jump paths corresponding to each of the aforementioned requirement items and code element information.
[0105] This implementation, after establishing the core association mapping, adds a crucial application step: integration with an integrated development environment (IDE) plugin. By loading and applying the final association mapping through the plugin, visual markers are created for associated code elements in the code editor, making the relationships clearly visible to developers. More importantly, it creates bidirectional navigation paths, enabling seamless navigation from the code side to the requirements side and vice versa. This mechanism completely changes the traditional inefficient model where developers have to leave the coding environment to consult documentation, or requirements managers have to search through a vast codebase for implementation logic. It transforms the traceability of requirements and code from static documents or tables into an instant and convenient interactive experience during the development process, thereby greatly improving development efficiency and the accuracy of code comprehension.
[0106] As an optional implementation, the step of integrating the plugin in the integrated development environment and creating visual markers and bidirectional jump paths corresponding to each of the aforementioned requirement items and code element information based on the final association mapping includes:
[0107] Integrate plugins within an integrated development environment;
[0108] The plugin loads the final association mapping upon startup and establishes an index relationship in memory.
[0109] Within the code editor of the integrated development environment, the code element currently being edited or where the cursor is located is identified. If the code element exists in the final association mapping, a visual marker is added.
[0110] Create the first jump path from the code side to the requirements side;
[0111] The first jump path responds to an operation triggered by the visual identifier or a preset shortcut key, opening the associated requirement document and locating the corresponding requirement item information;
[0112] Create a second jump path from the requirements side to the code side;
[0113] The second jump path responds to the operation of clicking the requirement item information through the requirement viewing interface, guiding the integrated development environment to jump to the location of the associated code element information;
[0114] Furthermore, when the final association mapping is updated, the plugin receives an update notification and refreshes the index relationship and the visualization identifier in its memory.
[0115] This implementation provides a specific method for integrating an IDE plugin. Upon startup, the plugin loads the final association mapping and establishes an index in memory, ensuring the immediate responsiveness of the jump function. In the code editor, the code element at the current cursor position is identified and matched with the association mapping, dynamically adding visual markers to provide users with intuitive contextual hints. The first jump path is triggered by visual markers or shortcut keys, directly opening and locating the associated requirement document content, making reviewing the requirement background a one-click operation. The second jump path is triggered by clicking on a requirement item in the requirement viewing interface, guiding the IDE to jump to the associated code implementation location, facilitating requirement verification and implementation review. Most importantly, when the final association mapping is updated, the plugin receives a notification and refreshes the memory index and visual markers. This mechanism ensures that the association information presented in the development environment remains synchronized with the authoritative mapping maintained in the backend, avoiding misleading information caused by inconsistencies, guaranteeing the continuous accuracy and effectiveness of the integration function throughout the entire software iteration cycle, and realizing dynamic real-time updates of association data on the application side.
[0116] As an optional implementation, the method further includes:
[0117] Based on event-driven or timed scanning methods, detect changes to the requirement document or the code branch, and determine the document change data or code change data;
[0118] The methods for obtaining the document change data include:
[0119] Based on document difference identification, identify the changed requirement items that have been added, modified, or deleted in the requirement document, and use them as the document change data;
[0120] The methods for obtaining the code change data include:
[0121] Based on version control difference analysis, information on changed code elements that have been added, modified, or deleted in the code branch is determined and used as the code change data.
[0122] When a change is detected in either the requirement document or the code branch, the target association mapping generation process is re-executed based on the document change data or the code change data to generate a change impact analysis report and push it to a preset terminal.
[0123] The method described in this implementation introduces a dynamic maintenance mechanism to address continuous changes in software development. It detects changes to requirement documents or code branches through event-driven or timed scanning, and accurately captures newly added, modified, or deleted change items using document difference identification and version control difference analysis, achieving automatic change awareness. Once a change in either area is detected, the association mapping generation process is re-executed based on this change data. This is not a simple full recalculation, but a targeted analysis of the scope of the change's impact. This process can automatically assess "which existing code associations were affected by the requirement change" or "which requirement implementations were affected by code refactoring," and generate a change impact analysis report accordingly, which is then pushed to relevant personnel. This closed-loop design achieves full automation from automatic change discovery to automatic impact analysis and targeted result push, making the relationship between requirements and code no longer static, but automatically evolving and dynamically updating with project iterations, reflecting the latest project status in a timely manner. This greatly simplifies the complexity of change management, ensures the continuous effectiveness of project traceability during long-term development, and provides early warning of potential traceability disruptions or impact spread risks caused by changes.
[0124] This application provides a complete method for bidirectional association between requirement documents and code. By receiving the requirement document and corresponding code branch, a clear data input foundation is provided for subsequent intelligent association analysis. Parsing both yields structured requirement item information and code element information. This is a crucial step in transforming unstructured natural language documents and complex source code into a computable and comparable standard form, creating conditions for automated processing. Furthermore, using a pre-trained natural language understanding model to perform semantic vector processing on this information, a deep understanding of the semantic intent behind the requirement description and code elements is achieved, going beyond simple text matching. This intelligently identifies candidate association information containing pairing relationships, similarity, confidence, and supporting evidence. This process achieves, for the first time, automated association recommendation between requirements and code based on deep semantic understanding, significantly reducing the cost of manually establishing mapping relationships from scratch. Finally, by performing correction, confirmation, or rejection operations on the candidate association information to form a target association mapping and persistently storing it, the efficient computation of artificial intelligence is combined with the domain knowledge and final decision-making authority of human experts. This ensures that the final association relationship possesses both the high efficiency of automation and the high accuracy and authority guaranteed by human review, providing a reliable data core for subsequent applications and dynamic maintenance.
[0125] Based on practical application scenarios, when various implementation methods are combined, this application can implement the corresponding methods through the following modular architecture.
[0126] Association Analysis Engine:
[0127] Technical Logic:
[0128] Input reception: Receive user-specified requirements documents (supporting PDF, MD, and other formats) and corresponding code branches (pulled from Git, SVN, and other version control repositories).
[0129] Requirements Analysis: Natural language processing technology is used to perform structured parsing of the requirements document, extracting key information such as the requirements title, description, acceptance criteria, and business rules, and dividing them into independent "requirement items".
[0130] Code analysis: Perform static analysis on the source code in the code branch to extract elements such as classes, methods, and interfaces, as well as their comments, method bodies, and call relationships.
[0131] AI Association Model: This model employs a pre-trained natural language understanding model (such as BERT) to semantically vectorize the requirement text and code elements (including class names, method names, comments, and code snippets) and calculate similarity. It also incorporates code structure features (such as method call chains and class inheritance relationships) to enhance association accuracy. The model outputs candidate associations and their confidence scores between each requirement item and code element.
[0132] Candidate output: Generate a list of associated candidates, including "requirement item - code element" pairings, confidence levels, and explanations of the association basis, for manual review.
[0133] Interactive review and maintenance module:
[0134] Technical Logic:
[0135] Review Interface: Provides a web or desktop interface that displays an AI-generated list of related candidate links, sorted by confidence level. Users can view detailed information for each link (such as the original requirement, code snippets, and similarity criteria).
[0136] Confirmation and Correction: Users can accept, reject, or correct candidate associations. For example, they can manually bind a requirement item to multiple code elements or delete incorrect associations. Batch operations are supported.
[0137] Persistent storage: Once approved, the association mapping is stored in a database or metadata file in the form of structured data, recording information such as requirement ID, fully qualified name of code element, association type, and timestamp.
[0138] Export and Synchronization: Association mappings can be exported as configuration files for IDE plugins to load.
[0139] IDE integration plugins:
[0140] Technical Logic:
[0141] Code-side navigation: Develop plugins in mainstream IDEs (such as IntelliJ IDEA, Eclipse, and VS Code) to add special icons or highlights to associated classes and methods within the code editor. Users can open the associated requirements document and locate the corresponding content point using a keyboard shortcut (such as Alt+Click) or by selecting "Jump to Requirements Document" from the right-click menu.
[0142] Requirements-side navigation: In requirements document viewing tools (such as web interfaces), it is also supported to click on a requirement item to jump to the corresponding code location in the IDE (the IDE needs to be running and the project open beforehand).
[0143] Related data loading: When the plugin starts, it loads the persistent related mapping and establishes an in-memory index to enable fast navigation.
[0144] Real-time updates: When the association mapping is manually updated, the plugin can receive a notification to refresh the local cache and keep the redirection accurate.
[0145] Change Detection and Impact Analysis Module:
[0146] Technical Logic:
[0147] Change monitoring mechanism: Changes are detected in two ways:
[0148] Event-driven: Listen for webhooks in the version control system (such as Git push events) or file change events in the folder containing the requirements document, and trigger detection in real time.
[0149] Scheduled scanning: Supports scanning requirement documents and code branches at fixed time intervals (such as every morning) to compare the differences between the latest version and the last analyzed version.
[0150] Change identification: For requirement documents, new, modified, and deleted requirement items are identified through document difference algorithms; for code branches, new, modified, and deleted classes and methods are identified through version control difference analysis.
[0151] Reanalysis trigger: When a change is detected in either party, the correlation analysis engine is automatically invoked to reanalyze only the affected changed parts, thus saving computing resources. However, if the scope of the change is large, a full analysis can also be performed.
[0152] Impact Analysis Report: After reanalysis, output an impact analysis report, including:
[0153] Impact of requirement changes: List the affected code elements (classes, methods) and provide suggested modifications.
[0154] Impact of code changes: List the affected original requirements and indicate that the requirements document may need to be updated accordingly.
[0155] New association suggestions: Provide preliminary association suggestions for new code or requirements.
[0156] Notification and review: The report can be sent to the relevant responsible persons (such as product managers and developers), prompting them to enter the manual review and maintenance interface to confirm the update of the association mapping, thus forming a closed loop.
[0157] The key points of this application are:
[0158] AI-driven intelligent association generation combines natural language processing and code analysis technologies to automatically establish semantic relationships between requirements documents and code elements, significantly reducing manual maintenance costs.
[0159] The IDE integrates a two-way navigation mechanism, enabling quick navigation from code to requirements documents and from requirements to code within the development environment, greatly improving development and communication efficiency.
[0160] The automated impact analysis closed loop based on change detection automatically re-analyzes the correlation and outputs an impact report by detecting requirement / code changes in real time or at regular intervals, thus achieving continuous and dynamic maintenance of the requirement-code correlation.
[0161] Based on the execution results in real-world application scenarios, this application achieves the following technical advantages:
[0162] Enhance traceability: Establish and dynamically maintain a precise mapping between requirements and code to ensure that each requirement is traceable and that each code change can be linked to a specific requirement, thus meeting compliance requirements.
[0163] Reduced maintenance costs: AI automatically generates initial associations, requiring only manual review and confirmation, improving efficiency by more than 80% compared to fully manual maintenance.
[0164] Accelerate change impact analysis: When requirements or code change, the system automatically calculates the scope of impact and outputs a visual report, reducing analysis time from hours to minutes.
[0165] Enhanced development experience: Developers can jump to view requirement descriptions with one click in the IDE, reducing context switching and improving coding efficiency; product personnel can also quickly verify whether the implementation meets expectations.
[0166] This application also provides a device for bidirectional association between requirements documents and code, including:
[0167] The processing module is used to receive the requirements document and the corresponding code branch;
[0168] The processing module is further configured to parse the requirement document and the code branch to obtain requirement item information corresponding to the requirement document and code element information corresponding to the code branch;
[0169] The processing module is further configured to perform semantic vector processing on each of the requirement items and each of the code element information according to a pre-trained natural language understanding model, and determine candidate association information corresponding to each of the requirement items and each of the code element information;
[0170] The candidate association information includes the pairing relationship, similarity information, confidence information, and association basis information between each of the requirement item information and each of the code element information;
[0171] The processing module is also used to perform correction, confirmation or rejection operations on the candidate association information, form a target association mapping and persist it.
[0172] This implementation provides a complete method for bidirectional association between requirement documents and code. By receiving the requirement document and corresponding code branch, a clear data input foundation is provided for subsequent intelligent association analysis. Parsing both yields structured requirement item information and code element information. This is a crucial step in transforming unstructured natural language documents and complex source code into a computable and comparable standard form, creating conditions for automated processing. Furthermore, using a pre-trained natural language understanding model to perform semantic vector processing on this information, a deep understanding of the semantic intent behind the requirement description and code elements can be achieved, going beyond simple text matching. This intelligently determines candidate association information containing pairing relationships, similarity, confidence, and supporting evidence. This process achieves automated association recommendation between requirements and code based on deep semantic understanding for the first time, significantly reducing the cost of manually establishing mapping relationships from scratch. Finally, by performing correction, confirmation, or rejection operations on the candidate association information to form a target association mapping and persistently storing it, the efficient computation of artificial intelligence is combined with the domain knowledge and final decision-making authority of human experts. This ensures that the final association relationship possesses both the high efficiency of automation and the high accuracy and authority guaranteed by human review, providing a reliable data core for subsequent applications and dynamic maintenance.
[0173] As an optional implementation, the specific method by which the processing module parses the requirement document and the code branch to obtain requirement item information corresponding to the requirement document and code element information corresponding to the code branch includes:
[0174] The requirement document is parsed using natural language processing to extract the requirement title, requirement description, and acceptance criteria, and then it is divided into multiple independent requirement items.
[0175] Static code analysis is performed on the code branch to extract code element information from the code branch, and the name, comment information, method body content and call relationship of each code element are obtained.
[0176] The code element information includes classes, methods, and interfaces;
[0177] Furthermore, the processing module performs semantic vector processing on each of the required item information and each of the code element information based on a pre-trained natural language understanding model to determine the specific method of candidate association information corresponding to each of the required item information and each of the code element information, including:
[0178] Based on the pre-trained natural language understanding model, the text content of each requirement item and the identification information of each code element are semantically vectorized to generate corresponding requirement semantic vectors and code semantic vectors.
[0179] Based on the semantic vectorization representation, the semantic similarity between each of the requirement item information and each of the code element information is calculated;
[0180] The semantic similarity is corrected based on the code structure features of each code element;
[0181] The code structure features include method call chain features and class inheritance relationship features.
[0182] The method described in this implementation further refines the core parsing and intelligent association steps. In the parsing phase, natural language processing is used on the requirements document to accurately extract the requirements title, description, and acceptance criteria, dividing them into independent requirements items. This achieves a refined and structured understanding of the requirements document, making each requirement clearly identifiable. Static analysis of code branches extracts elements such as classes, methods, and interfaces, along with their names, comments, method body content, and call relationships, comprehensively capturing the structural and semantic information of the code. This refined parsing lays the foundation for subsequent high-quality association. In the association generation phase, semantic vectorization is performed on both the requirement item text and code element identifiers, mapping them to a unified semantic space. This makes the natural language of the requirement description and the technical language of the code comparable. Based on this, semantic similarity is calculated, allowing for an assessment of the matching degree between the requirements and the code at the semantic level. Furthermore, by combining code structure features such as method call chains and class inheritance relationships to correct similarity, the association judgment is not only based on textual semantics, but also takes into account the actual architectural role and functional context of the code in the project. This significantly enhances the accuracy, rationality, and credibility of the generated candidate association information, providing higher-quality recommendation results for manual review.
[0183] As an optional implementation, the processing module is further configured to:
[0184] Integrate the plugin in the integrated development environment, and based on the final association mapping, create visual markers and bidirectional jump paths corresponding to each of the aforementioned requirement items and code element information.
[0185] This implementation, after establishing the core association mapping, adds a crucial application step: integration with an integrated development environment (IDE) plugin. By loading and applying the final association mapping through the plugin, visual markers are created for associated code elements in the code editor, making the relationships clearly visible to developers. More importantly, it creates bidirectional navigation paths, enabling seamless navigation from the code side to the requirements side and vice versa. This mechanism completely changes the traditional inefficient model where developers have to leave the coding environment to consult documentation, or requirements managers have to search through a vast codebase for implementation logic. It transforms the traceability of requirements and code from static documents or tables into an instant and convenient interactive experience during the development process, thereby greatly improving development efficiency and the accuracy of code comprehension.
[0186] As an optional implementation, the processing module integrates a plugin in the integrated development environment, and based on the final association mapping, creates specific methods for visual markers and bidirectional jump paths corresponding to each of the required item information and each of the code element information, including:
[0187] Integrate plugins within an integrated development environment;
[0188] The plugin loads the final association mapping upon startup and establishes an index relationship in memory.
[0189] Within the code editor of the integrated development environment, the code element currently being edited or where the cursor is located is identified. If the code element exists in the final association mapping, a visual marker is added.
[0190] Create the first jump path from the code side to the requirements side;
[0191] The first jump path responds to an operation triggered by the visual identifier or a preset shortcut key, opening the associated requirement document and locating the corresponding requirement item information;
[0192] Create a second jump path from the requirements side to the code side;
[0193] The second jump path responds to the operation of clicking the requirement item information through the requirement viewing interface, guiding the integrated development environment to jump to the location of the associated code element information;
[0194] Furthermore, when the final association mapping is updated, the plugin receives an update notification and refreshes the index relationship and the visualization identifier in its memory.
[0195] This implementation provides a specific method for integrating an IDE plugin. Upon startup, the plugin loads the final association mapping and establishes an index in memory, ensuring the immediate responsiveness of the jump function. In the code editor, the code element at the current cursor position is identified and matched with the association mapping, dynamically adding visual markers to provide users with intuitive contextual hints. The first jump path is triggered by visual markers or shortcut keys, directly opening and locating the associated requirement document content, making reviewing the requirement background a one-click operation. The second jump path is triggered by clicking on a requirement item in the requirement viewing interface, guiding the IDE to jump to the associated code implementation location, facilitating requirement verification and implementation review. Most importantly, when the final association mapping is updated, the plugin receives a notification and refreshes the memory index and visual markers. This mechanism ensures that the association information presented in the development environment remains synchronized with the authoritative mapping maintained in the backend, avoiding misleading information caused by inconsistencies, guaranteeing the continuous accuracy and effectiveness of the integration function throughout the entire software iteration cycle, and realizing dynamic real-time updates of association data on the application side.
[0196] As an optional implementation, the specific method by which the processing module performs modification, confirmation, or rejection operations on the candidate association information to form a target association mapping and persistently store it includes:
[0197] The candidate association information list is displayed through a visual interface, sorted according to the similarity information or the confidence information.
[0198] In the visualization interface, a detailed view containing the original text of the requirement item information, the code element information, and the description of the association basis is matched for each of the candidate association information;
[0199] Through the visual interface, interactive operation information regarding each of the candidate association information is received;
[0200] The interactive operation information includes performing acceptance, rejection, manual creation, modification, or deletion operations on each of the candidate association information;
[0201] The target association mapping is generated based on the interactive operation information, and the target association mapping is stored in a database or metadata file in the form of structured data.
[0202] The method described in this implementation specifically outlines a human-machine collaborative decision-making process for transforming AI-generated candidate associations into authoritative final mappings. A visual interface displays a list of candidate associations sorted by similarity or confidence level, along with a detailed view containing the original requirement, code elements, and association criteria. This provides users with comprehensive, clear, and organized decision-making information, making manual review efficient and targeted. The interface receives user interactions such as accepting, rejecting, modifying, or deleting each candidate association. Building upon AI recommendations, it provides technical personnel with ultimate control and correction capabilities, allowing the integration of factors that AI struggles to fully capture, such as domain knowledge and project-specific logic, into the association decision-making process. Finally, based on these interactions, a target association mapping is generated and persistently stored in a structured format. This solidifies the confirmed associations into stable data assets that can be used long-term and accessed by other modules (such as IDE plugins), completing the crucial transformation from intelligent recommendation to authoritative finalization.
[0203] As an optional implementation, the processing module is further configured to:
[0204] Based on event-driven or timed scanning methods, detect changes to the requirement document or the code branch, and determine the document change data or code change data;
[0205] The methods for obtaining the document change data include:
[0206] Based on document difference identification, identify the changed requirement items that have been added, modified, or deleted in the requirement document, and use them as the document change data;
[0207] The methods for obtaining the code change data include:
[0208] Based on version control difference analysis, information on changed code elements that have been added, modified, or deleted in the code branch is determined and used as the code change data.
[0209] When a change is detected in either the requirement document or the code branch, the target association mapping generation process is re-executed based on the document change data or the code change data to generate a change impact analysis report and push it to a preset terminal.
[0210] The method described in this implementation introduces a dynamic maintenance mechanism to address continuous changes in software development. It detects changes to requirement documents or code branches through event-driven or timed scanning, and accurately captures newly added, modified, or deleted change items using document difference identification and version control difference analysis, achieving automatic change awareness. Once a change in either area is detected, the association mapping generation process is re-executed based on this change data. This is not a simple full recalculation, but a targeted analysis of the scope of the change's impact. This process can automatically assess "which existing code associations were affected by the requirement change" or "which requirement implementations were affected by code refactoring," and generate a change impact analysis report accordingly, which is then pushed to relevant personnel. This closed-loop design achieves full automation from automatic change discovery to automatic impact analysis and targeted result push, making the relationship between requirements and code no longer static, but automatically evolving and dynamically updating with project iterations, reflecting the latest project status in a timely manner. This greatly simplifies the complexity of change management, ensures the continuous effectiveness of project traceability during long-term development, and provides early warning of potential traceability disruptions or impact spread risks caused by changes.
[0211] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented by processing element calls to software, while others are implemented in hardware. For example, a processing module can be a separate processing element, or it can be integrated into a chip within the device. Alternatively, it can be stored as program code in the device's memory, and its functions can be called and executed by a processing element. The implementation of other modules is similar. Moreover, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. During implementation, each step of the above method or each of the above modules can be completed through integrated logic circuits in the hardware of the processor element or through software instructions.
[0212] Indicatively, such as Figure 3 As shown, Figure 3 This is a schematic diagram of the internal structure of a computer device 300 provided in an embodiment of this application. The computer device 300 can be provided as a server. (Refer to...) Figure 3The computer device 300 includes a processing component 302, which further includes one or more processors, and memory resources represented by memory 301 for storing instructions, such as application programs, that can be executed by the processing component 302. The application programs stored in memory 301 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 302 is configured to execute instructions to perform the methods of any of the embodiments described above.
[0213] The computer device 300 may also include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate on an operating system stored in memory 301, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.
[0214] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0215] This application provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the method provided in any embodiment.
[0216] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0217] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0218] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for bidirectional association between requirements documents and code, characterized in that, Includes the following steps: Receive the requirements document and the corresponding code branch; The requirement document and the code branch are parsed to obtain requirement item information corresponding to the requirement document and code element information corresponding to the code branch; Based on a pre-trained natural language understanding model, semantic vector processing is performed on each of the aforementioned requirement items and each of the aforementioned code element information to determine candidate association information corresponding to each of the aforementioned requirement items and each of the aforementioned code element information; The candidate association information includes the pairing relationship, similarity information, confidence information, and association basis information between each of the requirement item information and each of the code element information; The candidate association information is modified, confirmed, or rejected to form a target association mapping and persistently stored.
2. The method according to claim 1, characterized in that, The step of parsing the requirement document and the code branch to obtain requirement item information corresponding to the requirement document and code element information corresponding to the code branch includes: The requirement document is parsed using natural language processing to extract the requirement title, requirement description, and acceptance criteria, and then it is divided into multiple independent requirement items. Static code analysis is performed on the code branch to extract code element information from the code branch, and the name, comment information, method body content and call relationship of each code element are obtained. The code element information includes classes, methods, and interfaces; Furthermore, the step of performing semantic vector processing on each of the aforementioned requirement item information and each of the aforementioned code element information based on a pre-trained natural language understanding model to determine candidate association information corresponding to each of the aforementioned requirement item information and each of the aforementioned code element information includes: Based on the pre-trained natural language understanding model, the text content of each requirement item and the identification information of each code element are semantically vectorized to generate corresponding requirement semantic vectors and code semantic vectors. Based on the semantic vectorization representation, the semantic similarity between each of the requirement item information and each of the code element information is calculated; The semantic similarity is corrected based on the code structure features of each code element; The code structure features include method call chain features and class inheritance relationship features.
3. The method according to claim 1, characterized in that, The method further includes: Integrate the plugin in the integrated development environment, and based on the final association mapping, create visual markers and bidirectional jump paths corresponding to each of the aforementioned requirement items and code element information.
4. The method according to claim 3, characterized in that, The process of integrating plugins within an integrated development environment, based on the final association mapping, creates visual markers and bidirectional navigation paths corresponding to each of the aforementioned requirement items and code elements, including: Integrate plugins within an integrated development environment; The plugin loads the final association mapping upon startup and establishes an index relationship in memory. Within the code editor of the integrated development environment, the code element currently being edited or where the cursor is located is identified. If the code element exists in the final association mapping, a visual marker is added. Create the first jump path from the code side to the requirements side; The first jump path responds to an operation triggered by the visual identifier or a preset shortcut key, opening the associated requirement document and locating the corresponding requirement item information; Create a second jump path from the requirements side to the code side; The second jump path responds to the operation of clicking the requirement item information through the requirement viewing interface, guiding the integrated development environment to jump to the location of the associated code element information; Furthermore, when the final association mapping is updated, the plugin receives an update notification and refreshes the index relationship and the visualization identifier in its memory.
5. The method according to claim 1, characterized in that, The step of performing modification, confirmation, or rejection operations on the candidate association information to form a target association mapping and persistently store it includes: The candidate association information list is displayed through a visual interface, sorted according to the similarity information or the confidence information. In the visualization interface, a detailed view containing the original text of the requirement item information, the code element information, and the description of the association basis is matched for each of the candidate association information; Through the visual interface, interactive operation information regarding each of the candidate association information is received; The interactive operation information includes performing acceptance, rejection, manual creation, modification, or deletion operations on each of the candidate association information; The target association mapping is generated based on the interactive operation information, and the target association mapping is stored in a database or metadata file in the form of structured data.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: Based on event-driven or timed scanning methods, detect changes to the requirement document or the code branch, and determine the document change data or code change data; The methods for obtaining the document change data include: Based on document difference identification, identify the changed requirement items that have been added, modified, or deleted in the requirement document, and use them as the document change data; The methods for obtaining the code change data include: Based on version control difference analysis, information on changed code elements that have been added, modified, or deleted in the code branch is determined and used as the code change data. When a change is detected in either the requirement document or the code branch, the target association mapping generation process is re-executed based on the document change data or the code change data to generate a change impact analysis report and push it to a preset terminal.
7. A device for bidirectional association between requirements documents and code, characterized in that, include: The processing module is used to receive the requirements document and the corresponding code branch; The processing module is further configured to parse the requirement document and the code branch to obtain requirement item information corresponding to the requirement document and code element information corresponding to the code branch; The processing module is further configured to perform semantic vector processing on each of the requirement items and each of the code element information according to a pre-trained natural language understanding model, and determine candidate association information corresponding to each of the requirement items and each of the code element information; The candidate association information includes the pairing relationship, similarity information, confidence information, and association basis information between each of the requirement item information and each of the code element information; The processing module is also used to perform correction, confirmation or rejection operations on the candidate association information, form a target association mapping and persist it.
8. The apparatus according to claim 7, characterized in that, The specific methods by which the processing module parses the requirement document and the code branch to obtain requirement item information corresponding to the requirement document and code element information corresponding to the code branch include: The requirement document is parsed using natural language processing to extract the requirement title, requirement description, and acceptance criteria, and then it is divided into multiple independent requirement items. Static code analysis is performed on the code branch to extract code element information from the code branch, and the name, comment information, method body content and call relationship of each code element are obtained. The code element information includes classes, methods, and interfaces; Furthermore, the processing module performs semantic vector processing on each of the required item information and each of the code element information based on a pre-trained natural language understanding model to determine the specific method of candidate association information corresponding to each of the required item information and each of the code element information, including: Based on the pre-trained natural language understanding model, the text content of each requirement item and the identification information of each code element are semantically vectorized to generate corresponding requirement semantic vectors and code semantic vectors. Based on the semantic vectorization representation, the semantic similarity between each of the requirement item information and each of the code element information is calculated; The semantic similarity is corrected based on the code structure features of each code element; The code structure features include method call chain features and class inheritance relationship features.
9. A computer device, characterized in that, The method includes one or more processors and a memory storing computer-readable instructions that, when executed by the one or more processors, perform the steps of the method as described in any one of claims 1-6.
10. A storage medium, characterized in that, The storage medium stores computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the method as described in any one of claims 1-6.