Source code change analysis method, system and equipment

Through a source code change analysis method, the problem of difficulty in evaluating the impact scope of code changes in industrial software is solved, and the content and scope of code changes are accurately identified, testing efficiency and accuracy are improved, and software quality and stability are ensured.

CN119597657APending Publication Date: 2025-03-11广域铭岛数字科技有限公司 +1
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202411673901.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

In the process of industrial software development, as the scale of the project expands and personnel changes, it becomes increasingly difficult to find members who have a comprehensive understanding of business logic and implementation details to evaluate the impact of code changes, resulting in the inability to accurately evaluate the impact after repairing defects or modifying the code logic, which may lead to serious online failures or factory shutdowns.

Method used

A source code change analysis method is proposed. By obtaining the project source code and its identifier, comparing the differences between different versions, determining the content of code changes, filtering unimportant changes, analyzing the method call relationship, building a method call link map, identifying the change-influence link map, analyzing the impact range, and designing test cases to evaluate the test coverage.

Benefits of technology

It realizes accurate identification of specific content of code changes, reduces the possibility of human error, improves testing efficiency and accuracy, ensures that the software maintains high quality and stability in each iteration, and shortens the time to identify changes and analyze the scope of impact.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597657A_ABST
    Figure CN119597657A_ABST
Patent Text Reader

Abstract

The invention discloses a source code change analysis method, system and equipment. The method comprises the following steps: acquiring a project source code and identifiers corresponding to the project source code in at least two versions; comparing differences of project source codes between different versions based on the identifiers, and determining code change content; filtering the code change content according to a preset filtering rule, and determining a change method name; performing code analysis on a method calling relation in the project source code, and determining a method calling link diagram; identifying the method calling link diagram by referring to a change method name, and determining a change influence link diagram; analyzing according to the entry of the change influence link diagram, and determining the range of the entry and a corresponding calling link; according to the method and the device, case design is performed according to the range of the code change influence entry and the corresponding calling link, and the evaluation of the test coverage is completed, so that the efficiency of test work is improved, the possibility of human errors is reduced, the test result is more accurate and reliable, and the evaluation of the test coverage is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software testing, and in particular to a source code change analysis method, system and device. Background Art

[0002] With the rapid development of information technology, software has become an indispensable infrastructure for all walks of life. In the field of industrial production, standardized software products need to be customized and developed based on standard products according to the specific needs of customers, and finally deliver software products that meet specific functional requirements. Compared with ordinary software, industrial software is not only larger in scale and more complex in logic, but also has extremely high requirements for stability and reliability. This type of software usually involves key production processes and equipment control. Any slight error may lead to serious production interruptions or economic losses. Therefore, high standards of quality control measures must be strictly followed during the design and development process.

[0003] However, in related technologies, with the continuous expansion of the scale of industrial software and the changes in project members, it is becoming increasingly difficult to find members who fully understand the business logic and implementation details to evaluate the scope of impact of code changes. In addition, if R&D cannot accurately assess the scope of impact and perform test verification after fixing defects or modifying code logic, it may lead to serious online failures or even factory shutdowns. Therefore, in the field of industrial software quality assurance, a source code change analysis solution is urgently needed. In order to ensure the quality of software online and avoid potential risks, it is necessary to introduce an efficient testing strategy from a technical level to accurately assess the scope of impact of code changes, thereby ensuring the comprehensiveness and effectiveness of test verification. Summary of the invention

[0004] In view of the above-mentioned shortcomings of the prior art, the present application discloses a source code change analysis method, system and device, which are used to solve the technical problems of inaccurate and low efficiency of the above-mentioned source code change analysis results.

[0005] The first aspect of the present application discloses a source code change analysis method, comprising: obtaining a project source code and an identifier corresponding to at least two versions of the project source code; comparing the differences between the project source code of at least two versions based on the identifier to determine the code change content; filtering the code change content according to a preset filtering rule to determine the changed method name; performing code analysis on the method call relationship in the project source code to determine a method call link diagram; identifying the method call link diagram with reference to the changed method name to determine a change impact link diagram; analyzing according to the entry of the change impact link diagram to determine the scope of the code change impact entry and the corresponding call link; performing use case design according to the scope of the code change impact entry and the corresponding call link to complete the test coverage evaluation.

[0006] In certain embodiments of the first aspect of the present application, comparing the differences in the project source code between at least two versions based on the identifier to determine the code change content includes: determining the code change description and submission time of each of the project source codes based on the identifier; performing an integrity check based on the code change description and submission time of the project source code; after the check is passed, analyzing the differences in the project source code between at least two versions through code Diff technology to determine the code change content.

[0007] In certain embodiments of the first aspect of the present application, the code Diff technology is used to analyze the differences of the project source code between at least two versions to determine the code change content, including: taking at least one version as a historical version, and performing a difference comparison between the source code corresponding to the historical version and the source code corresponding to the latest version; if the comparison result includes that the source code corresponding to the historical version is more than the source code corresponding to the latest version, determining that the source code corresponding to the latest version is reduced; if the comparison result includes that the source code corresponding to the historical version is less than the source code corresponding to the latest version, determining that the source code corresponding to the latest version is increased; if the comparison result includes that the source code corresponding to the historical version is changed relative to the source code corresponding to the latest version, determining that the source code corresponding to the latest version is modified; and determining the code change information according to at least one of reduction, increase or modification of the source code corresponding to the latest version.

[0008] In certain embodiments of the first aspect of the present application, the code change content is filtered according to preset filtering rules to determine the change method name, including: filtering the code change content one by one according to the preset filtering rules to eliminate the first code change content that does not meet the preset filtering rules; extracting the method name of the first code change content to determine the change method name, wherein the preset filtering rules include file type, irrelevant change information, and code unrelated to the business.

[0009] In certain embodiments of the first aspect of the present application, the method call relationship in the project source code is subjected to code analysis to determine a method call chain diagram, including: analyzing the method call relationship of the project source code based on static code analysis technology; performing syntax conversion on the project source code to determine an abstract syntax tree; traversing the abstract syntax tree to identify all method call nodes, wherein the method call node includes the name of the method, parameter type, and return type; and generating a method call chain diagram based on the method call node and the method call relationship.

[0010] In certain embodiments of the first aspect of the present application, the method call link diagram is identified by referring to the changed method name to determine the change impact link diagram, including: identifying the method call link diagram for the latest version according to the changed method name to obtain the change link; integrating the identified change links in the method call link diagram to determine the change impact link diagram.

[0011] In certain embodiments of the first aspect of the present application, the analysis is performed based on the entry of the change impact link diagram to determine the scope of the code change impact entry and the corresponding call link, including: extracting the top-level entry of the change impact link diagram according to the API interface to determine the entry of the change impact link; determining the scope of the code change impact entry based on the dependency relationship of each of the entry; and starting from the entry, drawing along the call relationship to determine the call link corresponding to the code change impact entry.

[0012] In certain embodiments of the first aspect of the present application, the use case design is performed according to the scope of the entry point affected by the code change and the corresponding call link to complete the test coverage evaluation, including: designing use cases according to the scope of the entry point affected by the code change and the corresponding call link to determine the code coverage of executing the test case; and evaluating the test coverage based on the execution status and test results of the test case.

[0013] The second aspect of the present application discloses a source code change analysis system, including: an acquisition module, used to acquire project source code and identifiers corresponding to at least two versions of the project source code; a comparison module, used to compare the differences between the project source code between at least two versions based on the identifier, and determine the code change content; a filtering module, used to filter the code change content according to preset filtering rules, and determine the changed method name; a method analysis module, used to perform code analysis on the method call relationship in the project source code, and determine the method call link diagram; a labeling module, used to identify the method call link diagram with reference to the changed method name, and determine the change impact link diagram; a change analysis module, used to analyze according to the entry of the change impact link diagram, and determine the scope of the code change impact entry and the corresponding call link; a change evaluation module, used to design use cases according to the scope of the code change impact entry and the corresponding call link, and complete the test coverage evaluation.

[0014] The third aspect of the present application discloses an electronic device, comprising: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the above method.

[0015] Beneficial effects of the present application: The present application obtains the project source code and its corresponding identifier, compares the differences of the project source code between at least two versions based on the identifier, determines the content of the code change, locates the code differences between different versions, and accurately determines which codes are modified, added or deleted, thereby identifying the specific content of the code change; uses preset filtering rules to exclude changes that have little impact on functions or performance, so that analysts can focus more on those code changes that really affect software behavior; by analyzing the method call relationship in the project source code, a method call link diagram is constructed, which not only helps to understand the internal workflow of the software, but also when the changed method name is identified on the method call link diagram, the link diagram affected by the change is determined, and the entry of the change-affected link diagram is analyzed to determine which functions or modules are affected by the change, and the affected entry and call link are tested, thereby ensuring the comprehensiveness and effectiveness of the test coverage, and greatly shortening the time for identifying changes, analyzing the scope of impact, and designing test cases; in this way, not only the efficiency of the testing work is improved, but also the possibility of human errors is reduced, making the test results more accurate and reliable, realizing automated code change identification, impact analysis, and test coverage evaluation, ensuring that the software can maintain high quality and stability in each iteration, thereby accelerating the time to market and reducing maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is an application environment diagram for implementing a source code change analysis method in an embodiment of the present application;

[0017] Figure 2 It is a flow chart of a source code change analysis method in an embodiment of the present application;

[0018] Figure 3 It is a complete flow chart of a source code change analysis method in an embodiment of the present application;

[0019] Figure 4 It is a method call relationship diagram in a source code change analysis method in an embodiment of the present application;

[0020] Figure 5 It is a change impact link diagram in a source code change analysis method in an embodiment of the present application;

[0021] Figure 6 It is a structural diagram of a source code change analysis system in an embodiment of the present application;

[0022] Figure 7 It is a schematic diagram of the architecture of a source code change analysis system in an embodiment of the present application;

[0023] Figure 8 It is a structural schematic diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0024] The following describes the implementation methods of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and sub-samples in the embodiments can be combined with each other without conflict.

[0025] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.

[0026] In the following description, a lot of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.

[0027] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so as to describe the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.

[0028] Unless otherwise stated, the term "plurality" means two or more.

[0029] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.

[0030] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.

[0031] Combination Figure 1 As shown, an implementation environment diagram of a source code change analysis method provided by an embodiment of the present disclosure includes a user end and a server end, wherein the user end and the server end are connected to a network and communicate with each other. In this application, the user end is the front end and the server end is the back end.

[0032] It should be understood that the source code change analysis method is applied to the server side. In some embodiments, the terminal can be at least one of a computer device, a desktop device, a smart phone, and a tablet device; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, and big data and artificial intelligence platforms; the software can be an application of the source code change analysis method, etc., but is not limited to the above forms.

[0033] Combination Figure 2 As shown, the embodiment of the present disclosure provides a flow chart of a source code change analysis method, including:

[0034] Step S201, obtaining a project source code and identifiers corresponding to at least two versions of the project source code;

[0035] Therein, the source code of the project is pulled from a version control system (such as Git, SVN, etc.), and a unique identifier corresponding to each version or submission (such as Git's Commit ID) is obtained, for example, through an API call or a command line tool.

[0036] For example, source code is the core of a software project, and identifiers are used to uniquely identify each version or code change point, facilitating difference analysis and tracking. For example, if the version control system does not support direct access to identifiers, you can manually record the information of each submission, that is, each version of the project source code corresponds to an identifier, at least two versions of identifiers, and can also be three identifiers, four identifiers, or multiple identifiers.

[0037] Step S202, comparing the differences of the project source code between at least two versions based on the identifier to determine the code change content;

[0038] Among them, use the Diff function of the version control system or a third-party code comparison tool to compare the source code differences between two or more versions and identify the newly added, deleted or modified code lines. For example, by comparing the source code of different versions, the specific content of the code changes can be identified. For version control systems that do not support the Diff function, you can manually compare the code.

[0039] You can also compare the differences of multiple files or modules in parallel to speed up the analysis process.

[0040] Step S203, filtering the code change content according to a preset filtering rule to determine the change method name;

[0041] Among them, write or configure preset filtering rules, such as ignoring non-functional changes such as comments, spaces, format adjustments, etc., and only focus on changes in key elements such as method names and class names.

[0042] By filtering non-critical changes, you can focus on code changes that have a substantial impact on software behavior. For example, manually filtering changes is inefficient. Another example is that you can process multiple filtering rules in parallel to increase processing speed. In this way, you can reduce noise and improve the accuracy and efficiency of subsequent analysis.

[0043] Step S204, performing code analysis on the method call relationship in the project source code to determine a method call chain diagram;

[0044] Among them, static code analysis tools are used or parsers are written to analyze the method call relationships in the source code and construct a method call chain diagram. For example, by parsing the method call statements in the source code, a call relationship diagram between methods can be constructed, which helps to understand the structure and behavior of the software. For another example, manually drawing a method call relationship diagram is time-consuming and error-prone. For another example, the method call relationships of multiple modules or files can also be analyzed in parallel.

[0045] Through the above method, the method calling relationship can be intuitively displayed, providing a basis for subsequent impact analysis.

[0046] Step S205, marking the method call link graph with reference to the changed method name, and determining the change impact link graph;

[0047] In the method call link diagram, the method call links directly related to the changed method name are marked to form a change impact link diagram. For example, by marking the changed method and its call link, the code area affected by the change can be identified.

[0048] For example, manually marking the change impact link is inefficient. Another example is that the impact analysis of multiple change methods can be processed in parallel. Through the above methods, the scope of the change impact is clarified, providing a basis for subsequent test design.

[0049] Step S206, analyzing the entry of the change impact link diagram to determine the scope of the code change impact entry and the corresponding call link;

[0050] Among them, the entry point of the change impact link diagram is analyzed, which methods or modules are the starting points of the change impact are determined, and their call links are traced.

[0051] For example, by identifying the entry points affected by the change, the scope of the change impact can be further refined and the specific call paths can be determined.

[0052] For example, manually analyzing entry points and call links may result in omissions or misunderstandings. Another example is that call links of multiple entry points can be analyzed in parallel. In this way, the entry points and call links affected by the change can be accurately identified, providing precise targets for test design.

[0053] Step S207, designing use cases according to the scope of entry points affected by the code change and the corresponding call links, and completing the evaluation of test coverage.

[0054] Among them, test cases are designed based on the scope of the entry point and the call link affected by the change to ensure that all affected code paths are covered.

[0055] For example, by designing targeted test cases, you can verify that changes work as expected and identify potential problems.

[0056] For example, test cases can be designed manually, but this may not be comprehensive or efficient enough. Another example is that multiple test cases can be designed in parallel to improve test coverage.

[0057] Through the above methods, we can not only ensure that the changes are fully tested and improve the software quality and stability; at the same time, by evaluating the test coverage, we can quantify the effectiveness of the testing work.

[0058] See also Figure 3 , is a complete flow chart of a source code change analysis method in an embodiment of the present application, which is described in detail as follows:

[0059] Before analysis, you need to configure the code address of the software product to be analyzed, the access token, the data identifiers of the two codes to be analyzed (such as the code Commit ID), the code change filtering rule base, etc. After pulling the code remotely, store it in a certain medium for subsequent analysis. The flow chart is as follows:

[0060] Step 1: Get project source code related information (including but not limited to address, access token, two commit IDs to be analyzed, etc.);

[0061] Step 2: Obtain code identifier-related information (such as code change description, submission time, etc.) by comparing code identifiers (such as code Commit ID) to perform benchmark verification to ensure that the compared code has passed complete testing and verification.

[0062] Step 3: Based on the source code and the data identifier of the code comparison (such as the code commit ID), all the contents of the code changes are analyzed through the code diff technology;

[0063] Step 4: Filter all the contents of the code changes according to the rules to filter out irrelevant changes, and obtain information such as method names affected by the code changes. The filtering rules include but are not limited to file types (such as .java, .xml files, etc.), irrelevant changes (such as comments, blank characters, import statements, etc.), and code unrelated to the business (such as defensive programming related capture and recording exceptions, simple logging, debug logs, performance monitoring related codes, etc.).

[0064] Step 5: Based on static code analysis technology, analyze the method call relationship of the project source code to form a method call chain diagram.

[0065] Step 6: Color the change methods filtered by the rules in step 4 in the link diagram in step 5 to obtain the code change impact link diagram.

[0066] Step 7: Extract the top-level entry (usually the Controller layer interface, scheduled tasks, OpenAPI, etc.) in the code change impact link diagram in step 6 to obtain the scope of the code change impact entry and the corresponding call link.

[0067] Step 8: Testers can know the scope of the impact of this code change by analyzing the entry points and corresponding links affected by the code change. Usually, the entry point of a call link corresponds to an interface or function point. Based on the affected entry points and corresponding call links, corresponding use cases can be designed to complete test coverage. In addition, if change rules that do not need to be analyzed are found during analysis, they can be added to the filter rule library.

[0068] In this embodiment, based on the source code Diff technology, the scope of the code change is analyzed from the code level, and irrelevant changes are filtered according to the code change filtering rule base to obtain the specific method names affected by the code change; based on the static code analysis technology, the method call link diagram is obtained, and then the specific methods affected by the code change are dyed in the method call link diagram to obtain the change impact link diagram, and then the top-level entry of the change impact link is extracted to obtain the code change impact entry and its call link. Usually, the entry of a call link corresponds to an interface or function point of industrial software.

[0069] Obtain the source code of the industrial software project and the data identifiers of the two codes to be analyzed (such as code Commit ID), and then analyze all the contents of the code changes through code Diff technology; configure the code change filtering rule library, including but not limited to file types (such as .java, .xml files, etc.), irrelevant changes (such as comments, blank characters, import statements, etc.), and business-irrelevant codes (such as defensive programming-related capture and recording exceptions, simple logging, debug logs, performance monitoring related codes, etc.). Filter all the contents of the code changes in the filtering rule library to obtain information such as methods affected by the code changes. Use static code analysis technology to analyze the calling relationship of the methods in the source code to form a method call link graph, and then dye the methods of this code change to obtain the change impact link. Finally, extract the entry and exit methods from the dyed link graph, and then combine the call link to obtain the entry range and corresponding link affected by the code change.

[0070] Through the above method, this application has the following technical effects:

[0071] 1) Compared with evaluating test coverage through incremental code coverage, this application starts from the methods and call links affected by code changes, and the impact range evaluated is more comprehensive and reliable, which can effectively ensure that the industrial software system can be fully tested and verified after the code is changed.

[0072] 2) This application analyzes the impact of code changes from a technical perspective, which is more accurate than project members' assessments and does not rely on personal experience. It is especially suitable for large-scale industrial software and software projects with frequent personnel changes.

[0073] 3) This application narrows the analysis scope by changing the filtering rule library through code, and continues to enrich the filtering rules in the subsequent process to improve the test analysis efficiency and save time.

[0074] Optionally, in some embodiments, comparing the differences of the project source code between at least two versions based on the identifier to determine the code change content includes:

[0075] Determine a code change description and submission time of each of the project source codes based on the identifier;

[0076] Perform integrity check based on the code change description and submission time of the project source code;

[0077] After the verification is passed, the difference of the project source code between at least two versions is analyzed by code Diff technology to determine the code change content.

[0078] Specifically, the version control system records all historical changes of the project. Each change is associated with a unique identifier and contains metadata about the change, such as the change description and submission time. By parsing these metadata, the change description and submission time of each version of the source code can be obtained.

[0079] For example, if the version control system does not support direct metadata extraction, you can manually view the log information of each commit, but this method is inefficient and error-prone. For example, for large projects, metadata extraction of multiple versions can be processed in parallel to improve efficiency; integrity verification and difference analysis provide the necessary basic data to ensure the accuracy and traceability of the analysis.

[0080] Specifically, by checking the continuity of version records and the integrity of metadata, possible data errors or omissions can be discovered and corrected in a timely manner. Manual integrity verification is time-consuming and error-prone. Automated scripts or tools can be used to assist the verification process. For example, since integrity verification usually does not involve complex calculations or data dependencies, verification tasks for multiple versions can be processed in parallel. Through integrity verification, it can be ensured that subsequent difference analysis is based on accurate and complete version records, thereby improving the accuracy and reliability of the analysis.

[0081] Specifically, code diff technology is the core method for identifying code changes. By comparing different versions of source code, it is possible to accurately identify which code lines have changed and the specific content of the changes.

[0082] For example, the difference analysis between multiple version pairs can be processed in parallel to improve efficiency. Especially when a large number of versions need to be compared, parallel processing can significantly reduce the analysis time.

[0083] In this embodiment, the code Diff technology can be used to accurately identify code changes, providing an important basis for subsequent code review, test design, and other work; at the same time, the results of the difference analysis can also be used to generate change logs, update documents, etc., to improve the maintainability and traceability of the project.

[0084] Optionally, in some embodiments, the difference analysis of the project source code between at least two versions by code Diff technology is used to determine the code change content, including:

[0085] Taking at least one version as a historical version, and performing a difference comparison between source code corresponding to the historical version and source code corresponding to the latest version;

[0086] If the comparison result includes that the source code corresponding to the historical version is more than the source code corresponding to the latest version, then determining that the source code corresponding to the latest version is reduced;

[0087] If the comparison result includes that the source code corresponding to the historical version is less than the source code corresponding to the latest version, determining that the source code corresponding to the latest version is increased;

[0088] If the comparison result includes that the source code corresponding to the historical version is changed relative to the source code corresponding to the latest version, determining that the source code corresponding to the latest version is modified;

[0089] Code change information is determined according to at least one of reduction, addition or modification of source code corresponding to the latest version.

[0090] It should be noted that the source code of the selected historical version and the latest version is extracted, including but not limited to all code files, configuration files and resource files, etc. The source code of the historical version and the latest version are compared by using a difference comparison tool (such as Git's Diff command) or a third-party source code comparison tool to generate a difference comparison result, showing which files are modified, which files are added or deleted, and which lines in each file are changed.

[0091] For example, if the comparison result shows that some files or code segments exist in the historical version but are deleted or commented out in the latest version, it is determined that the corresponding source code in the latest version is reduced. If the comparison result shows that some files or code segments are added or uncommented in the latest version but do not exist in the historical version, it is determined that the corresponding source code in the latest version is increased. If the comparison result shows that some files or code segments are different between the two versions (neither completely deleted nor completely added), it is determined that the corresponding source code in the latest version is modified. In this way, the code change information is determined based on at least one of the reduction, increase or modification of the source code corresponding to the latest version.

[0092] According to the above code change information, the detailed information of the code change is sorted out, including but not limited to:

[0093] A list of deleted code segments or files and their locations; a list of added code segments or files and their locations; specific changes in the modified code segments, including the changed line numbers, code content before and after modification, etc.

[0094] Through the above methods, code change information can be effectively determined and provide valuable reference for subsequent code review, testing, deployment and maintenance.

[0095] Optionally, in some embodiments, filtering the code change content according to a preset filtering rule to determine the change method name includes:

[0096] Filtering the code change contents one by one according to the preset filtering rules to eliminate the first code change contents that do not meet the preset filtering rules;

[0097] The method name of the first code change content is extracted to determine the change method name, wherein the preset filtering rules include file type, irrelevant change information, and code irrelevant to the business.

[0098] Specifically, the preset filtering rules are designed to reduce noise and make the analysis process more focused on key business logic changes. By eliminating code changes that are not directly related to business logic, the accuracy and efficiency of the analysis can be improved.

[0099] For example, if the preset rules are too complex or difficult to fully cover all situations, you can consider using a machine learning model to automatically identify and filter irrelevant changes. This method requires a training data set, but once the model is trained, it can handle various change situations more intelligently. For another example, since the filtering of code change content is independent, the filtering tasks of multiple change contents can be processed in parallel to increase the processing speed.

[0100] By presetting filtering rules, irrelevant changes can be effectively eliminated, making subsequent analysis more focused and efficient. This helps reduce analysis time and improves the accuracy and reliability of analysis.

[0101] The method name is an important piece of information in the code change content, which is usually closely related to the business logic. By extracting the method name, you can further understand the impact of the change content on the business logic, providing important clues for subsequent analysis and review.

[0102] For example, if the format of the source code file is complex or irregular, you can consider using regular expressions or specialized code parsing libraries to extract method names. These methods can provide more powerful parsing capabilities, but may also require more configuration and debugging. For another example, since the extraction of method names is independent, you can process multiple method name extraction tasks for changed content in parallel to increase processing speed.

[0103] In this embodiment, by extracting the method name, we can further understand the specific impact of the code change content on the business logic. This helps the subsequent analysis and review work, improves the code quality and the accuracy of the business logic. At the same time, the extraction of method names can also provide important information for subsequent code document generation, test design, etc.

[0104] Optionally, in some embodiments, performing code analysis on the method call relationship in the project source code to determine the method call chain graph includes:

[0105] Analyze the method call relationship of the project source code based on static code analysis technology;

[0106] Performing syntax conversion on the project source code to determine an abstract syntax tree;

[0107] Traversing the abstract syntax tree to identify all method call nodes, wherein the method call nodes include the name, parameter types, and return type of the method;

[0108] A method call link graph is generated according to the method call nodes and the method call relationships.

[0109] Specifically, static code analysis technology builds an internal representation of the code (such as an abstract syntax tree, symbol table, etc.) by parsing the syntax and semantic structure of the source code, and then analyzes the elements in the code (such as variables, methods, classes, etc.) and their relationships. For the analysis of method call relationships, the main thing is to identify the call points of all methods and determine the relationship between the caller and the callee. For example, if the static code analysis tool is not suitable for a specific programming language or project structure, you can consider writing a custom parser to analyze the source code. For another example, for large projects, the method call relationship analysis of different files or modules can be processed in parallel to improve the analysis efficiency. Through static code analysis technology, the method call relationship in the project source code can be comprehensively and accurately analyzed, providing an important basis for subsequent code understanding, refactoring, testing and other work.

[0110] Specifically, the syntax transformation of the source code is based on the lexical analysis and grammatical analysis stages in compiler theory. Lexical analysis decomposes the source code into a series of tokens, while grammatical analysis organizes these tokens into a syntax tree according to the grammatical rules of the language. Furthermore, the syntax tree can be abstracted into AST to simplify subsequent analysis and processing. For example, if the existing AST generation tool is not suitable for a specific project or requirement, you can consider using a third-party library or writing a custom parser to generate AST. For another example, for large projects, the AST generation tasks of different files or modules can be processed in parallel to improve efficiency.

[0111] Specifically, the traversal of AST is a traversal algorithm based on the tree structure. During the traversal process, the type and attributes of the node can be used to determine whether it is a method call node. For method call nodes, information such as its name, parameter type, and return type can be further extracted. If the existing AST traversal tools or libraries are not suitable for specific needs, you can consider writing a custom traverser to identify method call nodes. For example, for large ASTs, traversal tasks of different subtrees can be processed in parallel to improve efficiency. For another example, by traversing the AST and identifying method call nodes, detailed information of all method calls in the source code can be extracted.

[0112] Specifically, the method call chain graph is a data structure based on graph theory, in which nodes represent methods and edges represent the calling relationships between methods. By constructing such a graph, the method call path and call hierarchy in the code can be intuitively displayed. For example, if the existing graphical tools or libraries are not suitable for specific needs, you can consider using a third-party library or writing a custom graphical tool to generate a method call chain graph. For large method call chain graphs, the drawing tasks of different parts can be processed in parallel to improve efficiency. By generating a method call chain graph, the method call path and call hierarchy in the code can be intuitively displayed, which helps developers understand the execution flow and business logic of the code.

[0113] Optionally, in some embodiments, the step of identifying the method call link graph by referring to the changed method name to determine the change impact link graph includes:

[0114] According to the changed method name, the method call link graph of the latest version is marked to obtain a changed link;

[0115] The identified change links are integrated into the method call link graph to determine a change impact link graph.

[0116] Specifically, the generation of the change link is based on the method call link graph, which uses the information of nodes (methods) and edges (call relationships) in the graph. By comparing the changed method names with the method nodes in the graph, it is possible to determine which methods have been changed and mark them in the graph accordingly. In this way, the position and impact of the changed method in the entire call link can be intuitively seen.

[0117] For example, by reducing the number of nodes and edges in the graph through clustering and abstraction, and then marking them, the marking of multiple change method names can be done in parallel, because the marking of each change method name is independent and will not interfere with each other. This can improve processing efficiency.

[0118] The generation of the change impact link graph is based on the method call link graph and the change link. It uses the information of nodes and edges in the graph, as well as the association between change links, to build a new link graph that includes the change impact. If it is difficult or time-consuming to directly integrate the change link into the original method call link graph, the integration of multiple change links can be performed in parallel. Because the integration of each change link is independent and will not interfere with each other, this can improve processing efficiency.

[0119] In this embodiment, by obtaining a link diagram that includes all change impacts, this diagram can intuitively show the scope and extent of the impact of the change method on the entire project. This has important guiding significance for project risk assessment, test plan formulation, etc. At the same time, the change impact link diagram can also serve as a reference for subsequent code review, refactoring, etc.

[0120] In certain embodiments of the first aspect of the present application, analyzing the entry of the change impact link graph to determine the scope of the code change impact entry and the corresponding call link includes:

[0121] Extract the top-level entry of the change-affected link graph according to the API interface to determine the entry of the change-affected link;

[0122] Determine, based on the dependency relationship of each of the entry points, the scope of the entry points affected by the code change;

[0123] Draw along the call relationship starting from the entry to determine the call link corresponding to the entry affected by the code change.

[0124] Specifically, the construction of the change impact link graph is based on the method call relationship, where each node represents a method or function, the edge represents the call relationship, and the top-level entry is those nodes that have no upstream dependencies (i.e., methods that are not called by other methods), which are usually the starting points of API interfaces or programs. By identifying these nodes, it is possible to determine where the change impact may first enter the system. If the change impact link graph is very large and complex, it may be time-consuming to directly identify the top-level entry. An alternative is to use automated tools or scripts to identify API interfaces based on code comments, documents, or specific tags, and then directly locate the nodes corresponding to these interfaces in the graph. Since the identification of each API interface is independent, the identification tasks of multiple API interfaces can be processed in parallel to improve efficiency. By determining the entry of the change impact link, it is possible to more accurately understand the impact of the change on the external interface of the system, thereby more effectively assessing the risk and scope of the change.

[0125] Specifically, the scope of the change impact is determined by analyzing the dependencies of the entry nodes. In the change impact chain diagram, each entry node may call one or more downstream methods, which may call other methods to form a call chain. By traversing this call chain, all nodes related to the entry node are determined to determine the scope of the change impact. If the change impact chain diagram is very complex, manual analysis of dependencies may be time-consuming and error-prone. An alternative is to use static code analysis tools or frameworks to automatically analyze dependencies and generate a report on the scope of change impact. For multiple entry nodes, their dependencies can be analyzed in parallel to improve efficiency. By determining the scope of the entry affected by the code change, it is possible to more accurately understand the impact of the change on the internal code of the system, so that risk assessment and test planning can be more effective.

[0126] Specifically, the call chain is drawn based on the call relationship in the change impact chain graph. Starting from the entry node, all nodes and edges in the graph are traversed along the call chain until a stop condition is met (such as reaching the depth limit, encountering a node that is no longer affected by the change, etc.). In this process, all passed nodes and edges are recorded to form a call chain. If the change impact chain graph is very large and complex, manually drawing the call chain may be time-consuming and error-prone.

[0127] For multiple entry nodes, their call links can be drawn in parallel to improve efficiency. By drawing the call links corresponding to the entry points affected by the code changes, you can intuitively see the propagation path and impact range of the changes in the entire system, so as to more effectively conduct code review, test plan formulation and risk assessment.

[0128] Optionally, in some embodiments, the designing of use cases according to the scope of entry points affected by the code change and the corresponding call links to complete the evaluation of test coverage includes:

[0129] Design a test case based on the scope of entry points affected by the code change and the corresponding call link, and determine the code coverage of the execution test case;

[0130] Evaluate test coverage based on the execution of test cases and test results.

[0131] Through the above methods, automated analysis tools and automated testing frameworks are used to improve test efficiency and accuracy; test resources are allocated reasonably based on code coverage reports and test coverage evaluation results; and through comprehensive test case design and execution, software functions are ensured to be correct, performance is stable, and safe and reliable. Through automated analysis, test case design, code coverage determination, and test coverage evaluation, effective control of the scope of code change impact and comprehensive evaluation of test coverage are achieved.

[0132] See also Figure 4 , a method call relationship diagram in a source code change analysis method in an embodiment of the present application, Figure 5 It is a change impact link diagram in a source code change analysis method in an embodiment of the present application;

[0133] Figure 4 As shown in the figure, assume that an existing method call relationship analysis of an industrial software system, where solid circles represent entry methods and dotted circles represent non-entry methods:

[0134] There are 4 method entries, and the calling relationship is as follows Figure 4 As shown on the left, the method call chain diagram obtained by source code static analysis technology is as follows Figure 4 As shown on the right. Assume that during a custom development process or defect repair process, the code changes are filtered by the code change filtering rule base and it is found that the code changes in method 4, method 6, and method 7 will affect the business. Then, the methods affected by the code changes are colored in the call link as shown in the following figure:

[0135] Finally, the coloring changes affect the link graph as follows Figure 5 The entry method shown is extracted to obtain the entire scope affected by this code change, namely method 1, method 2, method 5 and method 7 and their corresponding call links.

[0136] During the test verification process, the tester only needs to fully verify these four entry methods to ensure that the entire impact range is covered, thereby effectively ensuring the comprehensiveness and accuracy of the test. In addition, during the analysis process, you can also refer to the call link and related information of the code change, such as the code change time, code submitter, etc. This will help testers quickly understand the content of the change, accurately assess the impact of this code change, and ensure the quality of industrial software products.

[0137] See also Figure 6 , is a schematic diagram of the structure of a source code change analysis system in an embodiment of the present application, including:

[0138] An acquisition module 601 is used to acquire a project source code and identifiers corresponding to at least two versions of the project source code;

[0139] Comparison module 602, comparing the differences of the project source code between at least two versions based on the identifier, and determining the code change content;

[0140] The filtering module 603 is used to filter the code change content according to a preset filtering rule to determine the change method name;

[0141] A method analysis module 604 is used to perform code analysis on the method call relationship in the project source code to determine a method call chain diagram;

[0142] A marking module 605 is used to mark the method call link graph by referring to the changed method name, and determine the change impact link graph;

[0143] A change analysis module 606 is used to analyze the entry of the change impact link diagram to determine the scope of the code change impact entry and the corresponding call link;

[0144] The change assessment module 607 is used to design use cases according to the scope of the entry point affected by the code change and the corresponding call link to complete the test coverage assessment.

[0145] It should be noted that the source code change analysis system of the present application corresponds one-to-one to the source code change analysis method, and the corresponding technical details and technical solutions refer to the above-mentioned source code change analysis method, which will not be repeated here.

[0146] For example, see Figure 7 , is a schematic diagram of the architecture of a source code change analysis system in an embodiment of the present application, which is described in detail as follows:

[0147] 1) Management side: supports configuration of industrial software project source code information (including but not limited to address, access token, two Commit IDs to be analyzed, etc.), code change filtering rule base, and visualizes the impact entry and corresponding link information of the analyzed code changes.

[0148] 2) Source code operation / management: Supports operations on code repositories. Pull source code from project source code related information configured on the management side and store it in storage media (usually stored on disk / storage volume, which can be deleted immediately after analysis to avoid occupying large storage space). In addition, you can obtain code change descriptions, submission time, etc. through code identifiers (such as code Commit ID) for benchmark verification to ensure that the compared code has passed complete testing and verification;

[0149] 3) Analysis service: First, according to the source code and the two code identifiers to be analyzed (such as code Commit ID, etc.), all the contents of the code change are analyzed based on the code Diff technology, and then the affected method names are filtered according to the code change filtering rule library configured on the management side; based on the static code analysis technology, the method call chain diagram is obtained, and the methods affected by the code change in the method call chain diagram are colored to obtain the change impact chain diagram; finally, the top-level call entry (usually the Controller layer interface, scheduled task or Open API, etc.) of the above code change impact chain diagram is extracted to obtain the code change impact entry range and the corresponding call chain.

[0150] Through the above method, by obtaining the project source code and its corresponding identifier, comparing the differences of the project source code between at least two versions based on the identifier, determining the content of the code change, locating the code differences between different versions, and accurately determining which code has been modified, added or deleted, thereby identifying the specific content of the code change; using preset filtering rules to exclude changes that have little impact on functions or performance, so that analysts can focus more on those code changes that really affect software behavior, such as changes in method names, parameter lists, logical structures, etc.; by analyzing the method call relationships in the project source code, a method call chain diagram is constructed, which not only helps to understand the internal workflow of the software, but also helps to understand the changes in the method name when the changed method name is identified. When on the method call link diagram, determine the link diagram affected by the change, analyze the entries based on the change impact link diagram, and determine which functions or modules are affected by the change, so that testers can test the affected entries and call links, thereby ensuring the comprehensiveness and effectiveness of test coverage, greatly shortening the time to identify changes, analyze the scope of impact, and design test cases; this not only improves the efficiency of testing work, but also reduces the possibility of human errors, making test results more accurate and reliable, and realizing automated code change identification, impact analysis, and test coverage evaluation, ensuring that the software maintains high quality and stability in each iteration, thereby accelerating product time to market and reducing maintenance costs.

[0151] In other embodiments, the present disclosure also provides an electronic device, including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the above method.

[0152] Figure 8 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 8 The computer system 800 of the electronic device shown is only an example and should not bring any limitation to the functions and application scope of the embodiments of the present application.

[0153] like Figure 8As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage part 808 to the random access memory (RAM) 803, such as executing the method in the above embodiment. In the random access memory 803, various programs and data required for system operation are also stored. The central processing unit 801, the read-only memory 802 and the random access memory 803 are connected to each other through a bus 804. The input / output (I / O) interface 805 is also connected to the bus 804.

[0154] The following components are connected to the input / output interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read therefrom is installed into the storage section 808 as needed.

[0155] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 809, and / or installed from a removable medium 811. When the computer program is executed by the central processing unit 801, various functions defined in the method of the present application are executed.

[0156] The above description and accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent possible changes only. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. Parts and subsamples of some embodiments may be included in or replace parts and subsamples of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" used in this application refers to any and all possible combinations listed in association with one or more. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of a stated sub-sample, whole, step, operation, element, and / or component, but do not exclude the presence or addition of one or more other sub-samples, wholes, steps, operations, elements, components and / or groups of these. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.

[0157] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. Technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. Technicians can clearly understand that for the convenience and simplicity of description, the specific working process of the methods, devices and units described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0158] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some sub-samples can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.

[0159] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the method, system and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a part of the module, program segment or code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based method for performing the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.

Claims

1. A source code change analysis method, characterized in that: include: Obtain project source code and identifiers corresponding to at least two versions of the project source code; Compare the differences of the project source code between at least two versions based on the identifier to determine the code change content; Filter the code change content according to preset filtering rules to determine the change method name; Perform code analysis on the method call relationship in the project source code to determine the method call chain diagram; Identify the method call link graph by referring to the changed method name, and determine the change impact link graph; Analyze the entry of the change impact link diagram to determine the scope of the code change impact entry and the corresponding call link; Use case design is performed based on the scope of entry points affected by the code change and the corresponding call links to complete the test coverage evaluation.

2. The method according to claim 1, characterized in that The comparing the differences of the project source code between at least two versions based on the identifier to determine the code change content includes: Determine a code change description and submission time of each of the project source codes based on the identifier; Perform integrity check based on the code change description and submission time of the project source code; After the verification is passed, the difference of the project source code between at least two versions is analyzed by code Diff technology to determine the code change content.

3. The method according to claim 2, characterized in that Analyze the differences between the source code of the project between at least two versions through code Diff technology to determine the code changes, including: Taking at least one version as a historical version, and performing a difference comparison between source code corresponding to the historical version and source code corresponding to the latest version; If the comparison result includes that the source code corresponding to the historical version is more than the source code corresponding to the latest version, then determining that the source code corresponding to the latest version is reduced; If the comparison result includes that the source code corresponding to the historical version is less than the source code corresponding to the latest version, determining that the source code corresponding to the latest version is increased; If the comparison result includes that the source code corresponding to the historical version is changed relative to the source code corresponding to the latest version, determining that the source code corresponding to the latest version is modified; Code change information is determined according to at least one of reduction, addition or modification of source code corresponding to the latest version.

4. The method according to claim 1, characterized in that: The filtering of the code change content according to the preset filtering rules to determine the change method name includes: Filtering the code change contents one by one according to the preset filtering rules to eliminate the first code change contents that do not meet the preset filtering rules; The method name of the first code change content is extracted to determine the change method name, wherein the preset filtering rules include file type, irrelevant change information, and code irrelevant to the business.

5. The method according to any one of claims 1 to 4, characterized in that: The code analysis of the method call relationship in the project source code to determine the method call chain diagram includes: Analyze the method call relationship of the project source code based on static code analysis technology; Performing syntax conversion on the project source code to determine an abstract syntax tree; Traversing the abstract syntax tree to identify all method call nodes, wherein the method call nodes include the name, parameter types, and return type of the method; A method call link graph is generated according to the method call nodes and the method call relationships.

6. The method according to any one of claims 1 to 4, characterized in that: The step of identifying the method call link graph by referring to the changed method name and determining the change impact link graph includes: According to the changed method name, the method call link graph of the latest version is marked to obtain a changed link; The identified change links are integrated into the method call link graph to determine a change impact link graph.

7. The method according to any one of claims 1 to 4, characterized in that: The analyzing the entry of the change impact link diagram to determine the scope of the code change impact entry and the corresponding call link includes: Extract the top-level entry of the change-affected link graph according to the API interface to determine the entry of the change-affected link; Determine, based on the dependency relationship of each of the entry points, the scope of the entry points affected by the code change; Draw along the call relationship starting from the entry to determine the call link corresponding to the entry affected by the code change.

8. The method according to any one of claims 1 to 4, characterized in that: The use case design is performed according to the scope of the entry point affected by the code change and the corresponding call link to complete the test coverage evaluation, including: Design a test case based on the scope of entry points affected by the code change and the corresponding call link, and determine the code coverage of the execution test case; Evaluate test coverage based on the execution of test cases and test results.

9. A source code change analysis system, characterized in that: include: An acquisition module, used to acquire project source code and identifiers corresponding to at least two versions of the project source code; A comparison module, which compares the differences of the project source code between at least two versions based on the identifier to determine the code change content; A filtering module, used to filter the code change content according to preset filtering rules and determine the change method name; A method analysis module is used to perform code analysis on the method call relationship in the project source code to determine a method call chain diagram; A marking module, used to mark the method call link diagram by referring to the changed method name, and determine the change impact link diagram; A change analysis module, used to analyze the entry of the change impact link diagram to determine the scope of the code change impact entry and the corresponding call link; The change assessment module is used to design use cases according to the scope of entry points affected by the code change and the corresponding call links, and complete the assessment of test coverage.

10. An electronic device, characterized in that: include: Processor and memory; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the method according to claims 1 to 8.

Citation Information

Cited By

  • Method and system for evaluating test coverage rate based on Java call link

    CN121144214A

  • A method and system for evaluating test coverage based on java call links

    CN121144214B

  • Structured processing method and device for software engineering elements, electronic equipment and medium

    CN121455449A

  • Structured processing method and device of software engineering elements, electronic equipment and medium

    CN121455449B

  • Software bill of materials and vulnerability management via deep packet inspection

    US12470588B2