摘要 |
A method and apparatus for static analysis of program code. Embodiments of the invention allow for detection of run time bugs that may arise during the execution of a software application by implementing data structures that represent an image of the program and its variables in various execution instances. The invention is comprised of a context graph that represents various execution paths that are constructed from a series of related contexts. A context is a node in the context graph that represents the value of variables, state of methods, and the relationship between those variables and methods at an execution instance. The edges connecting the nodes represent one method calling the other, establishing a path of execution. Embodiments of the invention simplify the execution paths of large and complex programs into a context graph, using certain approximation and generalizations in analyzing the class files of a program. A context graph once developed can be queried for the status of different nodes and the relationship of those nodes at a certain instance of execution. Embodiments of the invention scale well to larger program codes, as they statistically represent information regarding various execution possibilities that are critical for analyzing the program, excluding any unnecessary details.
|