Machine Learning Flow Analysis for Faster Code Violation Detection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Static code analysis is time-consuming due to the vast number of execution paths that need examination, often leading to incomplete coverage within the available analysis time.

Innovation Solution

A machine learning model is trained using datasets from scanned projects to prioritize execution paths based on their likelihood to lead to code violations, assigning probability scores for efficient analysis.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If flow analysis examines all execution paths to ensure complete code violation detection, then detection coverage is improved, but analysis time increases significantly

Engineering Contradiction:
Improvecode violation detection coverageVSAvoidanalysis time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system performs preliminary analysis by training a machine learning model on historical code data before executing flow analysis. The model pre-identifies suspicious functions and methods that are likely to contain violations, allowing the flow analysis to focus only on these prioritized areas rather than examining all execution paths equally, thus reducing analysis time while maintaining detection coverage

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system applies different analysis strategies to different parts of the codebase. Instead of uniform analysis across all functions, it uses the machine learning model to identify and prioritize suspicious regions (functions/methods with higher violation probability), allocating more analysis resources to these local areas while reducing or skipping analysis in low-risk areas, thereby optimizing the balance between coverage and time

Inventive Principle:
Principle #3Local quality

2Productivity

If flow analysis prioritizes examination of likely violation paths using machine learning, then analysis speed is improved, but detection coverage may be reduced

Engineering Contradiction:
Improveanalysis speedVSAvoiddetection coverage
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The system uses feedback from the machine learning model's probability predictions to dynamically adjust the flow analysis process. Functions with higher violation probabilities are examined more thoroughly, while lower-probability functions receive reduced analysis. This feedback-driven approach ensures that analysis speed is improved for high-risk areas without completely skipping potential violations, maintaining an optimal balance between productivity and reliability

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS20250225053A1System and method for optimizing flow analysis in static code analysis using machine learning
Publication Date: 2025.07.10 PARASOFT CORP
  • US20250225053A1 patent drawing
  • US20250225053A1 patent drawing
  • US20250225053A1 patent drawing

AI summary

System and method for optimizing flow analysis for detections of code violations in a computer program, using machine learning include: analyzing the computer program for code violations; identifying functions or methods with execution path to code violations and creating a first dataset for suspicious functions or methods; identifying functions or methods with no execution path to code violations and creating a second dataset for unsuspicious functions or method; training a machine learning model to classify the suspicious and unsuspicious functions or method using the first and second datasets, wherein the trained model outputs a probability score for the methods or functions with execution paths to code violations; and utilizing the machine learning model to analyze code violations in a new computer program responsive to the probability scores for the methods or functions with execution paths to code violations.