US-12619478-B2 - Automatically identifying application programming interfaces based on application artifacts
Abstract
One or more application programming interfaces to be implemented for an application are automatically identified. The automatically identifying includes determining within the application one or more artifacts to be implemented as the one or more application programming interfaces. For an artifact of the one or more artifacts, one or more requests of the artifact are determined. The one or more requests are part of an application programming interface signature for an application programming interface identified based on the artifact. For an application programming interface identified based on the artifact, one or more definitions are generated. The one or more definitions include one or more definitions for the one or more requests of the artifact.
Inventors
- Vini Kanvar
- Srikanth Govindaraj Tamilselvam
- Keerthi Narayan RAGHUNATH
- Alex Mathai
- Saravanan Krishnan
Assignees
- INTERNATIONAL BUSINESS MACHINES CORPORATION
Dates
- Publication Date
- 20260505
- Application Date
- 20230302
Claims (20)
- 1 . A computer-implemented method of facilitating processing within a computing environment, the computer-implemented method comprising: automatically identifying, using a computing device of the computing environment, one or more application programming interfaces to be implemented for an application, wherein the automatically identifying includes determining within the application one or more artifacts to be implemented as the one or more application programming interfaces; determining, for an artifact of the one or more artifacts, one or more requests of the artifact, the one or more requests being a part of an application programming interface signature for an application programming interface identified based on the artifact, and wherein the determining the one or more requests of the artifact includes automatically selecting, based on a control flow of the application and a type of program calls of the application, an analysis technique to be used to determine the one or more requests, wherein the analysis technique is automatically selected from a set of analysis techniques including a static with call chain analysis technique and a static without call chain analysis technique; performing byte alignment on code of a code block of the artifact to identify how information is to be transferred between the application and the application programming interface; and generating, for the application programming interface identified based on the artifact, one or more definitions, the one or more definitions including one or more request definitions for the one or more requests of the artifact.
- 2 . The computer-implemented method of claim 1 , further comprising determining for the artifact one or more responses of the artifact, and wherein the one or more definitions include one or more response definitions for the one or more responses.
- 3 . The computer-implemented method of claim 1 , wherein the artifact is one artifact selected from a group of artifacts consisting of transactions, screens, procedures, data access, rules and program calls.
- 4 . The computer-implemented method of claim 1 , further comprising refactoring by executing program instructions stored in memory, calling code of the application to modify the application to call the one or more application programming interfaces instead of original code of the application.
- 5 . The computer-implemented method of claim 1 , further comprising identifying, for the artifact, code to be exposed for the application programming interface identified based on the artifact, and wherein the determining includes determining, based on the code, the one or more requests and one or more responses for the artifact.
- 6 . The computer-implemented method of claim 5 , wherein the determining the one or more responses comprises selecting, based on the control flow of the application, a technique to be used to determine the one or more responses.
- 7 . The computer-implemented method of claim 6 , wherein the determining the one or more responses further comprises using the technique to automatically determine the one or more responses.
- 8 . The computer-implemented method of claim 6 , wherein the technique includes the static with call chain analysis technique based on the application having a defined type of program calls.
- 9 . The computer-implemented method of claim 6 , wherein the technique includes the static without call chain analysis technique based on the application having a determined type of program calls.
- 10 . The computer-implemented method of claim 1 , further comprising: determining one or more arguments of a calling program defined from the application; determining one or more parameters of artifact code of at least one artifact of the one or more artifacts; and performing byte alignment between the one or more arguments and the one or more parameters to align the calling program and a called program that includes the artifact code.
- 11 . The computer-implemented method of claim 1 , further comprising, based on performing the selected analysis technique, determining, for the artifact, one or more responses of the artifact, and wherein the determining the one or more requests comprises using a liveness analysis to identify variables that are read without a preceding write, and wherein the determining the one or more responses includes using a reaching definitions analysis to identify variables that are written and read after return from a path of the application programing interface.
- 12 . A computer system for facilitating processing within a computing environment, the computer system comprising: a memory; and a computing device in communication with the memory, wherein the computer system is configured to perform a method, said method comprising: automatically identifying, using the computing device, one or more application programming interfaces to be implemented for an application, wherein the automatically identifying includes determining within the application one or more artifacts to be implemented as the one or more application programming interfaces; determining, for an artifact of the one or more artifacts, one or more requests of the artifact, the one or more requests being a part of an application programming interface signature for an application programming interface identified based on the artifact and wherein the determining the one or more requests of the artifact includes automatically selecting, based on a control flow of the application and a type of program calls of the application, an analysis technique to be used to determine the one or more requests, wherein the analysis technique is automatically selected from a set of analysis techniques including a static with call chain analysis technique and a static without call chain analysis technique; performing byte alignment on code of a code block of the artifact to identify how information is to be transferred between the application and the application programming interface; and generating, for the application programming interface identified based on the artifact, one or more definitions, the one or more definitions including one or more request definitions for the one or more requests of the artifact.
- 13 . The computer system of claim 12 , wherein the method further comprises determining for the artifact one or more responses of the artifact, and wherein the one or more definitions include one or more response definitions for the one or more responses.
- 14 . The computer system of claim 12 , wherein the method further comprises refactoring, by executing program instructions stored in memory, calling code of the application to modify the application to call the one or more application programming interfaces instead of original code of the application.
- 15 . The computer system of claim 12 , wherein the method further comprises identifying, for the artifact, code to be exposed for the application programming interface identified based on the artifact, and wherein the determining includes determining, based on the code, the one or more requests and one or more responses for the artifact.
- 16 . A computer program product for facilitating processing within a computing environment, the computer program product comprising: one or more computer readable storage media and program instructions collectively stored on the one or more computer readable storage media to perform a method comprising: automatically identifying, using a computing device of the computing environment, one or more application programming interfaces to be implemented for an application, wherein the automatically identifying includes determining within the application one or more artifacts to be implemented as the one or more application programming interfaces; determining, for an artifact of the one or more artifacts, one or more requests of the artifact, the one or more requests being a part of an application programming interface signature for an application programming interface identified based on the artifact, and wherein the determining the one or more requests of the artifact includes automatically selecting, based on a control flow of the application and a type of program calls of the application, an analysis technique to be used to determine the one or more requests, wherein the analysis technique is automatically selected from a set of analysis techniques including a static with call chain analysis technique and a static without call chain analysis technique; performing byte alignment on code of a code block of the artifact to identify how information is to be transferred between the application and the application programming interface; and generating, for the application programming interface identified based on the artifact, one or more definitions, the one or more definitions including one or more request definitions for the one or more requests of the artifact.
- 17 . The computer program product of claim 16 , wherein the method further comprises determining for the artifact one or more responses of the artifact, and wherein the one or more definitions include one or more response definitions for the one or more responses.
- 18 . The computer program product of claim 16 , wherein the method further comprises refactoring, by executing program instructions stored in memory, calling code of the application to modify the application to call the one or more application programming interfaces instead of original code of the application.
- 19 . The computer program product of claim 16 , wherein the method further comprises identifying, for the artifact, code to be exposed for the application programming interface identified based on the artifact, and wherein the determining includes determining, based on the code, the one or more requests and one or more responses for the artifact.
- 20 . The computer program product of claim 19 , wherein the determining the one or more responses comprise selecting, based on the control flow of the application, a technique to be used to determine the one or more responses.
Description
BACKGROUND One or more aspects relate, in general, to facilitating processing within a computing environment, and in particular, to facilitating processing relating to computer applications. A computer application, also referred to as an application, computer program or program, as examples, may be written as a monolithic application that is designed as a single service, or as a modular application that is designed as multiple services. A monolithic application is a single application that may include multiple functions encapsulated as one application, while a modular application includes a plurality of independent modules that may be independently used, maintained and/or replaced. At times, a monolithic application is converted into a modular application. As an example, a monolithic application is refactored into a microservices application, in which the microservices application is arranged as a collection of loosely coupled independent services that communicate through lightweight protocols. As part of the refactoring, new application programming interfaces (APIs) are to be identified to enable users to employ the independent modules. For monolithic applications written in certain programming languages, such as COBOL, as well as others, identifying the application programming interfaces is difficult, since, for example, the program file names may not carry semantic meaning and functions are invoked through common data structures. SUMMARY Shortcomings of the prior art are overcome, and additional advantages are provided through the provision of a computer-implemented method of facilitating processing within a computing environment. The computer-implemented method includes automatically identifying, using a computing device of the computing environment, one or more application programming interfaces to be implemented for an application. The automatically identifying includes determining within the application one or more artifacts to be implemented as the one or more application programming interfaces. For an artifact of the one or more artifacts, one or more requests of the artifact are determined. The one or more requests are part of an application programming interface signature for an application programming interface identified based on the artifact. For the application programming interface identified based on the artifact, one or more definitions are generated. The one or more definitions include one or more request definitions for the one or more requests of the artifact. Computer systems and computer program products relating to one or more aspects are also described and claimed herein. Further, services relating to one or more aspects are also described and may be claimed herein. Additional features and advantages are realized through the techniques described herein. Other embodiments and aspects are described in detail herein and are considered a part of the claimed aspects. BRIEF DESCRIPTION OF THE DRAWINGS One or more aspects are particularly pointed out and distinctly claimed as examples in the claims at the conclusion of the specification. The foregoing and objects, features, and advantages of one or more aspects are apparent from the following detailed description taken in conjunction with the accompanying drawings in which: FIG. 1 depicts one example of a computing environment to incorporate and use one or more aspects of the present invention; FIG. 2 depicts one example of sub-modules of an application programming interface identification module of FIG. 1, in accordance with one or more aspects of the present invention; FIG. 3 depicts one example of an application programming interface identification process, in accordance with one or more aspects of the present invention; FIG. 4 depicts one example of an overview of using static analysis to determine requests/responses of a code block, in accordance with one or more aspects of the present invention; FIG. 5 depicts one example of further details of using static analysis to determine requests/responses of a code block, in accordance with one or more aspects of the present invention; and FIGS. 6A-6B depict one example of using one or more aspects of the present invention. DETAILED DESCRIPTION In accordance with one or more aspects, a capability is provided to facilitate processing within a computing environment. In one or more aspects, the capability includes identifying application programming interfaces (APIs) to be implemented for an application based on one or more identified artifacts of the application. As examples, the artifacts include transactions, procedures, inter-microservices calls, output from application insight or design tools, rules (e.g., business rules, standards, other rules, etc.), screens, client requirements, external applications and/or data access, etc. Additional, fewer and/or other artifacts may be identified. In one or more aspects, the application programming interfaces to be implemented for an application are i