Classifying System-Generated Code for Static Analysis

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Static analysis of software source code is hindered by automatically generated system-generated code, which introduces data pollution, misattributes contributions, and overwhelms changes, making it difficult to accurately attribute changes and violations to developer entities.

Innovation Solution

A system that classifies source code as system-generated, allowing it to be ignored in attribution and violation matching processes, thereby improving accuracy and scalability of static analysis by distinguishing it from code written by developers.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If system-generated code is included in static analysis, then comprehensive code coverage is achieved, but attribution accuracy deteriorates due to data pollution from automatic generation

Engineering Contradiction:
Improveattribution accuracyVSAvoidcode volume
Core Design Contradiction:
Measurement precisionVSQuantity of substance

Solution Approach 1:

The patent segments the codebase into two distinct categories: developer-written code and system-generated code. By creating separate classification buckets and applying different analysis rules to each segment, the system preserves comprehensive coverage while preventing system-generated code from polluting attribution metrics for developer contributions.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent extracts system-generated code from the general codebase through classification mechanisms that identify generated files. Once extracted and classified, this code is excluded from violation matching and attribution processes, thereby removing the data pollution source while maintaining analysis of the remaining developer-written code.

Inventive Principle:
Principle #2Taking out (Extraction)

2Reliability

If system-generated code is analyzed in violation matching, then complete violation detection is achieved, but analysis time increases due to overwhelming code volume

Engineering Contradiction:
Improveviolation detection completenessVSAvoidanalysis time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent extracts system-generated code from the violation matching process through classification. By removing generated code files from the set of files subjected to violation matching and attribution, the system maintains reliable detection of violations in developer code while dramatically reducing the time-consuming analysis of large volumes of automatically generated code.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent applies partial action by performing violation matching only on the subset of developer-written code rather than the complete codebase including system-generated code. This selective approach achieves sufficient violation detection for developer contributions without the excessive time cost of analyzing all generated code.

Inventive Principle:
Principle #16Partial or excessive action

3Loss of information

If system-generated code is attributed to developer entities, then complete contribution tracking is achieved, but attribution fairness deteriorates due to misattribution of generated code

Engineering Contradiction:
Improvecontribution tracking completenessVSAvoidattribution fairness
Core Design Contradiction:
Loss of informationVSMeasurement precision

Solution Approach 1:

The patent segments attribution tracking into two separate pathways: one for developer-written code that captures genuine developer contributions, and another for system-generated code that is excluded from developer attribution. This segmentation preserves complete tracking of developer contributions without the unfair misattribution of generated code to developers.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent extracts system-generated code from the attribution process by classifying generated files and excluding them from violation matching and developer entity attribution. This extraction ensures that only genuine developer contributions are attributed to developer entities, maintaining fairness while preserving complete tracking of actual developer work.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS10810007B2Classifying system-generated code
Publication Date: 2020.10.20 MICROSOFT TECHNOLOGY LICENSING LLC
  • US10810007B2 patent drawing
  • US10810007B2 patent drawing
  • US10810007B2 patent drawing

AI summary

Methods, systems, and apparatus, including computer programs encoded on computer storage media, for classifying system-generated code. One of the methods includes generating data representing a state of source code files of the snapshot before performing a build process for the snapshot. An instrumented build process is performed for the snapshot, including intercepting each compiler call of a plurality of compiler calls by the build process for the snapshot, and designating one or more respective source code files of each compiler call as source code files compiled during the build process for the snapshot. One or more source code files that are new or were modified after the build process was initiated are classified as source code files having system-generated source code.