Neural Program Repair for Runtime Bug Fix Prediction

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 by learning bug-fix patterns across different contexts, utilizing a bug-type edit centroid 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 detected, 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 segments bug detection into two distinct phases: static analysis for syntax errors and runtime testing for runtime errors. This segmentation allows each method to specialize in detecting specific types of bugs, thereby improving both measurement precision and adaptability across different error types without requiring a single tool to handle all detection scenarios

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces test cases as an intermediary mechanism that bridges the gap between static analysis and runtime error detection. These test cases are generated based on static analysis results and serve as a mediator to expose runtime errors that static analysis alone cannot detect, thereby extending detection coverage while maintaining the strengths of static analysis

Inventive Principle:
Principle #24Intermediary (Mediator)

2Measurement precision

If comprehensive testing is performed to detect all runtime errors, then bug detection capability improves, but testing time and resources increase significantly

Engineering Contradiction:
Improveruntime error detectionVSAvoidtesting time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent performs preliminary static analysis to identify potential runtime errors before generating test cases. This preliminary action filters and prioritizes which runtime errors need testing, allowing the system to focus testing efforts on high-risk areas and reduce the overall testing time while maintaining effective runtime error detection

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent generates a targeted set of test cases that focuses on detecting specific high-impact runtime errors rather than attempting to test all possible scenarios. This partial action approach achieves sufficient runtime error detection coverage without the prohibitive time and resource costs of exhaustive testing

Inventive Principle:
Principle #16Partial or excessive action

3Ease of repair

If software bugs are fixed after deployment through software maintenance, then bug repair capability is provided, but usability of the deployed program deteriorates and maintenance costs increase

Engineering Contradiction:
Improvebug fix capabilityVSAvoidsoftware stability
Core Design Contradiction:
Ease of repairVSReliability

Solution Approach 1:

The patent performs preliminary detection of runtime errors through automated test case execution before the software is deployed to production. By identifying and reporting bugs in advance, the system enables developers to fix issues during the development phase rather than after deployment, thereby maintaining software stability and avoiding the negative impacts of post-deployment repairs

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent implements an automated feedback mechanism where test case results are immediately fed back to developers, enabling rapid identification and repair of bugs. This continuous feedback loop allows for iterative improvement during development, reducing the need for disruptive maintenance after deployment and preserving software reliability

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS20250355786A1Automated program repair tool
Publication Date: 2025.11.20 MICROSOFT TECHNOLOGY LICENSING LLC
  • US20250355786A1 patent drawing
  • US20250355786A1 patent drawing
  • US20250355786A1 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.