Custom API modeling for source code static analysis simulator
First Claim
1. A method for analyzing invocation of an external function for which function source code implementation is not available, comprising the steps of:
- (a) identifying at least one potential error resulting from improper invocation of the external function by source code calling the external function;
(b) identifying at least one condition upon invocation of the external function that will result in the potential error;
(c) creating a model of the external function for which source code is not available to test for the at least one condition that results in the potential error;
(d) associating the model with a source code analyzer such that when the source code which calls the external function is analyzed by the source code analyzer, the model is applied to evaluate invocation of the external function;
(e) generating an error message upon finding the at least one condition upon invocation of the external function;
wherein the model is created using a plurality of primitives usable to test for the at least one condition that results in the potential error; and
wherein the source code analyzer includes a model repository configured to store the model created, such that the source code analyzer can access the model upon evaluating source code and identifying a reference to the external function.
2 Assignments
0 Petitions
Accused Products
Abstract
In processing an external function for which source code is not available, such as an application program interface (API), a model is used to evaluate whether the external function is properly invoked. An error potentially resulting from improper invocation of the external function and at least one condition that will result in the potential error are identified. The model is created to test for the condition that will result in the potential error. When the condition is found, generation of an error message is triggered. The model is associated with a source code analyzer such that when the source code is analyzed by the source code analyzer, the model is applied to evaluate invocation of the external function. The potential error and conditions that result in the error, such as input/output parameter errors and dependency errors, may be derived from documentation describing the operation of the external function or API.
-
Citations
9 Claims
-
1. A method for analyzing invocation of an external function for which function source code implementation is not available, comprising the steps of:
-
(a) identifying at least one potential error resulting from improper invocation of the external function by source code calling the external function; (b) identifying at least one condition upon invocation of the external function that will result in the potential error; (c) creating a model of the external function for which source code is not available to test for the at least one condition that results in the potential error; (d) associating the model with a source code analyzer such that when the source code which calls the external function is analyzed by the source code analyzer, the model is applied to evaluate invocation of the external function; (e) generating an error message upon finding the at least one condition upon invocation of the external function; wherein the model is created using a plurality of primitives usable to test for the at least one condition that results in the potential error; and wherein the source code analyzer includes a model repository configured to store the model created, such that the source code analyzer can access the model upon evaluating source code and identifying a reference to the external function. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A system for analyzing invocation of an external function for which function source code implementation is not available, the system comprising:
-
(a) at least one user input device; (b) a display; (c) a processor in communication with the input device and the display; and (d) a memory in communication with the processor, the memory storing data and machine instructions that cause the processor to carry out a plurality of functions, including; (i) deriving rules to evaluate the invocation and operation of any application programming interface (API) signatures; (ii) including the derived rules with source code which comprises at least one invocation of an external function for which function source code implementation is not available; (iii) identifying at least one potential error resulting from improper invocation of the external function by source code calling the external function; (iv) identifying at least one condition upon invocation of the external function that will result in the potential error; (v) creating a model of the external function to test for the at least one condition that results in the potential error; (vi) associating the model with a source code analyzer such that when the source code which calls the external function is analyzed by the source code analyzer, the model is applied to evaluate invocation of the external function; and (vii) generating an error message upon finding the at least one condition upon invocation of the external function; wherein the model is created using a plurality of primitives usable to test for the at least one condition that results in the potential error; and wherein the source code analyzer includes a model repository configured to store the model created, such that the source code analyzer can access the model upon evaluating source code and identifying a reference to the external function. - View Dependent Claims (7, 8, 9)
-
Specification