Partial Static Analysis of Source Code via Dependency Graph

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Performing full static analysis on large software projects is time-consuming and resource-intensive, often providing irrelevant results for users interested in specific portions of the codebase.

Innovation Solution

A partial static analysis system that uses a dependency graph to selectively analyze primary and secondary source code files, allowing for focused analysis on relevant files, reducing computational resources and improving responsiveness.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If full static analysis is performed on all source code files, then comprehensive analysis results are obtained, but analysis time and computational resources increase significantly

Engineering Contradiction:
Improvecomprehensive analysis resultsVSAvoidanalysis time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent divides the codebase into primary source code files (manually written) and secondary source code files (automatically generated), analyzing only the primary files to segment the analysis workload and eliminate irrelevant portions

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent extracts and excludes automatically generated source code files from the static analysis process, removing irrelevant data that would consume computational resources without providing meaningful insights

Inventive Principle:
Principle #2Taking out (Extraction)

2Measurement precision

If full static analysis is performed on all source code files, then complete coverage is achieved, but computational resources are excessively consumed

Engineering Contradiction:
Improveanalysis coverageVSAvoidcomputational resources
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The codebase is segmented into primary and secondary files based on their origin (manual vs. automatic generation), allowing selective analysis that reduces computational resource consumption while maintaining coverage of relevant code

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies partial analysis by focusing only on primary source code files rather than performing excessive full-analysis on all files, achieving sufficient coverage for development purposes without wasteful resource consumption

Inventive Principle:
Principle #16Partial or excessive action

3Measurement precision

If static analysis is performed on automatically generated code, then complete analysis is provided, but voluminous and uninteresting results are produced

Engineering Contradiction:
Improveanalysis completenessVSAvoidsignal-to-noise ratio
Core Design Contradiction:
Measurement precisionVSLoss of information

Solution Approach 1:

Automatically generated source code files are extracted and excluded from the analysis scope, removing the source of voluminous uninteresting results while preserving analysis completeness for manually written code where developer intent and potential issues reside

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS10768925B2Performing partial analysis of a source code base
Publication Date: 2020.09.08 MICROSOFT TECHNOLOGY LICENSING LLC
  • US10768925B2 patent drawing
  • US10768925B2 patent drawing
  • US10768925B2 patent drawing

AI summary

Methods, systems, and apparatus, including computer programs encoded on computer storage media, for performing partial analysis of source code files in a code base. One of the methods includes receiving a request for analysis results for a subset of source code files in a project. A set of primary source code files is generated according to the request, wherein the set of primary source code files includes fewer than all source code files in the project. A set of secondary source code files is generated, the set comprising source code files upon which at least one of the primary source code files depends directly or transitively. A partial analysis of the code base is performed using all files included in the set of primary source code files or the set of secondary source code files. Analysis results for the files included in the set of primary source code files is provided in response to the request.