Debugging method for computer software development
Through static and dynamic analysis combined with preset algorithms to detect the dependence between software modules and generate optimization suggestions, the problem of difficult to automatically identify and optimize the dependence between modules in the existing technology is solved, and the software development efficiency and maintainability are improved.
Patent Information
- Application Number
- CN202411370161.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-02-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to automatically identify and optimize over-dependence or unreasonable dependency paths between software modules, resulting in developers needing to manually analyze and adjust when facing complex dependency structures, which is inefficient and prone to errors.
Through static and dynamic analysis combined with preset algorithms, the dependency between software modules is detected, dependency optimization suggestions are generated, and the dependency between modules can be optimized through automatic reconstruction tools.
It significantly improves the efficiency of the software development process and maintainability of the software system, and automates and precise analysis and optimization methods, helps developers effectively deal with complex module dependencies, and improves the quality and stability of the software.
Smart Images

Figure CN119473830A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer software development, and in particular to a debugging method for computer software development. Background Art
[0002] As the scale of software development continues to expand, modern computer software systems are becoming more and more complex, often consisting of multiple modules and components working together. Although modular design can improve the flexibility and maintainability of software, the dependencies between modules also increase. Especially in large software systems, the dependencies between modules will become more complex and difficult to manage as the functions expand. Excessive dependence or circular dependence often occurs, which seriously affects the efficiency of software development, the difficulty of debugging, and subsequent maintenance work.
[0003] In the software development process, the dependency between modules determines the coupling degree of the system. High coupling degree will not only increase the complexity of the system, but also may cause a series of problems in the debugging and maintenance stages. For example, excessive dependency between modules may cause changes in a certain module to affect multiple related modules, increasing the difficulty and workload of debugging; circular dependency will cause mutual dependence between modules, resulting in the system being unable to operate normally in some cases, and even causing dead loops or dependency errors.
[0004] Although current software debugging tools and technologies can help developers analyze the calling relationships between modules to a certain extent, they are still insufficient in detecting and optimizing dependency relationships. In particular, existing technologies are usually unable to automatically identify and optimize excessive dependencies or unreasonable dependency paths between modules, which results in developers often having to manually analyze and adjust complex dependency structures, which is inefficient and error-prone. Summary of the invention
[0005] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0007] In a first aspect, this embodiment provides a debugging method for computer software development, wherein the method detects dependencies between software modules through static and dynamic analysis combined with a preset algorithm, and specifically includes:
[0008] S1. Extract the dependency matrix D between all modules through static and dynamic analysis ij , where D ijIndicates module M i For module M j Dependency, get the calling frequency C between modules ij , to represent the module M i With module M j The calling relationship;
[0009] S2, detecting dependencies between modules through a preset algorithm;
[0010] S3. Determine whether there is excessive dependence and unreasonable dependence path through the dependency analysis results;
[0011] S4. Generate dependency optimization suggestions based on dependency analysis results, and choose to optimize dependencies between modules through automatic refactoring tools;
[0012] S5. Log recording, recording and saving debugging information.
[0013] As a preferred solution of the debugging method for computer software development described in the present invention, the specific calculation formula of the preset algorithm is as follows:
[0014]
[0015] Where N ij represents the normalized dependency strength; V ij (t) represents module M i With module M j The rate of change of the dependency relationship between them; n is the total number of modules in the software system.
[0016] As a preferred solution of the debugging method for computer software development described in the present invention, wherein: ij The specific calculation formula is as follows:
[0017]
[0018] Where k is the weight index; λ is the adjustment parameter of the dependency; μ is the offset of the call frequency.
[0019] As a preferred solution of the debugging method for computer software development described in the present invention, wherein: ij (t) The specific calculation formula is as follows:
[0020]
[0021] Where P ij (t) is the function of dependency over time t, representing module M i With module M j The intensity of dependence changes over time.
[0022] As a preferred solution of the debugging method for computer software development described in the present invention, the value range of Dep_Score is divided into the following levels:
[0023] 0≤Dep_Score<0.2, extremely low, almost no dependency between modules, and strong independence;
[0024] 0.2≤Dep_Score<0.4, low, the dependency is very weak, and the modules are relatively independent;
[0025] 0.4≤Dep_Score<0.6, medium, there is a medium degree of dependency, and there is a certain degree of coupling between modules;
[0026] 0.6≤Dep_Score<0.8, high, high dependency between modules, increased coupling, and increased maintenance difficulty;
[0027] 0.8≤Dep_Score≤1.0, which is extremely high. There is a possibility of circular dependency and over-dependency, and debugging is more difficult.
[0028] As a preferred solution of the debugging method for computer software development described in the present invention, the optimization suggestion specifically includes:
[0029] Very low: No optimization is required, the existing structure is maintained, and the independent modules of the system can continue to maintain the characteristics of loose coupling;
[0030] Lower: Improve the independence of modules through further decoupling strategies, thereby further enhancing the maintainability of the system;
[0031] Medium: Streamline unnecessary dependencies and avoid redundant dependency paths;
[0032] Higher: The focus should be on optimizing the dependency structure and reducing direct dependencies between modules. At the same time, interfaces and abstract levels can be introduced to avoid direct calls of modules.
[0033] Very high: Deep dependency optimization is required. Circular dependencies need to be identified and eliminated, and the system architecture needs to be restructured to ensure that modules can be debugged and run independently. It is recommended to use a loosely coupled architecture design to separate data processing and logic control, optimize the division of responsibilities of modules, and reduce the interdependence between modules.
[0034] As a preferred solution of the debugging method for computer software development described in the present invention, wherein: the dependency matrix D ij It is generated by a static code analysis tool that analyzes function calls, data transfers, and object reference relationships between modules based on the code structure.
[0035] As a preferred solution of the debugging method for computer software development described in the present invention, wherein: the calling frequency C ij The real-time calling information between modules is recorded during the debugging process through the instrumentation technology, and the information includes the number of module calls and the calling sequence.
[0036] As a preferred solution of the debugging method for computer software development described in the present invention, the log records the dependency analysis results and optimization history during the debugging process to ensure the traceability of the dependency optimization process.
[0037] In a second aspect, the present invention provides a debugging system for computer software development, specifically comprising:
[0038] Dependency analysis module: including static analysis unit and dynamic analysis unit;
[0039] Dependency detection module;
[0040] Dependency optimization module: including dependency analysis result processing unit and automatic reconstruction tool unit;
[0041] Logging module.
[0042] Beneficial effects of the present invention:
[0043] This invention significantly improves the efficiency of the software development process and the maintainability of the software system by automatically detecting, analyzing and optimizing the dependencies between modules. Its automated and precise analysis and optimization methods not only help developers effectively deal with complex module dependency issues, but also improve the quality and stability of the software and improve work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:
[0045] Figure 1 A method flow chart of a debugging method for computer software development proposed by the present invention;
[0046] Figure 2 This is an architectural diagram of a debugging system for computer software development proposed by the present invention. DETAILED DESCRIPTION
[0047] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.
[0048] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0049] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0050] Reference Figure 1-2 The present invention provides a debugging method for computer software development. The method detects the dependency between software modules by static and dynamic analysis combined with a preset algorithm, specifically including:
[0051] S1. Extract the dependency matrix D between all modules through static and dynamic analysis ij , where D ij Indicates module M i For module M j Dependency, get the calling frequency C between modules ij , to represent the module M i With module M j The calling relationship;
[0052] S2, detecting dependencies between modules through a preset algorithm;
[0053] S3. Determine whether there is excessive dependence and unreasonable dependence path through the dependency analysis results;
[0054] S4. Generate dependency optimization suggestions based on dependency analysis results, and choose to optimize dependencies between modules through automatic refactoring tools;
[0055] S5. Log recording, recording and saving debugging information.
[0056] Among them, the specific calculation formula of the preset algorithm is as follows:
[0057]
[0058] Where N ij Represents the normalized dependency strength. Through the normalization function, the dependency strength is made more stable to avoid the influence of extreme values. V ij (t) represents module M i With module M jThe dependency change rate between modules captures the dynamic behavior of the dependencies between modules over time; n is the total number of modules in the software system.
[0059] Furthermore, N ij The specific calculation formula is as follows:
[0060]
[0061] Where k is the weight index, which is used to adjust the influence of the dependency; λ is the adjustment parameter of the dependency relationship, which controls the slope of the normalization function and determines the speed of change of the dependency strength; μ is the offset of the call frequency, which represents the baseline value of the dependency normalization and is used to balance the excessively high or low call frequency.
[0062] Furthermore, V ij (t) The specific calculation formula is as follows:
[0063]
[0064] Where P ij (t) is the function of dependency over time t, representing module M i With module M j The change of dependency strength over time is usually constructed by real-time data collected during debugging, reflecting the change trend of dependency over time. is the partial derivative.
[0065] Furthermore, the value range of Dep_Score is divided into the following levels:
[0066] 0≤Dep_Score<0.2, extremely low, almost no dependency between modules, and strong independence;
[0067] 0.2≤Dep_Score<0.4, low, the dependency is very weak, and the modules are relatively independent;
[0068] 0.4≤Dep_Score<0.6, medium, there is a medium degree of dependency, and there is a certain degree of coupling between modules;
[0069] 0.6≤Dep_Score<0.8, high, high dependency between modules, increased coupling, and increased maintenance difficulty;
[0070] 0.8≤Dep_Score≤1.0, which is extremely high. There is a possibility of circular dependency and over-dependency, and debugging is more difficult.
[0071] Further optimization suggestions include:
[0072] Very low: No optimization is required, the existing structure is maintained, and the independent modules of the system can continue to maintain the characteristics of loose coupling;
[0073] Lower: Improve the independence of modules through further decoupling strategies (such as reducing shared states and optimizing interface design), thereby further enhancing the maintainability of the system;
[0074] Moderate: Streamline unnecessary dependencies and avoid redundant dependency paths. For example, optimize the data transmission method between modules or reduce unnecessary interactions.
[0075] Higher: The focus should be on optimizing the dependency structure and reducing the direct dependencies between modules. Design patterns (such as dependency injection) can be used to reduce coupling. At the same time, interfaces and abstract levels can be introduced to avoid direct calls to modules.
[0076] Very high: In-depth dependency optimization is required, circular dependencies need to be identified and eliminated, the system architecture needs to be restructured, and modules can be debugged and run independently. It is recommended to use a loosely coupled architecture design, separate data processing and logic control, optimize the division of responsibilities of modules, and reduce the interdependence between modules. Specific optimization measures include dependency injection: by introducing dependency injection, modules are prevented from directly relying on the specific implementation of other modules, but rely on interfaces or abstract classes to reduce the coupling between modules; interface isolation: modules communicate through interfaces instead of directly referencing each other's implementation, thereby reducing the coupling between modules; module separation: modules with high coupling are split into smaller, independent sub-modules to minimize the frequency of direct interaction between modules; circular dependency elimination: analyze the circular dependency path between modules, redesign the dependency relationship, and ensure that the system performance is not affected by too long a dependency chain or mutual calls, etc.
[0077] Furthermore, the dependency matrix D ij It is generated by a static code analysis tool that analyzes function calls, data transfers, and object reference relationships between modules based on the code structure.
[0078] Furthermore, the calling frequency C ij The real-time calling information between modules is recorded during the debugging process through the instrumentation technology, including the number of module calls and the calling order.
[0079] Furthermore, logging records the dependency analysis results and optimization history during debugging to ensure the traceability of the dependency optimization process.
[0080] This embodiment also provides a debugging system for computer software development, which specifically includes:
[0081] Dependency analysis module: including static analysis unit and dynamic analysis unit;
[0082] Dependency detection module;
[0083] Dependency optimization module: including dependency analysis result processing unit and automatic reconstruction tool unit;
[0084] Logging module;
[0085] The output of the dependency optimization module will give different optimization solutions for different degrees of dependency. Combined with the dependency scoring system obtained above, the system can automatically or manually select to perform reconstruction to ensure the independence of software modules and improve the efficiency of debugging and maintenance.
[0086] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A debugging method for computer software development, characterized in that: The method detects the dependencies between software modules through static and dynamic analysis combined with a preset algorithm, specifically including: S1. Extract the dependency matrix D between all modules through static and dynamic analysis ij , where D ij Indicates module M i For module M j Dependency, get the calling frequency C between modules ij , to represent the module M i With module M j The calling relationship; S2, detecting dependencies between modules through a preset algorithm; S3. Determine whether there is excessive dependence and unreasonable dependence path through the dependency analysis results; S4. Generate dependency optimization suggestions based on dependency analysis results, and choose to optimize dependencies between modules through automatic refactoring tools; S5. Log recording, recording and saving debugging information.
2. A debugging method for computer software development according to claim 1, characterized in that: The specific calculation formula of the preset algorithm is as follows: Where N ij represents the normalized dependency strength; V ij (t) represents module M i With module M j The rate of change of the dependency relationship between them; n is the total number of modules in the software system.
3. A debugging method for computer software development according to claim 2, characterized in that: The N ij The specific calculation formula is as follows: Where k is the weight index; λ is the adjustment parameter of the dependency; μ is the offset of the call frequency.
4. A computer software development debugging method according to claim 3, characterized in that: The V ij (t) The specific calculation formula is as follows: Where P ij (t) is the function of dependency over time t, representing module M i With module M j The intensity of dependence changes over time.
5. A debugging method for computer software development according to claim 4, characterized in that: The value range of Dep_Score is divided into the following levels: 0≤Dep_Score<0.2, extremely low, almost no dependency between modules, and strong independence; 0.2≤Dep_Score<0.4, low, the dependency is very weak, and the modules are relatively independent; 0.4≤Dep_Score<0.6, medium, there is a medium degree of dependency, and there is a certain degree of coupling between modules; 0.6≤Dep_Score<0.8, high, high dependency between modules, increased coupling, and increased maintenance difficulty; 0.8≤Dep_Score≤1.0, which is extremely high. There is a possibility of circular dependency and over-dependency, and debugging is more difficult.
6. A debugging method for computer software development according to claim 5, characterized in that: The optimization suggestions specifically include: Very low: No optimization is required, the existing structure is maintained, and the independent modules of the system can continue to maintain the characteristics of loose coupling; Lower: Improve the independence of modules through further decoupling strategies, thereby further enhancing the maintainability of the system; Medium: Streamline unnecessary dependencies and avoid redundant dependency paths; Higher: The focus should be on optimizing the dependency structure and reducing direct dependencies between modules. At the same time, interfaces and abstract levels can be introduced to avoid direct calls of modules. Very high: Deep dependency optimization is required. Circular dependencies need to be identified and eliminated, and the system architecture needs to be restructured to ensure that modules can be debugged and run independently. It is recommended to use a loosely coupled architecture design to separate data processing and logic control, optimize the division of responsibilities of modules, and reduce the interdependence between modules.
7. A debugging method for computer software development according to claim 6, characterized in that: The dependency matrix D ij It is generated by a static code analysis tool that analyzes function calls, data transfers, and object reference relationships between modules based on the code structure.
8. A debugging method for computer software development according to claim 7, characterized in that: The calling frequency C ij The real-time calling information between modules is recorded during the debugging process through the instrumentation technology, and the information includes the number of module calls and the calling sequence.
9. A debugging method for computer software development according to claim 8, characterized in that: The log records the dependency analysis results and optimization history during the debugging process, ensuring the traceability of the dependency optimization process.
10. A debugging system for computer software development, based on a debugging method for computer software development according to claims 1 to 9, characterized in that: Specifically include: Dependency analysis module: including static analysis unit and dynamic analysis unit; Dependency detection module; Dependency optimization module: It includes a dependency analysis result processing unit and an automatic reconstruction tool unit; Logging module.