Automated Patch Selection Module for APR Systems
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional Automatic Program Repair (APR) systems are inefficient as they require users to manually select from multiple patches, leading to a need for an automated method to determine the most efficient patch among candidates.
Innovation Solution
A method and module that generate and evaluate patches based on code change rate, code complexity, and context similarity, selecting and outputting the patch with the highest final score, which includes calculating scores for code change rate, code complexity, and context similarity to automatically determine the most suitable patch.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If multiple patches are presented to the user for selection, then the user has more options to choose from, but the efficiency of the APR system decreases due to manual selection requirements
Solution Approach 1:
The system automatically evaluates and ranks patches using multiple criteria (code change rate, code complexity, context similarity) without requiring user intervention. The patch selection module autonomously determines the most suitable patch by calculating scores and comparing them against predefined thresholds, enabling the system to serve itself in the selection process.
Solution Approach 2:
The invention transforms the patch selection process by changing evaluation parameters from simple generation to multi-dimensional scoring. It introduces specific parameters (code change rate, code complexity, context similarity) and their corresponding weights to quantitatively assess patches, converting a subjective manual selection into an objective automated evaluation based on parameter optimization.
2Productivity
If automated patch selection is implemented, then system efficiency improves, but the complexity of the selection module increases
Solution Approach 1:
The selection module is divided into distinct functional components: a calculation unit that computes individual scores for each patch based on multiple criteria, and a determination unit that ranks patches based on these scores. This segmentation allows the complex selection process to be broken down into manageable, modular operations that can be independently optimized and maintained.
3Measurement precision
If multiple evaluation criteria are used for patch selection, then the accuracy of patch selection improves, but the calculation time and processing complexity increase
Solution Approach 1:
The system calculates scores for multiple patches simultaneously using parallel evaluation of the three criteria (code change rate, code complexity, context similarity). By performing partial evaluations in parallel and using weighted scoring, it achieves comprehensive assessment without sequentially processing each criterion for every patch, thereby reducing total evaluation time while maintaining accuracy.
Data Source
AI summary
A method of selecting a last patch from among a plurality of patches for a same location according to an embodiment of this invention includes generating a plurality of patches for a same location in a program; calculating a final score based on a code change rate, a code complexity, and a context similarity for each of the plurality of patches.

