Source Code Impact Analysis Using Statement Invocation Relations
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In software development, changes to source code can have complex and undiscovered impacts on other portions of the code, leading to unexpected errors due to intricate invocation relations among methods and statements, which are difficult for developers to manually identify and manage.
Innovation Solution
A method and system for impact analysis on source code changes by generating a statement invocation relation through parsing intermediate representation of the source code, associating statements with their invocation information, and determining affected statements based on this relation, using matrix operations to identify direct and indirect impacts.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If manual analysis of source code invocation relations is performed, then developers can identify impacted statements, but the complexity and time required increases significantly due to complex invocation relations among methods and statements
Solution Approach 1:
The patent introduces an intermediary data structure (invocation relation graph) that mediates between the complex source code and the impact analysis process. This graph represents invocation relations in a structured format, allowing automated traversal and identification of impacted statements without requiring complex manual analysis of the original source code relationships
Solution Approach 2:
The patent segments the source code analysis into discrete invocation relations that can be independently represented and processed. By breaking down the complex code structure into individual invocation edges and nodes in a graph, the system can analyze impact relationships systematically without being overwhelmed by the overall code complexity
2Reliability
If comprehensive impact analysis of source code changes is performed, then all affected statements can be identified, but the time required for analysis increases
Solution Approach 1:
The patent performs preliminary construction of the invocation relation graph before impact analysis is needed. This pre-processing step establishes all invocation relationships in advance, so that when a change occurs, the system can quickly traverse the pre-built graph to identify impacted statements without performing complex analysis from scratch
Solution Approach 2:
The system provides feedback by traversing the invocation graph from changed statements to identify all impacted statements. This feedback mechanism allows the system to systematically propagate impact information through the codebase, ensuring comprehensive identification of affected areas while using the structured graph to optimize the traversal process
Data Source
AI summary
The method of this disclosure may comprise generating a statement invocation relation for a source code by parsing intermediate representation of the source code produced by a compiler. The method of this disclosure may further comprise in response to a first statement in a first code snippet of the plurality of code snippet being changed, determining affected statements in the source code due to the change of the first statement based on the statement invocation relation.


