Deep Learning Patch Generator for Automated Source Code Bug Fixing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Software developers face challenges in identifying and automatically fixing bugs and vulnerabilities in source code, as manual patch generation is costly and time-consuming.
Innovation Solution
A patch generator using deep learning encoder-decoder architectures, such as recurrent neural networks (RNNs) and multi-head attention, is implemented to automatically identify bugs, generate, and apply patches to source code, reducing the need for manual intervention.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If manual patch generation is used to fix bugs and vulnerabilities in source code, then accuracy and reliability of bug fixing can be maintained through developer expertise, but the process becomes costly and time-consuming
Solution Approach 1:
The system enables self-service by allowing the codebase to automatically generate and apply its own patches through the deep learning model, which learns from historical bug-fix patterns and autonomously produces remediation code without requiring manual developer intervention for each bug
Solution Approach 2:
The patent replaces the mechanical system of manual code review and patch creation with an automated deep learning-based system that uses encoder-decoder neural networks to automatically generate patches, substituting human cognitive processes with machine learning algorithms
2Reliability
If manual patch generation is used to ensure quality bug fixes, then reliability is maintained, but productivity decreases due to the time-consuming nature of manual intervention
Solution Approach 1:
The system enables self-service by allowing the codebase to automatically generate and apply its own patches through the deep learning model, which learns from historical bug-fix patterns and autonomously produces remediation code without requiring manual developer intervention for each bug
Solution Approach 2:
The patent changes the parameters of the bug-fixing process by transitioning from human-centric manual patch creation to an automated system using deep learning models with encoder-decoder architectures, fundamentally altering how patches are generated and applied
3Productivity
If automated methods are used to increase bug fixing productivity, then time and cost are reduced, but device complexity increases due to the need for deep learning models and verification systems
Solution Approach 1:
The deep learning model serves multiple functions: it identifies bugs, generates patches, and can be trained on diverse codebases and bug types, making a single system capable of handling various programming languages and vulnerability categories without requiring separate specialized tools for each
4Productivity
If automated deep learning methods are implemented to reduce manual intervention, then productivity increases, but ease of operation decreases due to the complexity of implementing and maintaining deep learning systems
Solution Approach 1:
The system incorporates feedback mechanisms where the outcomes of automated patch applications are monitored and used to retrain and improve the deep learning model over time, creating a closed-loop system that continuously learns from real-world performance data
Data Source
AI summary
A device includes one or more processors configured to: receive source code including a section of source code associated with at least one bug or vulnerability; generate a formatted code section based at least partly on the section of source code associated with at least one bug or vulnerability; identify a matching patch model based on the formatted code section; provide the formatted code section to the matching patch model; receive a remedied code section from the matching patch model; and apply the remedied code section to the section of source code associated with at least one bug or vulnerability. Generating the formatted code section based at least partly on the section of source code associated with at least one bug or vulnerability includes: dividing the section of source code into sub-elements; associating type information to the sub-elements to generate tokens; and mapping each token to a unique identifier.


