Automated Software Repair via AST Sub-tree Isolation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Automated software repair systems face challenges in accurately identifying and isolating primary modifications from secondary modifications in software source code, which can obscure the identification of errors and hinder effective error correction.
Innovation Solution
A method involving the generation of abstract syntax trees (ASTs) for different iterations of source code, identification of sub-trees corresponding to specific changes, and removal of secondary modifications to isolate primary modifications, thereby facilitating error identification and correction.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If automated repair systems analyze all modifications in source code, then comprehensive error detection is achieved, but identification accuracy of primary modifications deteriorates due to noise from secondary modifications
Solution Approach 1:
The patent segments the set of all code modifications into two distinct categories: primary modifications (which introduce or fix errors) and secondary modifications (which do not affect error status). This segmentation is achieved by analyzing multiple iterations of source code and determining which modifications correlate with test pass/fail states. By separating these modification types, the system can focus analysis on primary modifications, improving error detection accuracy while reducing the complexity of analyzing all modifications simultaneously.
Solution Approach 2:
The patent extracts and removes secondary modifications from the analysis set to isolate primary modifications. This is accomplished by comparing source code across multiple iterations and identifying modifications that persist through iterations without changing test outcomes. By taking out secondary modifications that create noise, the system enhances the signal-to-noise ratio for detecting actual errors, thereby improving measurement precision without being overwhelmed by the complexity of all modifications.
2Measurement precision
If multiple iterations of source code are analyzed to identify modifications, then error identification accuracy is improved, but processing time increases
Solution Approach 1:
The patent performs preliminary actions by generating abstract syntax trees (ASTs) for multiple source code iterations in advance and storing them for comparison. This preliminary processing allows the system to quickly identify modifications by comparing pre-generated AST structures rather than parsing code repeatedly during error analysis. By performing these heavy computational tasks beforehand, the system achieves high modification identification accuracy while reducing the time required during actual error detection operations.
Solution Approach 2:
The patent creates copies of source code in the form of abstract syntax trees (ASTs) that represent the code structure in a standardized, comparable format. These AST copies allow for efficient structural comparison across multiple iterations without requiring repeated full code parsing. By working with these copied representations rather than the original source code repeatedly, the system maintains high identification accuracy while significantly reducing processing time during comparative analysis.
3Measurement precision
If secondary modifications are removed from source code, then primary modification identification is enhanced, but information loss occurs about the complete code history
Solution Approach 1:
The patent introduces an intermediary representation called the abstract syntax tree (AST) that preserves the complete structural information of source code across all iterations. Rather than removing secondary modifications from the actual code history, the system uses ASTs as an intermediary layer to analyze and compare code structures. This intermediary representation maintains all modification information while enabling precise identification of primary modifications through structural comparison, thus preserving code history information while achieving accurate error detection.
Solution Approach 2:
The patent extracts only the essential error-relevant information from the complete code history by identifying and isolating primary modifications through AST comparison. Rather than removing secondary modifications from the historical record, the system extracts the subset of modifications that actually affect program behavior and error states. This extraction process preserves the complete code history for reference while focusing analysis on the critical primary modifications, thereby maintaining information integrity while improving detection precision.
Data Source
AI summary
According to an aspect of an embodiment, operations may include generating a first abstract syntax tree with respect to a first iteration of first source code of a first software program and generating a second abstract syntax tree with respect to a second iteration of the first source code. The operations may also include identifying a first sub-tree of the first abstract syntax tree and identifying a plurality of second sub-trees of the second abstract syntax tree. In addition the operations may include generating a first textual representation of the first sub-tree and generating a plurality of second textual representations with respect to the second sub-trees. Moreover, the operations may include modifying the second abstract syntax tree based on the second sub-trees and obtaining a third iteration of the first source code by regenerating the first source code based on the modified second abstract syntax tree.


