Static Fault Detection Using Abstract Syntax Tree Path Analysis
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current fault detection methods in software development, such as static fault analysis, are time-consuming and prone to high false positives, requiring expertise and not effectively improving performance.
Innovation Solution
A new static fault analysis methodology that converts implementation code into Abstract Syntax Trees (ASTs) and represents it as sets of AST paths, using a classifier trained on commit pairs with known faults to detect faults in source code, reducing false positives and improving cost-effectiveness.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If traditional static fault analysis methods are used, then fault detection capability is provided, but the process is time-consuming and produces high false positives
Solution Approach 1:
The patent creates Abstract Syntax Trees (ASTs) as structural copies of the source code, transforming the code into a tree representation that preserves the hierarchical structure and relationships. This copying approach enables efficient analysis by working with the tree structure rather than the original code, reducing analysis time while maintaining detection accuracy
Solution Approach 2:
The patent segments the source code into functions and further into AST paths, breaking down the complex codebase into manageable hierarchical components. This segmentation allows the classifier to process smaller, structured units (AST paths) rather than analyzing entire codebases at once, significantly reducing analysis time
2Reliability
If traditional static fault analysis methods are used, then fault detection is performed, but false positives are high requiring expertise to interpret
Solution Approach 1:
The patent transforms the source code into a different parameter representation (AST paths) with distinct structural characteristics. By changing the representation parameters from linear code text to hierarchical tree paths, the system enables more effective pattern recognition by the classifier, reducing false positives and improving interpretation ease
Solution Approach 2:
The AST serves as an intermediary structure between the source code and the classifier. This intermediate representation captures essential structural relationships while being more amenable to automated analysis, acting as a mediator that translates code into a form that reduces false positives and improves interpretability
3Productivity
If traditional fault detection approaches are used, then basic detection capability is provided, but performance improvement is not effective
Solution Approach 1:
The patent transitions from analyzing code in one dimension (linear text) to multiple dimensions by creating hierarchical AST structures with multiple path representations. This dimensional change from flat code to multi-level tree structures enables the classifier to capture complex patterns more effectively, improving detection performance despite increased methodology complexity
Data Source
AI summary
Approaches presented herein enable fault detection. More specifically, implementation code of one or more functions is identified from source code. The implementation code of the one or more functions is converted to corresponding Abstract Syntax Trees (ASTs). The implementation code of the one or more functions is represented as a first plurality of sets of AST paths over the ASTs. Classification results for the one or more functions are generated with a classifier based on the first plurality of sets of AST paths for the implementation code of the one or more functions. Each of the classification results indicates a probability of having at least one fault in a corresponding function of the one or more functions. Fault detection results of the source code are generated based on the classification results.


