Regression test-oriented code-demand intelligent mapping and automatic review method and system

By performing function-level difference analysis and correlation mapping on the source code data of large C/C++ projects, the problem of matching requirements with code in traditional regression testing has been solved, enabling efficient regression testing and review, and improving traceability and review efficiency.

CN121807677APending Publication Date: 2026-04-07LUOYANG INST OF ELECTRO OPTICAL EQUIP OF AVIC
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In large-scale C/C++ projects, traditional regression testing relies on manual methods, which has problems such as difficulty in matching requirements with code, difficulty in detecting function-level changes, lack of systematic review prompts, and difficulty in ensuring efficiency and consistency. Existing solutions are unable to support accurate regression review and visual tracking based on requirements.

Method used

By acquiring source code data and impact domain analysis reports from the current and historical versions, a syntax tree parser is used to perform function-level difference analysis. A semantic analysis model is then used to map the task set to the function difference list, and review prompts are constructed to achieve in-depth review.

Benefits of technology

Establishing a closed-loop link of 'requirement-code-problem' at the function level significantly improves traceability; increasing throughput and reducing costs through concurrency and budget strategies; accelerating location and review decisions by adopting structured persistence and visual maps; and providing interpretable rollback and verification paths to enhance project usability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121807677A_ABST
    Figure CN121807677A_ABST
Patent Text Reader

Abstract

The invention particularly relates to a regression test-oriented code-demand intelligent mapping and automatic review method. The method comprises the steps of obtaining source code data and an influence domain analysis report of a current version and a historical version corresponding to a to-be-processed program; performing fragmentation processing on the influence domain analysis report, and performing task planning analysis on the fragmented influence domain analysis report based on a preset prompt word template to obtain a corresponding task set; performing function-level difference analysis on the source code data of the current version and the historical version by using a syntax tree parser to obtain a function difference list; performing association mapping analysis on the function difference list and the task set, and determining a mapping relationship between each change task and an association change function; and aggregating the plurality of change functions mapped by each change task, and constructing review cues based on the influence domain analysis report and the source code data corresponding to the change functions so as to complete deep review. According to the method, accurate association and automatic review from the demand to the code can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and more specifically to a method and system for intelligent code-requirement mapping and automatic review for regression testing. Background Technology

[0002] In related technologies, especially in large-scale C / C++ projects, version evolution is frequent and has a wide-ranging impact across modules. Traditional regression testing activities mainly rely on manual methods to read change notes, manually search code, and manually compile review checklists. This approach has certain shortcomings, including: difficulty in matching requirements with code, difficulty in detecting function-level changes, lack of systematic review prompts, and difficulty in ensuring efficiency and consistency. Furthermore, existing solutions often remain at the file-level difference or keyword search level, making it difficult to support precise, requirement-oriented regression reviews and visual tracking.

[0003] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0004] This invention provides a method for intelligent code-requirement mapping and automatic review for regression testing, a system for intelligent code-requirement mapping and automatic review for regression testing, a computer program product, and an electronic device, which can effectively overcome the defects existing in the prior art to a certain extent.

[0005] Other features and advantages of the invention will become apparent from the following detailed description, or may be learned in part by practice of the invention.

[0006] According to a first aspect of the present invention, a method for intelligent code-requirement mapping and automatic review for regression testing is provided, the method comprising: Obtain the source code data of the current and historical versions of the program to be processed, as well as the impact domain analysis report; The impact domain analysis report is segmented, and task planning and parsing are performed on the segmented impact domain analysis report based on a preset prompt word template to obtain the corresponding task set; wherein, the task set includes several change tasks corresponding to the target version; A syntax tree parser is used to perform function-level difference analysis on the source code data of the current version and historical versions to obtain a list of function differences; the list of function differences includes several changed functions; Perform association mapping parsing on the function difference list and task set to determine the mapping relationship between each change task and the associated change function; Several change functions mapped to each change task are aggregated, and review prompts are constructed based on the impact domain analysis report and the source code data corresponding to the change functions to complete in-depth reviews.

[0007] In some exemplary implementations, the source code data of the current and historical versions of the program to be processed, as well as the impact domain analysis report, are obtained, including: Retrieve the compressed files corresponding to the current version and previous versions, and extract them to the version directory of the workspace; The impact domain analysis report for the current version is stored in the root directory of the workspace.

[0008] In some exemplary embodiments, the method further includes: The task planning and parsing results of the impact domain analysis report are processed based on the pre-configured token budget management rules to obtain the processed task set.

[0009] In some exemplary embodiments, the task set includes a task identifier, task name, task description, and change type corresponding to each change task.

[0010] In some exemplary implementations, a syntax tree parser is used to perform function-level difference analysis on the source code data of the current version and historical versions to obtain a list of function differences, including: Compare the current version of the source code data with the source code data of historical versions to determine the functions to be changed; Obtain the original and updated code corresponding to the changed function, perform code analysis, and determine the corresponding function change type and code change summary description; The similarity parameter is calculated based on the original code and the updated code of the modified function.

[0011] In some exemplary embodiments, an association mapping process is performed on the function difference list and the task set to determine the mapping relationship between each change task and the associated change function, including: The semantic analysis model is invoked to evaluate the correlation between each changed function in the task set and the function difference list, and the correlation evaluation results between each changed task and the changed function in the task set are determined. The correlation evaluation results include: associated task identifier, mapping confidence, and mapping description data.

[0012] In some exemplary embodiments, the method further includes: A change function has a mapping relationship with one or more change tasks.

[0013] In some exemplary embodiments, the method further includes: Test report data is generated based on the results of in-depth review.

[0014] According to a second aspect of the present invention, a system for intelligent code-requirement mapping and automatic review for regression testing is provided, the system comprising: The file management module is used to obtain the source code data of the current and historical versions of the program to be processed, as well as the impact domain analysis report; The task planning module is used to segment the impact domain analysis report and perform task planning and parsing on the segmented impact domain analysis report based on a preset prompt word template to obtain the corresponding task set; wherein, the task set includes several change tasks corresponding to the target version; The function difference analysis module is used to perform function-level difference analysis on the source code data of the current version and historical versions using a syntax tree parser, and obtain a list of function differences; the list of function differences includes several changed functions; The mapping analysis module is used to perform association mapping between the function difference list and the task set, and to determine the mapping relationship between each change task and the associated change function. The in-depth review module is used to aggregate several change functions mapped to each change task, and to construct review prompts based on the impact domain analysis report and the source code data corresponding to the change functions, in order to complete the in-depth review.

[0015] According to a third aspect of the present invention, a computer program product is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, the above-described method for intelligent code-requirement mapping and automatic review for regression testing is implemented.

[0016] According to a fourth aspect of the present invention, a storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the above-described method for intelligent code-requirement mapping and automatic review for regression testing.

[0017] According to a fourth aspect of the present invention, an electronic device is provided, comprising: Processor; and Memory for storing the executable instructions of the processor; The processor is configured to implement the above-described method of intelligent code-requirement mapping and automatic review for regression testing when executing the executable instructions.

[0018] The code-requirement intelligent mapping and automatic review method for regression testing provided in the embodiments of the present invention obtains the corresponding task set and function difference list by parsing the source code data of the current and historical versions of the program to be processed, as well as the impact domain analysis report, and performs correlation mapping parsing. This allows for review based on the mapping results, thereby establishing a closed-loop link of "requirement-code-issue" at the function granularity, significantly improving traceability. This method accurately and stably maps the change intentions in the impact domain analysis report to executable regression tasks, identifies real changes between different versions at the function granularity, and suppresses irrelevant noise and formatting differences.

[0019] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description

[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention. It is obvious that the drawings described below are merely some embodiments of the invention, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0021] Figure 1 This illustration schematically depicts a method for intelligent code-requirement mapping and automatic review for regression testing, as exemplified by an embodiment of the present invention. Figure 2 This illustration schematically shows a method architecture for intelligent code-requirement mapping and automatic review for regression testing in an exemplary embodiment of the present invention; Figure 3 The diagram illustrates a function-level difference mapping method according to an exemplary embodiment of the present invention. Figure 4 This diagram illustrates an in-depth review and problem persistence method in an exemplary embodiment of the present invention. Figure 5 The diagram illustrates a method for report export in an exemplary embodiment of the present invention. Figure 6 The diagram illustrates the composition of an electronic device according to an exemplary embodiment of the present invention. Detailed Implementation

[0022] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that the invention will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0023] Furthermore, the accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0024] To address the shortcomings and deficiencies of existing technologies, this example implementation provides a method for intelligent code-requirement mapping and automated review for regression testing, applicable to the automation of regression testing and review in large C / C++ projects. (Reference) Figure 1 As shown, the method includes: Step S11: Obtain the source code data of the current version and historical versions of the program to be processed, as well as the impact domain analysis report; Step S12: The impact domain analysis report is segmented, and the segmented impact domain analysis report is parsed based on a preset prompt word template to obtain the corresponding task set; wherein, the task set includes several change tasks corresponding to the target version; Step S13: Use a syntax tree parser to perform function-level difference analysis on the source code data of the current version and historical versions to obtain a list of function differences; the list of function differences includes several changed functions. Step S14: Perform association mapping parsing on the function difference list and task set to determine the mapping relationship between each change task and the associated change function; Step S15: Aggregate several change functions mapped to each change task, and construct review prompts based on the impact domain analysis report and the source code data corresponding to the change functions to complete in-depth review.

[0025] The beneficial effects of this invention include: Establishing a closed-loop link of "requirement-code-problem" at the function level significantly improves traceability; Improve throughput and reduce costs through concurrency and budget strategies; Employing structured persistence and visual maps accelerates location and review decisions; Provides interpretable rollback and verification paths for abnormal and uncertain scenarios, enhancing project usability.

[0026] The following will describe in more detail each step of the code-requirement intelligent mapping and automatic review method for regression testing in this example embodiment, with reference to the accompanying drawings and embodiments.

[0027] In step S11, the source code data of the current version and historical versions of the program to be processed, as well as the impact domain analysis report, are obtained.

[0028] For example, a user can select the application for which regression testing needs to be performed on a smart terminal device. In the regression review interface, the user can upload source code data for the current version and historical versions, as well as the impact domain analysis report corresponding to the current version of the application. A corresponding data analysis task can be assigned to the uploaded data and sent to the backend server, which then executes the data analysis task.

[0029] Specifically, the source code data being processed can be the latest version of the application's source code, as well as the code from the most recent historical version. Alternatively, it can be any two historical versions of the source code selected for testing based on actual business needs. The impact domain analysis report can include descriptions of application requirement changes, design changes, and functional changes. These descriptions can include newly added, modified, and deleted data. Furthermore, the descriptions can also include corresponding code change descriptions. For example, an impact domain analysis report template can be pre-configured, and the various data sections can be added to the corresponding content within the template.

[0030] For example, step S11 described above may include: Step S21: Obtain the compressed files corresponding to the current version and the historical versions, and decompress them to the version directory of the workspace; Step S22: Store the impact domain analysis report corresponding to the current version in the root directory of the workspace.

[0031] Specifically, it can receive compressed packages of the previous and new versions of code, along with impact domain analysis reports, and extract them to the version directories of the temporary workspace (e.g., v1.00 and v1.01). The original report files or extracted artifacts are copied to the root directory for later reference, and the merged workspace path is recorded. For example, it can call upload and task management APIs to implement data upload, task startup, task progress reading, and report data download functions.

[0032] In step S12, the impact domain analysis report is segmented, and the segmented impact domain analysis report is parsed based on a preset prompt word template to obtain the corresponding task set; wherein, the task set includes several change tasks corresponding to the target version.

[0033] For example, for the input impact domain analysis report, it can first be segmented to extract core data fragments. Then, using preset prompt word templates, the core fragment data can be parsed to obtain the corresponding change tasks and the change data for each task. A task set can then be generated based on each change task. For each change task, corresponding task description data can be generated, including a task set with task identifier, name, description, and change type.

[0034] For example, during the segmentation process, the structural content of the report can be retained first, while non-critical paragraphs can be compressed or truncated. Preset fields are used to extract feature data from the segmented report data. For instance, the currently identified task set includes three requirement change tasks, two design change tasks, and one code change task. Preset feature fields are used to extract the task description data corresponding to each change task.

[0035] For example, the method further includes: organizing the task planning parsing results of the impact domain analysis report based on pre-configured token budget management rules to obtain an organized task set.

[0036] Specifically, by employing prompt word segmentation and token budget management, the structured content of the report is prioritized for retention, while non-critical paragraphs are compressed or truncated, thereby generating a stable task set within a fixed token limit. Change tasks deleted based on token budget management can be automatically written into other change task sets as a fallback.

[0037] In step S13, a syntax tree parser is used to perform function-level difference analysis on the source code data of the current version and historical versions to obtain a list of function differences; wherein, the list of function differences includes several changed functions.

[0038] For example, step S13 described above may include: Step S31: Compare the source code data of the current version with the source code data of the historical versions to determine the functions to be changed; Step S32: Obtain the original code and updated code corresponding to the changed function, perform code analysis, and determine the corresponding function change type and code change summary description; Step S33: Calculate the similarity parameter based on the original code and the updated code of the modified function.

[0039] Specifically, refer to Figure 3As shown, a syntax tree parser can be invoked to perform function-level comparisons of the two versions of source code, identifying each changed function in the source code. Simultaneously, the change type for each changed function can be determined, such as addition / modification / deletion. Furthermore, the old code from the historical version corresponding to the changed function can be extracted from the new code of the current version. A corresponding code change summary can be generated based on the extracted code. This code change summary can include: the function name of the changed function and a description of its corresponding function. In addition, for each changed function, the similarity between the two versions of code can be calculated using the extracted code. The changed functions can then be prioritized based on the similarity results. A lower code similarity indicates a larger change in the changed function and its corresponding code, and these functions should be processed first. Conversely, a higher similarity indicates a smaller change in the changed function and its corresponding code, which may be noise.

[0040] In step S14, the function difference list and task set are associated and mapped to determine the mapping relationship between each change task and the associated change function.

[0041] For example, step S14 above may specifically include: calling a semantic analysis model to perform correlation assessment on each changed function in the task set and the function difference list, and determining the correlation assessment results between each changed task and the changed function in the task set; wherein, the correlation assessment results include: associated task identifier, mapping confidence, and mapping description data.

[0042] For details, please refer to Figure 4 As shown, for each change function, a semantic analysis model can be invoked. Taking a change function and a task set as input, the model determines which change task in the task set is associated with the change function and establishes a mapping relationship between the change function and at least one change task. A change function can have a mapping relationship with one or more change tasks. Furthermore, a change task can have a mapping relationship with one or more change functions, indicating that the completion of a change task requires the support of multiple change functions.

[0043] Specifically, for each function difference, independent prompt words are constructed and the model is called concurrently to obtain the associated task identifier, mapping confidence, reason, score, and whether it is mentioned in the report; the returned task identifier is validated for format and whitelist, and if invalid, it is rolled back to "other changes", and finally persisted as a mapping record. The whitelist can be the task set mentioned above.

[0044] In step S15, several change functions mapped to each change task are aggregated, and review prompts are constructed based on the impact domain analysis report and the source code data corresponding to the change functions to complete in-depth review.

[0045] For example, for each change task, when there are multiple mapped change functions, the multiple change functions can be aggregated.

[0046] For details, please refer to Figure 5 As shown, the system can aggregate mapping differences by task, construct review prompts based on the original task report content and selected code snippets, and output a list of issues. Each issue includes at least the issue level, name, location, impact, and rules, and is stored in the database in a four-part format. Function records are also created or associated to carry source code excerpts.

[0047] For example, when performing in-depth review, fragments can be selected using three strategies: confidence priority, file overwrite, and compression alternatives. If the limit is exceeded, half of the fragments are cropped and compressed again.

[0048] Alternatively, a code map can be constructed by using files and functions as nodes, inclusion and call as edges, and overlaying problem density and task distribution.

[0049] For example, the method further includes generating test report data based on the in-depth review result data.

[0050] Specifically, refer to Figure 5 As shown, the server can generate test report data based on the review issue form and send it back to the user's terminal device.

[0051] For example, concurrency thresholds for smart mapping and automatic review tasks can be configured, and maximum concurrency can be configured; single-difference tasks are degraded to sequential processing.

[0052] In addition, a corresponding thread can be created for each task, and each thread can be configured with an independent log folder to output the full text of task requests and responses for review.

[0053] Each mapping is submitted in an independent session, and failure does not affect other mappings; global statistics are summarized at the end.

[0054] In addition, task IDs are strictly whitelisted; invalid / empty results are reverted to "Other Changes". For example, the input data of the model can be anonymized, and a corresponding anonymized log can be created. The prompt words and codes can be masked; sensitive credentials cannot be written.

[0055] Meanwhile, upload / download functionality can be integrated with unified authentication to enable user access control.

[0056] The workspace uses a temporary directory and scheduled cleanup to avoid data residue and achieve resource isolation.

[0057] For example, for data models and table structures, files may include file_id, file_name, file_path, extract_path, and file_type (old / new / report / merged).

[0058] The regression tasks include: analysis_task_id, task_id, task_name, task_description, change_type, and original_report_content.

[0059] Mapping records include: analysis_task_id, task_id, file_path, function_name, change_type, old_code / new_code, diff_summary, mapping_confidence, mapping_reason, mapping_score, mentioned_in_report.

[0060] Functions include: file_id, function_name, start_line, end_line, source_code, file_path, analyzed.

[0061] Issues include: task_id, file_id, function_id, regression_task_id, file_name, source_code, violation_rules, issue_level, issue_name, issue_location, description_requirement / issue / location / impact.

[0062] For example, regarding interfaces and interaction flows, Upload: / upload_file (old / new / report), verify the file extension and decompress the code; Start: / start_analysis, create a task and execute data preparation → planning → mapping → review → reporting in the background; Progress: / task_progress / {task_id}; Map: / codemap / {task_id}, / codemap / {task_id} / node / {node_id}, / codemap / {task_id} / search; Download: / download_report / {task_id}.

[0063] Regarding token budget and hint strategy: Task planning: Calculate template tokens, and use the remaining amount for report content; prioritize retaining chapter titles and key "Add / Modify / Delete / Change" lines, and downgrade templates if necessary.

[0064] Difference mapping: Construct "change details + task set", truncate and annotate excessively long code; always record the original prompt words for traceability.

[0065] In-depth review: Select segments based on three strategies: confidence priority, file overwrite, and compression alternatives. If the limit is exceeded, half of the segments are cut off and compressed again.

[0066] To consider the system's performance and scalability, the complexity is defined as follows: function difference extraction is approximately O(F); mapping and review after concurrency are approximately O(C / P), where C is the number of differences and P is the degree of concurrency.

[0067] Scalability features: Language adaptation: The AST parser is replaceable / extendable; Storage expansion: Issues and mapping tables can be partitioned by analysis task; Computation extension: Mapping and censorship can be switched to distributed queue execution.

[0068] For example, a method for intelligent code-requirement mapping and automated review for regression testing may include the following steps: S1 receives the previous version code, the new version code, and the impact domain report, and creates a workspace containing the version directory; S2, perform task planning on the report and generate a task set that includes task identifier, name, description and change type; S3 performs function-level difference analysis based on abstract syntax trees to obtain function names, change types, old / new code, and summaries; S4: Construct prompt words for each function difference, call the artificial intelligence model, output the association results with the task set, the association confidence, reason and score, verify according to the rules and store in the database; S5 aggregates mapped function differences by task, generates in-depth review prompts, obtains a list of issues, and stores them in a four-segment structured database. S6 builds a code map based on file / function nodes, call and containment relationships, overlays problem and task information, and supports searching and exporting.

[0069] For example, in Implementation Example 1 (minor modification): 10 functions are modified → mapping is completed concurrently, generating 3 tasks and several issue entries, and a report is submitted indicating that the current export has completed regression review.

[0070] Example 2 (Large-scale modification): Hundreds of functions changed → Representative segments were selected according to the file coverage strategy, and in-depth reviews were conducted in batches to finally cover all modules and generate statistics.

[0071] Example 3 (No Report as a Backup): Report missing or low quality → An empty task set is generated during the planning phase and "Other Changes" are automatically added. All differences are mapped to the backup task, and the problem list and report export can still be completed.

[0072] The method provided in the embodiments of the present invention is referred to Figure 2 As shown, the process mainly includes data preparation, task planning, difference mapping, in-depth review, map construction, and report export. By performing function-level code comparison, it can identify real changes between versions at the function granularity, suppressing irrelevant noise and formatting differences. Through parsing the impact domain analysis report, it achieves intelligent mapping of differences to tasks at a controllable cost (tokens and computing resources), ensuring that the results are verifiable, traceable, and fallbackable. It generates a structured, statistically significant list of issues and a visual map, supporting rapid location, review, and report output. Furthermore, it can accurately and reliably map the change intentions in the report to executable regression tasks.

[0073] The method provided in this invention can be applied to software projects in industries such as military, communications, automotive electronics, and finance that have high requirements for regression reliability and traceability, and is particularly suitable for continuous version evolution scenarios of large-scale C / C++ existing projects.

[0074] It should be noted that the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may, for example, be executed synchronously or asynchronously in multiple modules.

[0075] In one exemplary embodiment, a system for intelligent code-requirement mapping and automated review for regression testing is provided, applied to the method described above. The system includes: The file management module is used to obtain the source code data of the current and historical versions of the program to be processed, as well as the impact domain analysis report; The task planning module is used to segment the impact domain analysis report and perform task planning and parsing on the segmented impact domain analysis report based on a preset prompt word template to obtain the corresponding task set; wherein, the task set includes several change tasks corresponding to the target version; The function difference analysis module is used to perform function-level difference analysis on the source code data of the current version and historical versions using a syntax tree parser, and obtain a list of function differences; the list of function differences includes several changed functions; The mapping analysis module is used to perform association mapping between the function difference list and the task set, and to determine the mapping relationship between each change task and the associated change function. The in-depth review module is used to aggregate several change functions mapped to each change task, and to construct review prompts based on the impact domain analysis report and the source code data corresponding to the change functions, in order to complete the in-depth review.

[0076] Specifically, the function-level difference analysis module performs syntax-level parsing of multi-language source code using a tree parser, outputting structured difference entries consisting of file paths, function names, change types, old / new code, and summaries. The mapping analysis module features concurrency control, prompt word construction, token estimation, result validation, and rollback strategies, outputting mapping records that include task identifiers, confidence levels, reasons, scores, and whether the record is mentioned in the report. The deep review module generates a problem list based on the original task report content and selected code difference fragments, storing it in a four-segment structure, and simultaneously creating function records to hold the source code and line number ranges.

[0077] For example, the system may also include a code map module and a report export module. The code map module provides the ability to export map data as JSON and a graphical description language, and exposes node details, a problem list, search, and statistics interfaces.

[0078] Each module interacts with the database and the message / log subsystem to achieve data integration and progress visualization.

[0079] For example, the system is capable of: Task planning: Based on the impact domain report, a standardized task set is generated using templated prompts and token budget management, and a fallback task of "other changes" is added.

[0080] Function-level differences: Based on the syntax tree (AST), the comparison generates new / modified / deleted entries at the function level, along with old / new code and meta-information such as summary and similarity.

[0081] Intelligent mapping: For each difference, the artificial intelligence model is called independently and concurrently, and the relevant task identifier, confidence level, reason and score are output; the results are validated for format and whitelist, and if invalid, the mapping is rolled back.

[0082] In-depth review: Aggregate differences by task, construct review prompts based on the original report content and selected excerpts, and output four-part issue items into the database.

[0083] Maps and Reports: Construct a code map of file / function nodes and include / call relationships, overlaying task and issue information; export two worksheets: issue form and mapping information.

[0084] Key features include: Function-level difference extraction and fragment selection based on confidence / coverage / compression strategies; Keyword segmentation and token budgeting, combined with a fallback template, ensure stable parameter output within the limit; Task ID whitelist verification and "other changes" rollback mechanism ensure a closed-loop mapping process; The four-stage problem structure and function records are persisted to ensure traceability and verification. The code map provides interfaces for data export, search, and statistics.

[0085] The specific implementation of each module corresponds to the method described above, and will not be repeated in this embodiment.

[0086] It should be noted that although several modules or units of the device for performing actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0087] Figure 6 A schematic diagram of an electronic device suitable for implementing embodiments of the present invention is shown.

[0088] It should be noted that, Figure 6 The electronic device 1000 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0089] like Figure 6As shown, the electronic device 1000 includes a Central Processing Unit (CPU) 1001, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 1002 or programs loaded from storage section 1008 into Random Access Memory (RAM) 1003. The RAM 1003 also stores various programs and data required for system operation. The CPU 1001, ROM 1002, and RAM 1003 are interconnected via a bus 1004. An Input / Output (I / O) interface 1005 is also connected to the bus 1004. Furthermore, the electronic device 1000 also includes an FPGA device and a System-on-a-Chip (SoC) device.

[0090] The following components are connected to I / O interface 1005: an input section 1006 including a keyboard, mouse, etc.; an output section 1007 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to I / O interface 1005 as needed. Removable media 1011, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1010 as needed so that computer programs read from them can be installed into storage section 1008 as needed.

[0091] In particular, according to embodiments of the present invention, the processes described below with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a storage medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1009, and / or installed from removable medium 1011. When the computer program is executed by central processing unit (CPU) 1001, it performs various functions defined in the system of this application.

[0092] Specifically, the aforementioned electronic devices can be airborne intelligent electronic devices, such as airborne video processing equipment.

[0093] It should be noted that the storage medium shown in the embodiments of the present invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, wherein computer-readable program code is carried. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any storage medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0094] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0095] The units described in the embodiments of the present invention can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.

[0096] It should be noted that, as another aspect, this application also provides a storage medium, which may be included in an electronic device or may exist independently without being assembled into the electronic device. The aforementioned storage medium carries one or more programs, which, when executed by an electronic device, cause the electronic device to perform the methods described in the following embodiments. For example, the electronic device may perform... Figure 1 The steps of the method shown.

[0097] In one embodiment, this application provides a computer program product including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0098] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0099] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the claims.

[0100] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A method for intelligent code-requirement mapping and automatic review for regression testing, characterized in that, The method includes: Obtain the source code data of the current and historical versions of the program to be processed, as well as the impact domain analysis report; The impact domain analysis report is segmented, and task planning and parsing are performed on the segmented impact domain analysis report based on a preset prompt word template to obtain the corresponding task set; wherein, the task set includes several change tasks corresponding to the target version; A syntax tree parser is used to perform function-level difference analysis on the source code data of the current version and historical versions to obtain a list of function differences; the list of function differences includes several changed functions; Perform association mapping parsing on the function difference list and task set to determine the mapping relationship between each change task and the associated change function; Several change functions mapped to each change task are aggregated, and review prompts are constructed based on the impact domain analysis report and the source code data corresponding to the change functions to complete in-depth reviews.

2. The method according to claim 1, characterized in that, Obtain the source code data of the current and historical versions of the program to be processed, as well as the impact domain analysis report, including: Retrieve the compressed files corresponding to the current version and previous versions, and extract them to the version directory of the workspace; The impact domain analysis report for the current version is stored in the root directory of the workspace.

3. The method according to claim 1, characterized in that, The method further includes: The task planning and parsing results of the impact domain analysis report are processed based on the pre-configured token budget management rules to obtain the processed task set.

4. The method according to claim 1, characterized in that, The task set includes the task identifier, task name, task description, and change type for each change task.

5. The method according to claim 1, characterized in that, Using a syntax tree parser, perform function-level difference analysis on the source code data of the current version and historical versions to obtain a list of function differences, including: Compare the current version of the source code data with the source code data of historical versions to determine the functions to be changed; Obtain the original and updated code corresponding to the changed function, perform code analysis, and determine the corresponding function change type and code change summary description; The similarity parameter is calculated based on the original code and the updated code of the modified function.

6. The method according to claim 1, characterized in that, The function difference list and task set are associated and mapped to determine the mapping relationship between each change task and the associated change function, including: The semantic analysis model is invoked to evaluate the correlation between each changed function in the task set and the function difference list, and the correlation evaluation results between each changed task and the changed function in the task set are determined. The correlation evaluation results include: associated task identifier, mapping confidence, and mapping description data.

7. The method according to claim 6, characterized in that, The method further includes: A change function has a mapping relationship with one or more change tasks.

8. The method according to claim 6, characterized in that, The method further includes: Test report data is generated based on the results of in-depth review.

9. A system for intelligent code-requirement mapping and automatic review for regression testing, characterized in that, The system includes: The file management module is used to obtain the source code data of the current and historical versions of the program to be processed, as well as the impact domain analysis report; The task planning module is used to segment the impact domain analysis report and perform task planning and parsing on the segmented impact domain analysis report based on a preset prompt word template to obtain the corresponding task set; wherein, the task set includes several change tasks corresponding to the target version; The function difference analysis module is used to perform function-level difference analysis on the source code data of the current version and historical versions using a syntax tree parser, and obtain a list of function differences; the list of function differences includes several changed functions; The mapping analysis module is used to perform association mapping between the function difference list and the task set, and to determine the mapping relationship between each change task and the associated change function. The in-depth review module is used to aggregate several change functions mapped to each change task, and to construct review prompts based on the impact domain analysis report and the source code data corresponding to the change functions, in order to complete the in-depth review.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method for intelligent code-requirement mapping and automatic review for regression testing as described in any one of claims 1 to 9.