Static Annotation Analysis for Code Error Detection
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing programming code analysis methods fail to effectively identify and flag errors or performance issues introduced by function calls to sub-functions, particularly in terms of resource allocation, without executing the code, which can lead to performance problems in computer systems.
Innovation Solution
A server computer parses annotated programming code to identify annotations for functions and sub-functions, generating summary reports that flag potential issues, such as memory allocation thresholds, allowing for static analysis without execution, and aggregating information to reduce redundant analysis.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If code analysis is performed by executing the programming code, then detection accuracy of function call errors is improved, but system performance deteriorates and computational resources are consumed
Solution Approach 1:
The patent creates a symbolic execution model that copies and simulates code execution paths without actually running the code. Annotation summaries are generated as copies of function behavior metadata, allowing error detection through analysis of these symbolic representations rather than actual code execution, thus maintaining detection accuracy while reducing computational resource consumption.
Solution Approach 2:
The patent replaces the mechanical execution system with a symbolic analysis system. Instead of physically executing code to detect errors, the system uses annotation summaries and symbolic execution paths to analyze function calls statically, substituting dynamic mechanical execution with static symbolic analysis to reduce resource usage while maintaining detection capability.
2Reliability
If comprehensive code analysis is performed on all functions and sub-functions, then error detection capability is improved, but analysis time increases
Solution Approach 1:
The patent performs preliminary actions by generating annotation summaries that capture essential function behavior metadata before comprehensive analysis is needed. These pre-computed summaries contain information about memory allocation, resource usage, and function characteristics, allowing subsequent error detection to proceed faster by referencing pre-analyzed data rather than performing full analysis each time.
Solution Approach 2:
The patent segments the code analysis process into independent function units, each with its own annotation summary. This segmentation allows the analysis system to focus on specific functions and their call relationships rather than analyzing the entire codebase monolithically, reducing overall analysis time while maintaining comprehensive error detection capability across all functions.
3Reliability
If annotation summaries are generated for each function including all sub-function mappings, then code reliability is improved, but device complexity increases
Solution Approach 1:
The patent extracts essential function behavior information into separate annotation summaries, taking out detailed function metadata from the main code structure. Each annotation summary contains extracted information about memory allocation, resource usage, and sub-function relationships, organizing complexity into isolated, manageable units that improve code reliability without overwhelming the overall system structure.
Data Source
AI summary
Exemplary methods, apparatuses, and systems for analyzing annotated programming code are detailed. For example, in an embodiment, a computer-implemented method comprises parsing code to identify a plurality of functions. For each function in the plurality of functions, the method further comprises determining a first annotation associated with the function and determining a second annotation associated with a first sub-function called by the function. The method further comprises generating an error message in an annotation summary for the function in response to determining that the first annotation associated with the function specifies the function as the first code type and the second annotation associated with the first sub-function called by the function specifies the first sub-function as the second code type.


