Analysis to check web api code usage and specification
AssigneeInternational Business Machines Corporation
InventorsJulian T. Dolby, Jim A. Laredo, John E. Wittern, Annie T. T. Ying, Yunhui Zheng
Life of this patent
Estimating the term…
Abstract
A debugging tool and method for statically verifying programs that invoke web-based services through API calls is provided. The tool receives source code that comprises one or more invocation of web APIs for requesting web-based services. The tool also receives a set of web API specifications. The tool extracts a set of request information for each web API invocation in the source code, the set of request information including a usage string of an URL endpoint. The tool verifies whether the set of request information complies with the received web API specifications and reports a result of the verification.
Claims24
A method of statically verifying source code, the method comprising:
- identifying an invocation statement in the source code for using a service that is provided by an entity outside of the source code;
- identifying data flow of string variables in the source code that lead to the identified invocation statement;
- assembling one or more usage strings that can be formed at the invocation statement based on the identified data flow of string variables;
- and
- checking each assembled string based on a specification that describes permissible strings.
A method comprising:
- receiving source code comprising one or more invocations of web application programming interface (web API) operative to request one or more web-based services;
- receiving a set of web API specifications;
- extracting a set of request information for each web API invocation in the source code, the set of request information comprising a usage string of a uniform resource locator (URL) endpoint;
- verifying whether the set of request information complies with the received web API specifications;
- and
- reporting a result of the verification.
A computing device comprising:
- a set of one or more processing units;
- a storage device storing a set of instructions, wherein an execution of the set of instructions by the set of processing units configures the computing device to perform acts comprising:
- identifying an invocation statement in source code for using a service that is provided by an entity outside of the source code;
- identifying a data flow of string variables in the source code that leads to the identified invocation statement;
- assembling one or more usage strings that can be formed at the invocation statement based on the identified data flow of string variables;
- and
- checking each assembled string based on a specification for describing permissible strings.
A computing device comprising:
- a set of one or more processing units;
- a storage device storing a set of instructions, wherein an execution of the set of instructions by the set of processing units configures the computing device to perform acts comprising:
- receiving source code comprising one or more invocation of web application programming interface (web API) for requesting web-based services;
- receiving a set of web API specifications;
- extracting a set of request information for each web API invocation in the source code, the set of request information comprising a usage string of an uniform resource locator (URL) endpoint;
- verifying whether the set of request information complies with the received web API specifications;
- and
- reporting a result of the verification.
Dependencies are inferred from the claim text.