Automated Program Repair with Bug-Type Centroid Decoding

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing software testing methods, including static analysis and testing, are inadequate in detecting runtime errors such as resource leaks, memory leaks, null pointer dereferences, and concurrency errors, leading to increased maintenance costs and usability issues after deployment.

Innovation Solution

An automated program repair tool using a sequence-to-sequence neural transformer model with attention is trained on a large unsupervised corpus of source code and fine-tuned with a supervised dataset to predict bug repairs, leveraging edit embeddings and bug-type centroids for inference.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If static analysis tools are used to detect bugs, then syntax errors can be identified, but runtime errors such as memory leaks, null pointer dereferences, and concurrency errors cannot be detected

Engineering Contradiction:
Improvebug detection capabilityVSAvoiddetection coverage across different error types
Core Design Contradiction:
Measurement precisionVSAdaptability or versatility

Solution Approach 1:

The patent introduces test cases as an intermediary between the software system and bug detection. These test cases are automatically generated by analyzing source code and executing the software under various conditions to reveal runtime errors that static analysis cannot detect

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent replaces manual testing and static analysis methods with an automated system that uses machine learning models to generate and execute test cases, thereby detecting runtime errors automatically without human intervention

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

2Reliability

If comprehensive testing is performed to detect all possible bugs, then software quality improves, but testing time and resources increase significantly

Engineering Contradiction:
Improvesoftware qualityVSAvoidtesting time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies partial action by focusing testing efforts on the most critical and frequently occurring bug types. The system prioritizes generating test cases for high-risk areas of the code, achieving sufficient quality without exhaustive testing of all possible scenarios

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

The patent performs preliminary analysis of source code to identify potential bug locations and patterns before generating test cases. This preliminary action allows the system to focus testing resources on areas most likely to contain bugs, reducing overall testing time

Inventive Principle:
Principle #10Preliminary action

3Reliability

If software bugs are fixed after deployment through maintenance, then bug resolution is achieved, but usability deteriorates and maintenance costs increase

Engineering Contradiction:
Improvebug resolutionVSAvoidusability
Core Design Contradiction:
ReliabilityVSEase of operation

Solution Approach 1:

The patent performs bug detection and fixing before software deployment by automatically generating and executing test cases during the development phase. This preliminary action prevents bugs from reaching production, eliminating the need for post-deployment patches that would disrupt usability

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system enables self-service bug fixing by automatically generating test cases, identifying bugs, and suggesting fixes without human intervention. This automated self-correction process resolves bugs before deployment, preventing usability degradation

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS12393504B2Automated program repair tool
Publication Date: 2025.08.19 MICROSOFT TECHNOLOGY LICENSING LLC
  • US12393504B2 patent drawing
  • US12393504B2 patent drawing
  • US12393504B2 patent drawing

AI summary

An automated program repair tool utilizes a neural transformer model with attention to predict the contents of a bug repair in the context of source code having a bug of an identified bug type. The neural transformer model is trained on a large unsupervised corpus of source code using a span-masking denoising optimization objective, and fine-tuned on a large supervised dataset of triplets containing a bug-type annotation, software bug, and repair. The bug-type annotation is derived from an interprocedural static code analyzer. A bug type edit centroid is computed for each bug type and used in the inference decoding phase to generate the bug repair.