Deep Learning Patch Generator for Automated Source Code Bug Fixing

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improvebug fixing accuracyVSAvoidpatch generation time
Core Design Contradiction:
ReliabilityVSLoss of time

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

Inventive Principle:
Principle #25Self-service

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

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

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

Engineering Contradiction:
Improvepatch qualityVSAvoidbug fixing throughput
Core Design Contradiction:
ReliabilityVSProductivity

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

Inventive Principle:
Principle #25Self-service

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

Inventive Principle:
Principle #35Parameter changes

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

Engineering Contradiction:
Improveautomated patch generation speedVSAvoidsystem architecture complexity
Core Design Contradiction:
ProductivityVSDevice complexity

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

Inventive Principle:
Principle #6Universality (Multi-functionality)

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

Engineering Contradiction:
Improveautomated bug fixing efficiencyVSAvoidsystem implementation ease
Core Design Contradiction:
ProductivityVSEase of operation

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

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS11775414B2Automated bug fixing using deep learning
Publication Date: 2023.10.03 RAM LABORATORIES INC
  • US11775414B2 patent drawing
  • US11775414B2 patent drawing
  • US11775414B2 patent drawing

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.