Automatic generation of interfaces for optimizing codebases
A plurality of invoking units of software instructions that each directly invoke one or more functions of an invoked unit of software instructions are identified. Based on at least one criterion a first function of the one or more functions is selected for inclusion in an interface. An interfacing unit of software instructions that implements the interface is generated, the interface being configured to be invoked by at least one of the plurality of invoking units of software instructions, and when invoked, to invoke the first function.
1. A method comprising:
obtaining, by a computing system comprising one or more processor devices, codebase information for a codebase of an application that identifies a plurality of units of software instructions included in the codebase of the application;
based at least in part on the codebase information for the codebase of the application that identifies the plurality of units of software instructions, identifying, by the computing system, a plurality of invoking units of software instructions that each directly invoke one or more functions of an invoked unit of software instructions, wherein the plurality of units of software instructions comprises the plurality of invoking units of software instructions and the invoked unit of software instructions;
based on at least one criterion, selecting a first function of the one or more functions of the invoked unit of software instructions for inclusion in an interface; and
generating an interfacing unit of software instructions that implements the interface, wherein the interface is configured to be invoked by at least one invoking unit of software instructions of the plurality of invoking units of software instructions, and when the interface is invoked, to invoke the first function of the one or more functions of the invoked unit of software instructions.
2. The method of claim 1 , wherein the method further comprises providing data descriptive of the interfacing unit of software instructions.
3. The method of claim 2 , wherein providing the data descriptive of the interfacing unit of software instructions comprises providing data descriptive of the interfacing unit of software instructions to a code versioning system for the codebase of the application.
4. The method of claim 3 , wherein the data descriptive of the interfacing unit of software instructions comprises a summarization of the interfacing unit of software instructions.
5. The method of claim 3 , wherein the method further comprises obtaining, from the code versioning system, data indicative of approval of the interfacing unit of software instructions.
6. The method of claim 5 , wherein the method further comprises modifying the codebase of the application to add the interfacing unit of software instructions.
7. The method of claim 1 , wherein obtaining the codebase information for the codebase of the application comprises:
generating an abstract model that identifies the plurality of units of software instructions, wherein the plurality of units of software instructions collectively comprise the codebase of the application; and
based at least in part on the abstract model, identifying the plurality of invoking units of software instructions that each directly invoke the one or more functions of the invoked unit of software instructions.
8. The method of claim 1 , wherein the method further comprises providing data descriptive of modifications that modify the at least one invoking unit of software instructions of the plurality of invoking units of software instructions to invoke the interface.
9. The method of claim 1 , wherein the at least one criterion comprises:
a number of invoking units of software instructions that invoke each function of the one or more functions of the invoked unit of software instructions;
a number of calls to an external unit of software instructions performed by each function of the one or more functions of the invoked unit of software instructions;
a degree of documentation associated with each function of the one or more functions of the invoked unit of software instructions; and/or
a degree of complexity associated with each function of the one or more functions of the invoked unit of software instructions.
10. The method of claim 1 , wherein a plurality of separate files respectively comprise the plurality of invoking units of software instructions; and
wherein a file different than the plurality of separate files comprises the invoked unit of software instructions.
11. The method of claim 1 , wherein a file comprises the invoked unit of software instructions and at least some of the plurality of invoking units of software instructions.
12. A computing system, comprising:
a memory; and
a processor device coupled to the memory to:
obtain codebase information for a codebase of an application that identifies a plurality of units of software instructions included in the codebase of the application;
based at least in part on the codebase information for the codebase of the application that identifies the plurality of units of software instructions, identify a plurality of invoking units of software instructions that each directly invoke one or more functions of an invoked unit of software instructions, wherein the plurality of units of software instructions comprises the plurality of invoking units of software instructions and the invoked unit of software instructions;
based on at least one criterion, select a first function of the one or more functions of the invoked unit of software instructions for inclusion in an interface; and
generate an interfacing unit of software instructions that implements the interface, wherein the interface is configured to be invoked by at least one invoking unit of software instructions of the plurality of invoking units of software instructions, and when the interface is invoked, to invoke the first function of the one or more functions of the invoked unit of software instructions.
13. The computing system of claim 12 , wherein the processor device is further coupled to the memory to provide data descriptive of the interfacing unit of software instructions.
14. The computing system of claim 13 , wherein providing the data descriptive of the interfacing unit of software instructions comprises providing data descriptive of the interfacing unit of software instructions to a code versioning system for the codebase of the application.
15. The computing system of claim 14 , wherein the data descriptive of the interfacing unit of software instructions comprises a summarization of the interfacing unit of software instructions.
16. The computing system of claim 14 , wherein the processor device is further coupled to the memory to obtain, from the code versioning system, data indicative of approval of the interfacing unit of software instructions.
17. The computing system of claim 16 , wherein the processor device is further coupled to the memory to modify the codebase of the application to add the interfacing unit of software instructions.
18. The computing system of claim 12 , wherein, to obtain the codebase information for the codebase of the application, the processor device is further coupled to the memory to:
generate an abstract model that identifies the plurality of units of software instructions, wherein the plurality of units of software instructions collectively comprise the codebase of the application; and
based at least in part on the abstract model, identify the plurality of invoking units of software instructions that each directly invoke the one or more functions of the invoked unit of software instructions.
19. The computing system of claim 12 , wherein the processor device is further coupled to the memory to provide data descriptive of modifications that modify the at least one invoking unit of software instructions of the plurality of invoking units of software instructions to invoke the interface.
20. A non-transitory computer-readable storage medium that stores executable instructions to cause one or more processor devices to:
obtain codebase information for a codebase of an application that identifies a plurality of units of software instructions included in the codebase of the application;
based at least in part on the codebase information for the codebase of the application that identifies the plurality of units of software instructions, identify a plurality of invoking units of software instructions that each directly invoke one or more functions of an invoked unit of software instructions, wherein the plurality of units of software instructions comprises the plurality of invoking units of software instructions and the invoked unit of software instructions;
based on at least one criterion, select a first function of the one or more functions of the invoked unit of software instructions for inclusion in an interface; and
generate an interfacing unit of software instructions that implements the interface, wherein the interface is configured to be invoked by at least one invoking unit of software instructions of the plurality of invoking units of software instructions, and when the interface is invoked, to invoke the first function of the one or more functions of the invoked unit of software instructions.