Automated Program Repair with Bug-Type Centroid Decoding
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, leveraging edit embeddings and bug-type centroids 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 identified, but runtime errors such as memory leaks, null pointer dereferences, and concurrency errors cannot be detected
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
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
2Reliability
If comprehensive testing is performed to detect all possible bugs, then software quality improves, but testing time and resources increase significantly
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
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
3Reliability
If software bugs are fixed after deployment through maintenance, then bug resolution is achieved, but usability deteriorates and maintenance costs increase
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
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
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.


