Null Pointer Exception Repair with Pattern-Trained Classification
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing program automatic repairing technologies for null pointer exceptions rely heavily on testcases, which may not adequately describe program specifications, leading to the generation of incorrect patches due to testcase bias.
Innovation Solution
A method using a classification model trained on a null processing pattern dataset to generate and validate patches without the need for testcases, employing deep learning or machine learning to identify and replace null pointer exception occurrences.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If testcase-based patch validation is used, then patch correctness can be verified, but testcase bias leads to generation of incorrect patches that only fit specific inputs
Solution Approach 1:
The patent introduces a large language model as an intermediary between the original code and patch validation. Instead of directly relying on testcases, the LLM generates natural language explanations and intermediate representations that bridge the gap, enabling more accurate patch generation that is not biased toward specific test inputs.
Solution Approach 2:
The patent replaces the traditional mechanical testcase execution validation mechanism with an AI-based semantic understanding approach. The LLM analyzes code semantics and generates patches based on understanding rather than brute-force testcase matching, substituting the mechanical validation process with intelligent semantic processing.
2Productivity
If testcases are created for post-validation, then error discovery and repair can proceed, but testcases may not describe sufficient specification leading to wrong patches
Solution Approach 1:
The patent performs preliminary action by having the LLM generate natural language explanations and semantic representations of the code before patch generation. This preliminary semantic analysis captures the complete program specification early in the process, preventing information loss that would otherwise require extensive testcases to compensate for.
3Reliability
If generate and validate scheme is used, then patches can be validated against testcases, but the process repeats patch generation and validation until a passing patch is discovered
Solution Approach 1:
The patent substitutes the repetitive mechanical generate-and-validate loop with an AI-driven semantic analysis approach. The LLM understands the code semantics and directly generates correct patches in fewer iterations, replacing the time-consuming repeated validation process with intelligent semantic processing that achieves validation in a single pass.
Data Source
AI summary
Disclosed is a method for repairing a null pointer exception performed by a computing device including a processor, which includes: obtaining an original program; and obtaining, by using a classification model, a patch program from the original program by repairing an error of the original program; and, in which the classification model may be trained in advance by using a null processing pattern dataset obtained from at least one program.


