Source Code Anomaly Detection via Style Profile Matching

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing technologies face challenges in reliably maintaining and efficiently generating new source code, as they often require specialized knowledge and result in inefficient storage and repurposing of code due to formatting and style differences among users, leading to unnecessary duplication and failure to detect or correct anomalies.

Innovation Solution

A system that includes a source code analyzer to detect and correct anomalies, a style repository for user-specific formatting, and a custom code generator that uses natural language inputs to produce customized code matching user styles, thereby facilitating efficient storage and generation of source code.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If manual code storage and retrieval is used, then users can store source code, but code duplication occurs due to formatting differences and specialized knowledge requirements

Engineering Contradiction:
Improvecode storage reliabilityVSAvoidcode generation efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The system enables self-service by automatically detecting code style features, comparing them against predefined profiles, and determining code readiness for storage without requiring manual review by specialized personnel. The automated analyzer performs style verification, anomaly detection, and code generation tasks independently, eliminating the need for manual code formatting and review processes.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent replaces manual mechanical code review and formatting processes with automated electronic systems. The style analyzer automatically extracts style features, compares them against stored profiles, and determines code eligibility for storage. This substitution of manual mechanical processes with automated electronic analysis eliminates code duplication caused by formatting inconsistencies and reduces the need for specialized knowledge to verify code style.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Manufacturing precision

If automated style analysis is implemented, then code quality and consistency improve, but system complexity increases

Engineering Contradiction:
Improvecode formatting precisionVSAvoidanalyzer system complexity
Core Design Contradiction:
Manufacturing precisionVSDevice complexity

Solution Approach 1:

The system segments the code analysis process into distinct functional modules: style feature extraction, style profile comparison, anomaly detection, and code generation readiness determination. Each module handles a specific aspect of code analysis independently, making the overall complex system manageable through modular architecture. The style analyzer extracts specific formatting features, compares them against profiles, and generates reports separately from the code generation process.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The style profile acts as an intermediary between the raw code and the storage system. Instead of directly analyzing code against complex rules, the system pre-computes and stores style profiles that encapsulate formatting expectations. The analyzer compares extracted style features against these pre-established profiles, simplifying the decision-making process and reducing the complexity of the analysis system while maintaining high precision in code quality assessment.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Adaptability or versatility

If multiple copies of similar code are stored, then user needs are met with different formats, but computing resources are wasted

Engineering Contradiction:
Improvecode format adaptabilityVSAvoidcomputing resource waste
Core Design Contradiction:
Adaptability or versatilityVSLoss of energy

Solution Approach 1:

The system changes the parameter of code representation by extracting and normalizing style features from raw code into standardized style profiles. Instead of storing multiple code copies with different formatting, the system stores a single canonical code representation along with its extracted style features. This parameter transformation allows the system to accommodate different user formatting preferences through style profiles while storing only one version of the code, eliminating redundancy and wasting computing resources.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS11657151B2System and method for detecting source code anomalies
Publication Date: 2023.05.23 BANK OF AMERICA CORP
  • US11657151B2 patent drawing
  • US11657151B2 patent drawing
  • US11657151B2 patent drawing

AI summary

A system includes a source code repository which stores source code entries, which include instructions in a programming language for performing computing tasks. A style repository stores a style profile. Each style profile includes predefined style features associated with formatting characteristics of the stored source code entries. A source code analyzer receives a source code which includes instructions in the programming language for performing a computing task. Style features of the source code are determined. The style features include characteristics of a format of the source code. The source code analyzer determines whether the style features correspond to predefined style features indicated by a style profile. If this is the case, the source code is stored in the source code repository. If this is not the case, storage of the source code is prevented.