Neural Program Repair for Runtime Bug Fix Prediction
Find Innovative SolutionsGenerate 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
Engineering 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
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
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
2Measurement precision
If comprehensive testing is performed to detect all runtime errors, then bug detection capability improves, but testing time and resources increase significantly
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
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
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
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
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
Data Source
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.


