Hybrid Dependency Graph Generation for Dynamic Code Analysis

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for analyzing dependencies in complex software systems, particularly in dynamic languages like JavaScript, face challenges due to the lack of well-defined type systems, dynamic type changes, and extensive use of reflection, leading to difficulties in static analysis and maintaining soundness.

Innovation Solution

A computer-assisted method for generating a dependency graph that combines static and dynamic analysis, using node data structures with associated properties and metadata, and iterative analysis stages to accurately represent dependencies and their properties, even in dynamic environments.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If static analysis is used to calculate dependencies, then analysis speed is improved, but accuracy deteriorates in dynamic languages due to lack of well-defined type systems and dynamic type changes

Engineering Contradiction:
Improveanalysis speedVSAvoiddependency accuracy
Core Design Contradiction:
SpeedVSMeasurement precision

Solution Approach 1:

The patent combines static analysis and dynamic analysis into a hybrid approach. Static analysis is performed first to establish initial dependency relationships, then dynamic analysis is applied to refine and correct dependencies that cannot be determined statically, particularly in dynamic languages. This merging resolves the contradiction by leveraging the speed of static analysis while compensating for its inaccuracy with dynamic analysis.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent performs preliminary static analysis to establish a baseline dependency graph before executing dynamic analysis. This preliminary action allows the system to quickly identify obvious dependencies and then focus dynamic analysis resources on resolving ambiguous cases, improving overall efficiency while maintaining accuracy.

Inventive Principle:
Principle #10Preliminary action

2Measurement precision

If dynamic analysis is used to calculate dependencies, then accuracy is improved, but analysis time increases due to runtime execution requirements

Engineering Contradiction:
Improvedependency accuracyVSAvoidanalysis time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent applies partial dynamic analysis rather than exhaustive analysis of all code paths. It performs dynamic analysis selectively on portions of the code where static analysis was insufficient or ambiguous, rather than analyzing everything dynamically. This partial action achieves necessary accuracy while significantly reducing the time cost compared to full dynamic analysis.

Inventive Principle:
Principle #16Partial or excessive action

3Loss of information

If comprehensive dependency tracking is implemented, then understanding of code relationships is improved, but system complexity increases due to extensive metadata management

Engineering Contradiction:
Improvecode relationship informationVSAvoidsystem complexity
Core Design Contradiction:
Loss of informationVSDevice complexity

Solution Approach 1:

The patent segments the dependency analysis system into distinct components: static analysis module, dynamic analysis module, and integration layer. Each component handles specific aspects of dependency tracking independently, managing their own metadata structures. This segmentation reduces overall system complexity by breaking down the complex task of comprehensive dependency tracking into manageable, modular pieces.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS9122490B2Code dependency calculation
Publication Date: 2015.09.01 MICROSOFT TECHNOLOGY LICENSING LLC
  • US9122490B2 patent drawing
  • US9122490B2 patent drawing
  • US9122490B2 patent drawing

AI summary

Generation of a dependency graph for code that includes code portions such as resources or functions or both. For some or all of the nodes, the dependency is calculated by determining that the given node, a depending node, depends on an affecting node. The dependency is recorded so as to be associated with the node. Furthermore, the dependency calculation method is recorded so as to be associated with the dependency. The code may perhaps include portions within two different domains, in which the mechanism for calculating dependencies may differ. In some cases, the dependency graph may be constructed in stages, and perhaps additional properties may be associated with the node, and metadata of the properties may also be recorded.