File change identification method and device, equipment and storage medium

By identifying the scope of changes in the database configuration file in the software source code, the problem of traditional methods ignoring SQL configuration file changes is solved, which improves test coverage and software stability, and reduces risks and maintenance costs.

CN119311703APending Publication Date: 2025-01-14CHINA MERCHANTS BANK
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411317051.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

Traditional change management methods ignore changes in SQL configuration files during software maintenance, resulting in incomplete test coverage, increasing the risk of problems after software deployment, and affecting the stability and reliability of the software system.

Method used

By obtaining the association relationship of each element in the database configuration file and the reference relationship of each element in the software source code, generating the call relationship between the database configuration file and the software source code, identifying the corresponding file change impact range of the database configuration file in the software source code, and generating File changes impact reports and push them to testers.

Benefits of technology

It improves the comprehensiveness of test coverage, reduces the risk of missing tests for key functions, improves the stability and reliability of the software system, reduces the probability of manual errors, and saves maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311703A_ABST
    Figure CN119311703A_ABST
Patent Text Reader

Abstract

The invention discloses a file change identification method, device and equipment and a storage medium, and relates to the technical field of data processing, and the file change identification method comprises the following steps: obtaining an association relationship of all first elements in a database configuration file and a reference relationship of all second elements in a software source code, obtaining change information corresponding to the database configuration file; generating a calling relationship between the database configuration file and the software source code based on the association relationship of the first elements and the reference relationship of the second elements; and based on the calling relationship and the change information, identifying a file change influence range corresponding to the database configuration file in the software source code. According to the method and the device, the file change influence range can be automatically identified, so that the comprehensiveness of test coverage is improved, the risk of missing test of key functions is reduced, the stability and reliability of a software system are effectively improved, the manual error probability is reduced, and the maintenance cost is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a file change identification method, device, equipment and storage medium. Background Art

[0002] Change management is a key link in the software maintenance process. Traditional change management mainly relies on static code analysis technology, which can help developers understand the meaning and call relationship of code changes, thereby assisting testers to analyze the impact of changes and conduct targeted testing and verification. However, existing technologies mainly focus on change analysis at the code level, and rarely involve change analysis of configuration files, especially SQL (Structured Query Language) configuration files.

[0003] Traditional methods can only analyze the impact of changes in the code part of the software, ignoring changes in SQL configuration files (such as MyBatis configuration), resulting in incomplete test coverage and increasing the risk of problems after software deployment. At the same time, due to the lack of analysis of the impact of changes in SQL configuration files, key functions may be missed in testing, thus affecting the stability and reliability of the software system. In addition, without effective tool support, maintenance personnel need to manually analyze changes in SQL configuration files, which is not only time-consuming but also prone to errors, increasing maintenance costs. Summary of the invention

[0004] The main purpose of this application is to provide a file change identification method, device, equipment and storage medium, aiming to solve the technical problems that traditional methods can only analyze the impact of changes in the code part of the software, but ignore the changes in SQL configuration files, such as incomplete test coverage.

[0005] To achieve the above objectives, the present application proposes a file change identification method, the method comprising:

[0006] Obtaining the association relationship between each first element in the database configuration file and the reference relationship between each second element in the software source code, and obtaining the change information corresponding to the database configuration file;

[0007] Based on the association relationship of each of the first elements and the reference relationship of each of the second elements, generating a calling relationship between the database configuration file and the software source code;

[0008] Based on the calling relationship and the change information, the impact scope of the file change corresponding to the database configuration file in the software source code is identified.

[0009] In one embodiment, the obtaining of the association relationship between the first elements in the database configuration file and the reference relationship between the second elements in the software source code includes:

[0010] Reading keyword information and index information corresponding to each of the first elements in a database configuration file and element call relationships corresponding to each of the second elements in a software source code;

[0011] Determine, based on the keyword information and the index information, an association relationship between the first elements in the database configuration file;

[0012] Based on the element calling relationship, the reference relationship of each second element in the software source code is determined.

[0013] In one embodiment, the generating of the calling relationship between the database configuration file and the software source code based on the association relationship between the first elements and the reference relationship between the second elements includes:

[0014] Determine the element index identifier corresponding to each of the first elements;

[0015] Based on the element index identifier, establish an element mapping relationship between each of the first elements and each of the second elements;

[0016] Based on the element mapping relationship, the association relationship and the reference relationship, a calling relationship between the database configuration file and the software source code is generated.

[0017] In one embodiment, generating a calling relationship between the database configuration file and the software source code based on the element mapping relationship, the association relationship, and the reference relationship includes:

[0018] Based on the element mapping relationship, the association relationship of each of the first elements and the reference relationship of each of the second elements are integrated to generate an element relationship graph;

[0019] Vectorizing the element relationship graph;

[0020] The vectorized element relationship map is used as the calling relationship between the database configuration file and the software source code.

[0021] In one embodiment, the change information includes a target change element; and identifying the file change impact scope corresponding to the database configuration file in the software source code based on the call relationship and the change information includes:

[0022] Matching the change information with the call relationship to determine a target impact entity corresponding to the target change element;

[0023] Recursively analyze the target impact entity to identify the file change impact scope corresponding to the target change element.

[0024] In one embodiment, after identifying the impact scope of the file change corresponding to the database configuration file in the software source code based on the call relationship and the change information, the method further includes:

[0025] Based on the impact scope of the file change, determine the target change element and the target change line;

[0026] Generate a file change impact report based on the target change element and the target change line;

[0027] The file change impact report is pushed to the tester for the tester to perform software testing evaluation.

[0028] In one embodiment, after determining the target change element and the target change line based on the file change impact scope, the method further includes:

[0029] Matching the target change element and the target change line with the software source code to determine the source code change impact area;

[0030] Obtain the change type corresponding to the target change element;

[0031] Based on the change type, the source code change affected area is marked.

[0032] In addition, to achieve the above-mentioned purpose, the present application also proposes a file change identification device, the file change identification device comprising:

[0033] An acquisition module, used to acquire the association relationship between each first element in the database configuration file and the reference relationship between each second element in the software source code;

[0034] A generating module, configured to generate a calling relationship between the database configuration file and the software source code based on the association relationship between the first elements and the reference relationship between the second elements;

[0035] An identification module is used to identify the impact scope of the file change corresponding to the database configuration file in the software source code based on the calling relationship and the change information.

[0036] In addition, to achieve the above-mentioned purpose, the present application also proposes a file change identification device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the file change identification method described above.

[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the file change identification method described above are implemented.

[0038] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the file change identification method described above are implemented.

[0039] The present application provides a file change identification method, apparatus, device and storage medium. The file change identification method obtains the association relationship between each first element in a database configuration file and the reference relationship between each second element in a software source code, and obtains change information corresponding to the database configuration file, and then generates a calling relationship between the database configuration file and the software source code based on the association relationship between each first element and the reference relationship between each second element, thereby identifying the impact scope of the file change corresponding to the database configuration file in the software source code based on the calling relationship and the change information, thereby improving the comprehensiveness of test coverage, while reducing the risk of missing key functions, thereby effectively improving the stability and reliability of the software system, reducing the probability of manual errors, and saving maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0042] Figure 1 A flowchart of the first embodiment of the method for identifying changes in application documents is provided;

[0043] Figure 2 A flowchart of the second embodiment of the method for identifying changes in application documents is provided;

[0044] Figure 3 A flowchart of the third embodiment of the method for identifying changes in application documents is provided;

[0045] Figure 4 A brief example diagram of obtaining software source code reference relationships in an embodiment of the method for identifying file changes in this application;

[0046] Figure 5 This is a schematic diagram of the module structure of the file change identification device in the embodiment of the present application;

[0047] Figure 6 Schematic diagram of the device structure of the hardware operating environment involved in the file change identification method in the embodiment of the present application.

[0048] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0049] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0050] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0051] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a big data service platform, a file change identification system, etc. The following takes the file change identification system as an example to illustrate this embodiment and the following embodiments.

[0052] Based on this, the present application embodiment provides a file change identification method, referring to Figure 1 , Figure 1 A flowchart of the first embodiment of the method for identifying document changes in this application is provided.

[0053] In this embodiment, the file change identification method includes steps S11 to S13:

[0054] Step S11, obtaining the association relationship between the first elements in the database configuration file and the reference relationship between the second elements in the software source code, and obtaining the change information corresponding to the database configuration file;

[0055] It should be noted that the database configuration file (SQL configuration file) refers to a file used to define the database structure, behavior and connection information, which usually includes database connection strings, SQL statements, data table definitions, stored procedures, triggers and other configuration files in different forms, such as XML, JSON, YAML files, or framework-specific configuration files (such as MyBatis mapper files, Hibernate hbm files), etc., which are not limited here. The first element refers to each independent component or entity defined in the database configuration file, such as a data table, view, stored procedure, index, field, etc. In addition, the association relationship refers to the relationship between the first elements in the database configuration file, for example, an SQL query references a specific data table and field, or a stored procedure depends on a specific data table structure and other association relationships, including foreign key relationships between data tables, tables referenced by views, other stored procedures or functions called inside stored procedures, etc., which are not limited here and can be set according to actual conditions.

[0056] It should be further explained that the software source code refers to a source file written in a programming language. The second element refers to the programming constructs such as classes, methods, functions, variables, etc. defined in the software source code, including class definitions, method definitions, variable declarations, interface definitions, enumeration types, etc. In addition, the reference relationship refers to the mutual reference between the second elements in the software source code, including class basic information, class reference relationship, class annotation, class inheritance relationship, method basic information, method generic information, method annotation, method line information, conventional method call relationship, asynchronous method call relationship, concurrent call relationship, etc., which are not limited here and can be set according to actual conditions.

[0057] Furthermore, the change information refers to detailed information about changes that have occurred or are about to occur in the database configuration file or software source code, including the change description (detailed description of the change, including the purpose of the change and the expected effect), change type (such as addition, modification, deletion or reconstruction, etc.), change time, etc., without limitation here.

[0058] Specifically, the keyword information and index information corresponding to each first element in the database configuration file and the element call relationship corresponding to each second element in the software source code are read, and then based on the keyword information and the index information, the association relationship of each first element in the database configuration file is determined, and then based on the element call relationship, the reference relationship of each second element in the software source code is determined. Further, the change information corresponding to the database configuration file can be obtained according to the technical documents provided by the developer, etc., which is not limited here.

[0059] Step S12, generating a calling relationship between the database configuration file and the software source code based on the association relationship between the first elements and the reference relationship between the second elements;

[0060] It should be noted that the calling relationship refers to the relationship between different elements or components (such as functions, methods, classes, modules) in the software system, including direct calls, indirect calls, recursive calls, concurrent calls (concurrent or synchronous calling relationships between components in a multi-threaded or asynchronous environment) and external calls, etc., which are not limited here.

[0061] Specifically, the element index identifier corresponding to each of the first elements is determined, and then based on the element index identifier, an element mapping relationship between each of the first elements and each of the second elements is established, so as to generate a calling relationship between the database configuration file and the software source code based on the element mapping relationship, the association relationship and the reference relationship.

[0062] Step S13, based on the calling relationship and the change information, identifying the file change impact scope corresponding to the database configuration file in the software source code.

[0063] It should be noted that the scope of impact of the file change refers to the collection of all other files, modules, components or system functions that may be affected by the change when a certain part of the database configuration file changes, including directly affected parts, indirectly affected parts (although not directly referencing the changed content, but due to the dependency relationship between software components, parts that may be indirectly affected, such as calling methods or functions of the directly affected parts), etc.

[0064] Specifically, the change information is matched with the call relationship to determine the target impact entity corresponding to the target change element, thereby recursively analyzing the target impact entity to identify the file change impact scope corresponding to the target change element.

[0065] This embodiment obtains the association relationship between each first element in the database configuration file and the reference relationship between each second element in the software source code, and obtains the change information corresponding to the database configuration file, and then generates a calling relationship between the database configuration file and the software source code based on the association relationship between each first element and the reference relationship between each second element, so as to identify the impact scope of the file change corresponding to the database configuration file in the software source code based on the calling relationship and the change information, thereby improving the comprehensiveness of the test coverage and reducing the risk of missing key functions, thereby effectively improving the stability and reliability of the software system, reducing the probability of human errors, and saving maintenance costs.

[0066] In a feasible implementation manner, the obtaining of the association relationship between the first elements in the database configuration file and the reference relationship between the second elements in the software source code includes:

[0067] Step S21, reading keyword information and index information corresponding to each of the first elements in the database configuration file and element call relationships corresponding to each of the second elements in the software source code;

[0068] It should be noted that the keyword information refers to the special keywords that define or use the first element and its attributes in the database configuration file. For example, in some database configuration files, the keywords include "select", "insert", "update", "delete", "resultMap" and "parameterType", etc., which are not limited here. In addition, the index information refers to the detailed description of the index in the database table used to improve the query efficiency, including the name of the index, the fields included in the index, the type of index (such as B-tree, hash), the sorting order of the index (ascending or descending), etc.

[0069] It should be further explained that the element calling relationship refers to the calling or dependency relationship between different components (such as functions, methods, classes) in the software source code. For example, one function calls another function, one class inherits from another class, or one module depends on the services provided by other modules, etc., which are not limited here.

[0070] Specifically, according to the format of the database configuration file (such as XML, JSON, YAML), select the corresponding parsing library. For example, for XML, you can use the XPath tool to query and extract the keyword information and index information corresponding to each of the first elements, such as table name, field name, data type, etc.

[0071] Furthermore, appropriate static analysis tools are selected according to the programming language corresponding to the software source code, such as SpotBugs for Java, PyLint for Python, Roslyn for C#, etc., and then the element call relationship is extracted through the static analysis tool. In addition, the abstract syntax tree (AST) can be used to represent the structure of the software source code, and then the element call relationship is extracted by traversing the AST.

[0072] Step S22, determining the association relationship between the first elements in the database configuration file based on the keyword information and the index information;

[0073] Specifically, for any of the first elements, an association relationship between the first elements in the database configuration file is established based on the keyword information corresponding to the first element and the index information, such as the keyword type and the index value, reference value, etc. in the index information, wherein the association relationship can be stored and visualized through a graph database or a graph structure, thereby facilitating staff to view and correct it.

[0074] Step S23: determining the reference relationship of each second element in the software source code based on the element calling relationship.

[0075] Specifically, for any second element, a reference relationship between the second elements in the software source code is established through a bytecode tool based on the element calling relationship corresponding to the second element, such as dependency relationship and inheritance relationship, wherein the reference relationship can be stored and visualized through a graph database or graph structure, thereby facilitating viewing and correction by staff.

[0076] This embodiment reads the keyword information and index information corresponding to each first element in the database configuration file and the element calling relationship corresponding to each second element in the software source code, and then determines the association relationship of each first element in the database configuration file based on the keyword information and the index information, and then determines the reference relationship of each second element in the software source code based on the element calling relationship, and then accurately identifies the association relationship of each first element in the database configuration file and the reference relationship of each second element in the software source code, avoids missing identification of the association relationship and the reference relationship, improves the comprehensiveness of identification, provides a good data basis for subsequent analysis, and reduces risks.

[0077] In a feasible implementation manner, the generating of the calling relationship between the database configuration file and the software source code based on the association relationship between the first elements and the reference relationship between the second elements includes:

[0078] Step S31, determining the element index identifier corresponding to each of the first elements;

[0079] It should be noted that the element index identifier refers to an identifier or keyword used to uniquely identify each element in the database configuration file (such as a table, field, index, view, stored procedure, etc.), so that each element can be accurately located and referenced, including an index name, label or ID (a label or ID number used to identify a specific element in the configuration file), etc., and is not limited here.

[0080] Specifically, the element index identifier corresponding to each of the first elements is determined according to the storage information in the database configuration file, and can be set according to actual conditions.

[0081] Step S32: establishing an element mapping relationship between each of the first elements and each of the second elements based on the element index identifier;

[0082] It should be noted that the element mapping relationship refers to the corresponding relationship established between the elements in the database configuration file and the elements in the software source code, so as to help developers understand which parts of the software interact with which parts of the database and how they interact. The element mapping relationship includes database table and entity class mapping (in object-relational mapping (ORM), the table in the database is usually mapped to the entity class in the software source code), field and attribute mapping (the field in the database table is mapped to the attribute of the entity class), SQL statement and code logic mapping (SQL statements in the database configuration file are mapped to the functions or methods that call these statements in the software source code), and database connection parameters and configuration settings mapping, etc., which are not limited here.

[0083] Specifically, the element index identifier is matched with the index information in the software source code, and an element mapping relationship between each of the first elements and each of the second elements is established.

[0084] Step S33: generating a calling relationship between the database configuration file and the software source code based on the element mapping relationship, the association relationship and the reference relationship.

[0085] Specifically, based on the element mapping relationship, the association relationship of each first element and the reference relationship of each second element are integrated to generate an element relationship map, and then the element relationship map is vectorized, so that the vectorized element relationship map is used as the calling relationship between the database configuration file and the software source code.

[0086] This embodiment determines the element index identifier corresponding to each of the first elements, and then establishes an element mapping relationship between each of the first elements and each of the second elements based on the element index identifier, thereby generating a calling relationship between the database configuration file and the software source code based on the element mapping relationship, the association relationship and the reference relationship, and then establishing an element association between the database configuration file and the software source code, clarifying the impact scope of each element in the database configuration file, thereby improving the accuracy and precision of identifying the impact scope of file changes. In addition, clarifying the calling relationship can also enhance the readability and comprehensibility of the code and improve maintenance efficiency.

[0087] Based on this, the present application embodiment provides a file change identification method, referring to Figure 2 , Figure 2 A flowchart diagram of the second embodiment of the method for identifying document changes in this application is provided.

[0088] In a feasible implementation manner, the generating the calling relationship between the database configuration file and the software source code based on the element mapping relationship, the association relationship and the reference relationship includes:

[0089] Step S41, based on the element mapping relationship, integrating the association relationship of each of the first elements and the reference relationship of each of the second elements to generate an element relationship graph;

[0090] It should be noted that the element relationship graph refers to taking each element in the system (such as tables, fields, indexes in database configuration files, and classes, methods, functions, etc. in software source code) as nodes, and representing various relationships between these elements (such as call relationships, dependency relationships, association relationships, etc.) as edges, so as to intuitively display the complex relationship network between elements.

[0091] Specifically, according to the element mapping relationship, the association relationship of each first element and the reference relationship of each second element are integrated, wherein the analysis and integration can be performed through software tools to generate an element relationship map, which is not limited here.

[0092] Step S42, vectorizing the element relationship graph;

[0093] It should be noted that since a complete software source code may have hundreds or thousands of second elements, in order to improve computing efficiency, simplify data processing and improve storage efficiency, the element relationship graph containing a large amount of element information and its collaborative information is vectorized to facilitate storage and achieve data processing dimensionality reduction. In addition, the vectorized element relationship graph is also convenient for machine learning processing, and the element relationship graph can be subsequently input into a large model for data analysis, thereby providing training data for experts.

[0094] Specifically, the element relationship graph is vectorized using a vectorization model, such as a bag-of-words model, etc. There is no restriction on the vectorization method, which can be set according to actual conditions.

[0095] Step S43, using the vectorized element relationship graph as the calling relationship between the database configuration file and the software source code.

[0096] This embodiment integrates the association relationship of each first element and the reference relationship of each second element based on the element mapping relationship, generates an element relationship graph, and then vectorizes the element relationship graph, so that the vectorized element relationship graph is used as the calling relationship between the database configuration file and the software source code, thereby providing a clear view of the dependency relationship between the database configuration file and the software source code, which helps to understand the system architecture and makes the change impact analysis more accurate. It can quickly identify the scope of the change that may be affected, and at the same time, the graph can be used to quickly locate the potential impact of database changes on the software, thereby improving the efficiency of maintenance and development.

[0097] Based on this, the present application embodiment provides a file change identification method, referring to Figure 3 , Figure 3 A flowchart diagram of the third embodiment of the method for identifying document changes in this application.

[0098] In a feasible implementation manner, the change information includes a target change element; and identifying the file change impact scope corresponding to the database configuration file in the software source code based on the call relationship and the change information includes:

[0099] Step S51, matching the change information with the call relationship to determine the target impact entity corresponding to the target change element;

[0100] It should be noted that the target change element refers to the specific element that is clearly indicated as the change object in the change information, such as the table, field, index in the database, or the class, method, variable in the code, etc. The target impact entity refers to other system elements that are directly or indirectly affected by the change of the target change element, including other tables and fields in the database, or other classes and methods in the software source code, etc.

[0101] Specifically, the change information is matched with the calling relationship to determine the target impact entity corresponding to the target change element. Since the calling relationship can be displayed using an element relationship graph, the target change element can be set as the center, and the entities involved in the preset edge values ​​in the element relationship graph can be set as target impact entities. For example, the target change element is set as the center, and the entities connected and involved with the target change element in two edges in the element relationship graph are target impact entities.

[0102] Step S52: recursively analyze the target impact entity to identify the file change impact scope corresponding to the target change element.

[0103] Specifically, a recursive analysis is performed on the target impact entity to identify the file change impact scope corresponding to the target change element, wherein different entity types of the target impact entity can be divided into static analysis and dynamic analysis. Static analysis can use static code analysis tools to identify the parts of the source code that directly reference or depend on the target change element, thereby identifying the file change impact scope. Dynamic analysis is set for the file change impact scope corresponding to the target change element that can only be determined when the system is running. For example, starting from the target change element, recursively check the direct and indirect dependencies corresponding to all target impact entities, and then use a graph traversal algorithm (such as depth-first search DFS or breadth-first search BFS) to identify the file change impact scope corresponding to the target change element.

[0104] This embodiment matches the change information with the call relationship to determine the target impact entity corresponding to the target change element, thereby recursively analyzing the target impact entity and identifying the file change impact scope corresponding to the target change element, thereby improving the comprehensiveness of test coverage and reducing the risk of missing key functions, thereby effectively improving the stability and reliability of the software system, reducing the probability of human errors, and saving maintenance costs.

[0105] In a feasible implementation manner, after identifying the impact scope of the file change corresponding to the database configuration file in the software source code based on the call relationship and the change information, the method further includes:

[0106] Step S61, determining a target change element and a target change row based on the file change impact scope;

[0107] It should be noted that the target changed line refers to the line in the software source code or configuration file where the change occurs.

[0108] Specifically, according to the file change impact range, the target change element and the target change row can be determined directly by querying the change element information in the file change impact range, which is not limited here.

[0109] Step S62, generating a file change impact report based on the target change element and the target change row;

[0110] It should be noted that the file change impact report refers to a document that records file changes and their potential impacts, which is used to help testers and developers understand the scope and possible impact of the changes, including a change overview (a brief description of the change, including the purpose of the change and the main change points), change details (a detailed list of specific changes, including the number and content of the target change line), impact analysis (the scope of change impact based on code analysis, which may include affected functions, modules, interfaces, etc.), dependencies (other system components affected or dependent on the change), test suggestions (test suggestions for the scope of change impact to help testers determine test focus), risk assessment (assess the risks that may be introduced by the change and propose corresponding mitigation measures), rollback plan (if the change causes problems, provide steps to roll back to the previous version or status) and other information (such as version information), etc., which are not limited here, so as to reduce defects introduced by changes and improve software quality and stability.

[0111] Specifically, a risk analysis is performed on each of the target change elements and the change area corresponding to the target change line where each of the target change elements is located, wherein code analysis and change tracking can be performed through a preset analysis tool, and then the analysis results are integrated to generate a file change impact report.

[0112] Step S63: Push the file change impact report to the tester for the tester to perform software test evaluation.

[0113] Specifically, the file change impact report is pushed to the tester for the tester to conduct software testing evaluation. The push can be performed through APP push, mini-program notification, email, and website link, etc., without limitation. The tester can determine whether to make changes to the database configuration file based on the file change impact report, thereby providing the tester with a data decision-making basis.

[0114] This embodiment determines the target change element and the target change line based on the file change impact scope, and then generates a file change impact report based on the target change element and the target change line, so as to push the file change impact report to the tester for the tester to conduct software testing evaluation, thereby improving the targetedness of the test, improving the test efficiency, reducing the time and human resources required for testing, and because the test scope is more precise, the overall development and release speed is improved, thereby ensuring that all potentially affected areas are properly tested, reducing the risk of missed tests, and further reducing software defects and testing workload, ultimately effectively improving software quality and bringing a good experience to users.

[0115] In a feasible implementation manner, after determining the target change element and the target change line based on the file change impact scope, the method further includes:

[0116] Step S71, matching the target change element and the target change line with the software source code to determine the source code change impact area;

[0117] It should be noted that the source code change affected area refers to the part of the software source code that is affected by a certain change (such as addition, modification or deletion operation), including directly modified code lines and other code parts that need to be adjusted or reconsidered due to these modifications.

[0118] Specifically, the target change element and the target change line are matched with the software source code to determine the source code change impact area. In order to prevent overlapping of the source code change impact area, when there are more than two change impact sources in a source code change impact area, the source of each change impact source is marked and integrated, and associated with the source code change impact area. For example, when the mouse moves to the source code change impact area, each change impact source is displayed around the code, including the target change element and target change line information corresponding to each change impact source, so as to facilitate developers to quickly find related elements.

[0119] Step S72, obtaining the change type corresponding to the target change element;

[0120] It should be noted that the change type refers to a specific type of change made to the source code, including addition, modification, deletion, reconstruction (Refactor) and optimization (Optimization), etc., which is not limited here.

[0121] Specifically, the identification and acquisition may be performed based on annotations or code keywords written by developers, and no limitation is made here.

[0122] Step S73: Mark the source code change affected area based on the change type.

[0123] Specifically, the change type, the target change element and the target change line are associated and combined, and the source code change affected area is marked, wherein the source code change affected area can be highlighted, etc., which is not limited here and can be set according to actual conditions.

[0124] This embodiment matches the target change element and the target change line with the software source code to determine the source code change impact area, and then obtains the change type corresponding to the target change element, and then marks the source code change impact area based on the change type, and then improves the readability of the code by accurately identifying and marking the impact area, thereby facilitating communication and collaboration between team members, helping new team members understand code changes more quickly, and improving user experience.

[0125] For example, to help understand the implementation process of the file change identification method, please refer to Figure 4 , Figure 4 A brief example diagram of obtaining software source code reference relationships in one embodiment of the file change identification method provided in this application.

[0126] Specifically, the figure shows a process or architecture diagram for Java class and interface analysis, which mainly describes how to use bytecode tools (such as ClassParser), JarInputStream and other tools to parse Java class files (.class files), Jar package files, etc., and extract key class and interface information, including basic information of classes and interfaces, inheritance relationships, implementation relationships, annotations, generic type information, basic information of methods, calling relationships, line information and annotations, etc., so as to obtain the reference relationship of each second element in the software source code, which can be used to understand the code structure, optimize performance, detect potential problems, and support software maintenance and reconstruction.

[0127] It should be noted that the examples in the figures are only used to understand the present application and do not constitute a limitation on the document change identification method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0128] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0129] This application also provides a file change identification device, please refer to Figure 5 , the file change identification device comprises:

[0130] The acquisition module 51 is used to acquire the association relationship between the first elements in the database configuration file and the reference relationship between the second elements in the software source code, and acquire the change information corresponding to the database configuration file;

[0131] A generating module 52, configured to generate a calling relationship between the database configuration file and the software source code based on the association relationship between the first elements and the reference relationship between the second elements;

[0132] The identification module 53 is used to identify the file change impact scope corresponding to the database configuration file in the software source code based on the calling relationship and the change information.

[0133] The file change identification device is also used for:

[0134] Reading keyword information and index information corresponding to each of the first elements in a database configuration file and element call relationships corresponding to each of the second elements in a software source code;

[0135] Determine, based on the keyword information and the index information, an association relationship between the first elements in the database configuration file;

[0136] Based on the element calling relationship, the reference relationship of each second element in the software source code is determined.

[0137] The file change identification device is also used for:

[0138] Determine the element index identifier corresponding to each of the first elements;

[0139] Based on the element index identifier, establish an element mapping relationship between each of the first elements and each of the second elements;

[0140] Based on the element mapping relationship, the association relationship and the reference relationship, a calling relationship between the database configuration file and the software source code is generated.

[0141] The file change identification device is also used for:

[0142] Based on the element mapping relationship, the association relationship of each of the first elements and the reference relationship of each of the second elements are integrated to generate an element relationship graph;

[0143] Vectorizing the element relationship graph;

[0144] The vectorized element relationship map is used as the calling relationship between the database configuration file and the software source code.

[0145] The file change identification device is also used for:

[0146] Matching the change information with the call relationship to determine a target impact entity corresponding to the target change element;

[0147] Recursively analyze the target impact entity to identify the file change impact scope corresponding to the target change element.

[0148] The file change identification device is also used for:

[0149] Based on the impact scope of the file change, determine the target change element and the target change line;

[0150] Generate a file change impact report based on the target change element and the target change line;

[0151] The file change impact report is pushed to the tester for the tester to perform software testing evaluation.

[0152] The file change identification device is also used for:

[0153] Matching the target change element and the target change line with the software source code to determine the source code change impact area;

[0154] Obtain the change type corresponding to the target change element;

[0155] Based on the change type, the source code change affected area is marked.

[0156] The file change identification device provided by the present application adopts the file change identification method in the above embodiment, and can solve the technical problems in the background technology. Compared with the prior art, the beneficial effects of the file change identification device provided by the present application are the same as the beneficial effects of the file change identification method provided by the above embodiment, and other technical features in the file change identification device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0157] The present application provides a file change identification device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the file change identification method in the above-mentioned embodiment 1.

[0158] Reference below Figure 6 , which shows a schematic diagram of the structure of a file change identification device suitable for implementing the embodiment of the present application. The file change identification device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6The file change identification device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0159] like Figure 6 As shown, the file change identification device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the file change identification device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the file change identification device to communicate with other devices wirelessly or by wire to exchange data. Although the file change identification device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0160] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code 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 device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0161] The file change identification device provided by the present application adopts the file change identification method in the above embodiment, which can solve the technical problems in the background technology. Compared with the prior art, the beneficial effects of the file change identification device provided by the present application are the same as the beneficial effects of the file change identification method provided by the above embodiment, and other technical features in the file change identification device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0162] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0163] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0164] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the file change identification method in the above-mentioned embodiment.

[0165] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0166] The computer-readable storage medium may be included in the file change identification device; or may exist independently without being assembled into the file change identification device.

[0167] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the file change identification device, the file change identification device:

[0168] Obtaining the association relationship between each first element in the database configuration file and the reference relationship between each second element in the software source code, and obtaining the change information corresponding to the database configuration file;

[0169] Based on the association relationship of each of the first elements and the reference relationship of each of the second elements, generating a calling relationship between the database configuration file and the software source code;

[0170] Based on the calling relationship and the change information, the impact scope of the file change corresponding to the database configuration file in the software source code is identified.

[0171] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0172] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0173] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0174] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned file change identification method, and can solve the technical problems in the background technology. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the file change identification method provided by the above-mentioned embodiment, and will not be repeated here.

[0175] An embodiment of the present application provides a computer program product, including a computer program, which implements the steps of the above-mentioned file change identification method when executed by a processor.

[0176] The computer program product provided in this application can solve the technical problems in the background technology. Compared with the prior art, the beneficial effects of the computer program product provided in the embodiment of this application are the same as the beneficial effects of the file change identification method provided in the above embodiment, which will not be repeated here.

[0177] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A file change identification method, characterized in that: include: Obtaining the association relationship between each first element in the database configuration file and the reference relationship between each second element in the software source code, and obtaining the change information corresponding to the database configuration file; Based on the association relationship of each of the first elements and the reference relationship of each of the second elements, generating a calling relationship between the database configuration file and the software source code; Based on the calling relationship and the change information, the impact scope of the file change corresponding to the database configuration file in the software source code is identified.

2. The file change identification method according to claim 1, characterized in that: The obtaining of the association relationship between the first elements in the database configuration file and the reference relationship between the second elements in the software source code includes: Reading keyword information and index information corresponding to each of the first elements in a database configuration file and element call relationships corresponding to each of the second elements in a software source code; Determine, based on the keyword information and the index information, an association relationship between the first elements in the database configuration file; Based on the element calling relationship, the reference relationship of each second element in the software source code is determined.

3. The file change identification method according to claim 1, characterized in that: The generating a calling relationship between the database configuration file and the software source code based on the association relationship of each of the first elements and the reference relationship of each of the second elements includes: Determine the element index identifier corresponding to each of the first elements; Based on the element index identifier, establish an element mapping relationship between each of the first elements and each of the second elements; Based on the element mapping relationship, the association relationship and the reference relationship, a calling relationship between the database configuration file and the software source code is generated.

4. The file change identification method according to claim 3, characterized in that: The generating a calling relationship between the database configuration file and the software source code based on the element mapping relationship, the association relationship and the reference relationship includes: Based on the element mapping relationship, the association relationship of each of the first elements and the reference relationship of each of the second elements are integrated to generate an element relationship graph; Vectorizing the element relationship graph; The vectorized element relationship map is used as the calling relationship between the database configuration file and the software source code.

5. The file change identification method according to claim 1, characterized in that: The change information includes a target change element; The step of identifying the file change impact scope corresponding to the database configuration file in the software source code based on the call relationship and the change information includes: Matching the change information with the call relationship to determine a target impact entity corresponding to the target change element; Recursively analyze the target impact entity to identify the file change impact scope corresponding to the target change element.

6. The file change identification method according to claim 1, characterized in that: After identifying the impact scope of the file change corresponding to the database configuration file in the software source code based on the call relationship and the change information, the method further includes: Based on the impact scope of the file change, determine the target change element and the target change line; Generate a file change impact report based on the target change element and the target change line; The file change impact report is pushed to the tester for the tester to perform software testing evaluation.

7. The file change identification method according to claim 6, characterized in that: After determining the target change element and the target change line based on the file change impact scope, the method further includes: Matching the target change element and the target change line with the software source code to determine the source code change impact area; Obtain the change type corresponding to the target change element; Based on the change type, the source code change affected area is marked.

8. A file change identification device, characterized in that: include: An acquisition module, used to acquire the association relationship between each first element in the database configuration file and the reference relationship between each second element in the software source code, and acquire the change information corresponding to the database configuration file; A generating module, configured to generate a calling relationship between the database configuration file and the software source code based on the association relationship between the first elements and the reference relationship between the second elements; An identification module is used to identify the impact scope of the file change corresponding to the database configuration file in the software source code based on the calling relationship and the change information.

9. A file change identification device, characterized in that: The file change identification device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the file change identification method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the file change identification method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

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

    CN121455449A