Computer-implemented method, system, and computer program product (function result prediction)

JP2023089958A5Pending Publication Date: 2026-01-19INTERNATIONAL BUSINESS MACHINE CORPORATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2022197864
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2021-12-16
Filing Date
2022-12-12
Publication Date
2026-01-19

AI Technical Summary

Technical Problem

In software development, developers face challenges in predicting the output of function calls due to unknown parameters at runtime, leading to unexpected exceptions that are only detected during execution, increasing development time and inefficiency.

Method used

A method and system for obtaining expected results of functions in code files by comparing new function calls to a log of previously executed functions and their responses, allowing for real-time feedback on expected outcomes without executing the functions.

Benefits of technology

This approach reduces development time by providing immediate feedback on function outputs, minimizing the need for extensive testing and debugging, and improving the efficiency of the development process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

To provide a computer-implemented method, system and program for acquiring an expected result of a function of a code file.SOLUTION: A method for writing and checking functions in a code file in interactive development environments includes, in response to determining that a function matches a historical function in a log of previously executed functions and their corresponding execution responses, identifying the execution response corresponding to the matching historical function in the log. The method also includes determining an expected result of the function based on the identified execution response.SELECTED DRAWING: Figure 7
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of code management systems, and more particularly, to systems and methods for describing and checking functions of code files in an interactive development environment.

Background Art

[0002] In software development, functions are created and defined (e.g., named) such that only the name of the function is required each time the function is used, without coding the long form of the function (e.g., each action within the function). To use a function, it is necessary to call that function. When a function is called, the system is instructed to execute the actions of that function. When a function is called, the system can allocate some memory (e.g., function frames and function stacks) for that function call. One function frame is one function call. In some cases, function calls may be nested. In such cases, multiple frames are given to the nested function calls, which form a call stack (i.e., a stack of function frames). In conventional systems, the call stack may follow the last-in, first-out (LIFO) principle, such that the frame of the latest function (i.e., the last frame) is pushed onto the stack and becomes the active frame. In this way, the latest frame is executed first, or processed first, or both. When the function corresponding to the active frame (e.g., the latest frame) is resolved, or executed, or both, the memory associated with the active frame is freed and that frame can be popped from the call stack. As a result, in some cases, a return value may be generated. Popping a frame from the stack is sometimes called unwinding the stack.

Summary of the Invention

[0003] This disclosure aims to provide a method for obtaining the expected results of functions within a code file. [Means for solving the problem]

[0004] The present invention provides a computer implementation method, system, and computer program product for writing and checking functions in code files in an interactive development environment. The method may include identifying the corresponding execution response in a log of previously executed functions and their corresponding execution responses if it determines that a function matches a historical function in the log. The method may also include determining the expected result of the function based on the identified execution response. The system and computer program product may include similar steps.

[0005] The above summary is not intended to describe each illustrated embodiment or all implementations in this disclosure. [Brief explanation of the drawing]

[0006] The drawings included in this application are incorporated herein and constitute part of this specification. These drawings illustrate embodiments of the disclosure and, together with the specification, help to illustrate the principles of the disclosure. The drawings are illustrative of specific embodiments and do not limit the disclosure.

[0007] [Figure 1] Figure 1 shows a cloud computing node according to the present invention. [Figure 2] Figure 2 shows a cloud computing environment according to an embodiment of the present invention. [Figure 3] Figure 3 shows an abstraction model layer according to an embodiment of the present invention. [Figure 4] Figure 4 shows a cloud computing node according to an embodiment of the present invention. [Figure 5] Figure 5 is a simplified schematic diagram of a method for obtaining the expected result of a function in a code file, according to an embodiment of the present invention. [Figure 6] Figure 6 is a simplified schematic diagram of a method for generating a log of a previously executed function and its execution response, according to an embodiment of the present invention. [Figure 7] Figure 7 shows an example of a method for obtaining the expected result of a function in a code file according to an embodiment of the present invention. [Figure 8] Figure 8 shows an example of a method for debugging a code file according to an embodiment of the present invention.

[0008] While various modifications and alternative forms are possible with respect to the present invention, the specific details of the invention will be illustrated and described in detail with reference to the drawings. However, the present invention is not intended to be limited to the specific embodiments described herein. Rather, it is intended to encompass all variations, equivalents, and alternative forms that fall within the spirit and scope of the invention. [Modes for carrying out the invention]

[0009] Several embodiments will be described in more detail with reference to the accompanying drawings illustrating embodiments of the present disclosure. However, the present disclosure can be implemented in various ways and should not be construed as being limited to the embodiments disclosed herein.

[0010] When a developer writes a new line of code that calls a function, that function may have been called previously within the context of that application or test suite, whether in the application or test code. If the parameters passed to the function are dynamic, those parameters are only known at runtime. In other words, at the time the new function call is written, the result of that function call is unknown. In fact, if constant values ​​are passed to a function call as parameters, even if the function has been executed before with the same constant values, the output of that function call may not be known to the user, for example, when a new user accesses the code file.

[0011] It's common for developers who write function calls not to know the exact output of those functions until runtime. If a developer unknowingly passes a parameter to a function that previously caused an exception, they won't be aware of the error until the exception is presented at runtime. Therefore, improved methods are needed for managing and checking functions within code files.

[0012] The present invention aims to provide a method for obtaining expected results of functions in a code file. The present invention also aims to provide a method for generating a log of previously executed functions and their corresponding execution responses. Both methods provide improved means for managing and checking functions in a code file. Such methods may be implemented in a computer. That is, such methods may be implemented in a computer infrastructure having computer executable code embodied on a computer-readable storage medium having programming instructions configured to perform the proposed methods. The present invention further aims to provide a computer program product including computer program code for implementing the proposed concepts when executed on a processor. The present invention further aims to provide a system for obtaining expected results of functions in a code file. The present invention also aims to provide a system for generating a log of previously executed functions and their corresponding execution responses.

[0013] Therefore, a concept may be proposed for obtaining the expected results of functions within a code file, which may be implemented in a centralized or distributed coding system. The expected results of a function may be determined based on past functions in a log of previously executed functions and their corresponding execution responses. By implementing such automatic function result prediction in a code file, it is possible to assist the user in preparing the code file by warning the user of potential exceptions in the function before execution.

[0014] Please note that the drawings are schematic representations only and are not to scale. Also, the same or similar parts may be represented using the same reference numerals throughout the drawings.

[0015] In the context of this application, when embodiments of the present invention constitute a method, such a method should be understood as a process performed by a computer, i.e., a computer-implementable method. Accordingly, the various steps of the method reflect various parts of a computer program, for example, various parts of one or more algorithms.

[0016] Furthermore, in the context of this application, the (processing) system may be a single device or a collection of distributed devices adapted to perform one or more embodiments of the method of the present invention. For example, the system may be a personal computer (PC), a server, or a collection of PCs or servers or both connected via a network such as a local area network or the Internet to collaboratively perform at least one embodiment of the method of the present invention.

[0017] Furthermore, in the context of this application, a system may be a single device or a collection of distributed devices adapted to perform one or more embodiments of the method of the present invention. For example, a system may be a personal computer (PC), a portable computing device (such as a tablet computer, laptop, or smartphone), a set-top box, a server, or a collection of PCs or servers or both connected via a network such as a local area network or the Internet to collaboratively perform at least one embodiment of the method of the present invention.

[0018] The technical features of the present invention generally relate to function prediction, and more specifically, for example, to a method for obtaining the predicted result of a function in a code file accessed by a user. More specifically, embodiments of the present invention provide a concept for obtaining the predicted result of a function in a code file, and this method includes, when it is determined that a function matches a past function in the log of previously executed functions and their corresponding execution responses, identifying the execution response corresponding to the matching past function in the log, and determining the predicted result of the function based on the identified execution response.

[0019] The present invention provides means for obtaining the predicted result of a function based on past cases where similar functions have been executed. Thus, since previous results such as exceptions can be used as the predicted result of newly described functions, the process of describing functions in a code file can be made more efficient. Therefore, the user can adjust the function accordingly. Also, using the predicted result, the user can be made to confirm that the function operates as it is executed.

[0020] In other words, this method provides means for monitoring similar functions that are repeated over time to generate the predicted result of newly input similar functions by utilizing previously confirmed execution results.

[0021] In software development (especially when focusing on specific fields in software development), it is recognized that a given function is often used many times and depends on it. If each similar function has to be tested individually every time it is described, the development time will increase significantly. Therefore, by utilizing the accumulation of execution results of previously executed functions to predict the response to newly described similar functions, the need for such extensive testing can be reduced, and the required development time may be shortened.

[0022] In one embodiment, obtaining the predicted result is performed before the function in the code file is executed. In this way, the predicted result of the function can be obtained without executing the function, thereby enhancing the efficiency of the method.

[0023] In one embodiment, the method further includes generating a visual representation of the predicted result to be provided to the user. In this way, the user can visually receive a warning about the predicted result.

[0024] In a further embodiment, the visual representation of the predicted result is provided in the function within the code file. In this way, the predicted result may be provided to the user in the context of the function, thereby improving the visibility of the predicted result.

[0025] In one embodiment, the method includes identifying a plurality of functions in the code file, for each of the plurality of functions, determining whether the function matches one of the past functions in the log, and when it is determined that one or more of the plurality of functions match one or more of the past functions in the log, identifying one or more execution responses corresponding to any of the matching past functions in the log, and determining one or more predicted results of the plurality of functions based on the identified execution responses. In this way, for the code file, the predicted results of the plurality of functions can be obtained. For example, according to the method, a newly imported code file containing a plurality of functions can be immediately analyzed when opened.

[0026] In one embodiment, the method further includes generating a log over time. In this way, the log may be generated progressively and dynamically over time based on the functions executed by the user.

[0027] In a further embodiment, generating a log includes executing a function, obtaining the execution response to the function, and logging the function as a past function. In a further embodiment, generating a log further includes logging the execution response corresponding to the past function. In a further embodiment, the function is executed in debug mode or test mode.

[0028] In one embodiment, the method further includes obtaining one or more past parameters for executing a past function, and the log further includes such one or more past parameters.

[0029] In a further embodiment, a function in a code file includes one or more parameters for executing the function, and the method further includes comparing the one or more parameters with one or more past parameters and determining, based on the comparison, that the function matches one past function in the log. This improves the accuracy of the prediction results.

[0030] In one embodiment, the method includes receiving a new function in a code file via user input, identifying the execution response corresponding to the matching past function in the log if it is determined that the new function matches a past function in the log, and determining the expected result of the new function based on the identified execution response. In this way, the method can provide a means for dynamically providing expected results when a user writes a new function.

[0031] In one embodiment, a function in a code file includes one or more dependent functions, and the method further includes identifying the execution response corresponding to one or more matching past functions in the log when it is determined that one or more dependent functions match one or more past functions in the log, and predicting the expected result of the function based on the identified execution response. In this way, the expected result of a complex function can be predicted based on the results of one or more previously executed dependent, i.e., simpler functions.

[0032] Embodiments of the present invention provide further concepts for generating logs of previously executed functions and their corresponding execution responses, the method comprising: executing a function; obtaining an execution response to said function; logging said function as a past function; and logging said execution response to said past function.

[0033] In a further embodiment, the method further includes obtaining an expected result for a function in a code file, which includes, if it is determined that the function matches a previous function in a log of previously executed functions and their corresponding execution responses, identifying the execution response corresponding to that matching previous function in the log, and determining the expected result for the function based on the identified execution response.

[0034] Embodiments of the present invention provide a computer program product for obtaining expected results of functions in a code file. The computer program product includes a computer-readable storage medium implementing program instructions, which are executable by a processing unit, and which performs a method that includes determining if a function matches a past function in a log of previously executed functions and their corresponding execution responses, identifying the execution response corresponding to that matching past function in the log, and determining the expected result of the function based on the identified execution response.

[0035] Embodiments of the present invention provide a further computer program product for generating logs of previously executed functions and their corresponding execution responses. The computer program product includes a computer-readable storage medium implementing program instructions, the program instructions being executable by a processing unit, which causes the processing unit to perform a method including executing a function, obtaining an execution response to the function, logging the function as a past function, and logging the execution response corresponding to the past function.

[0036] Embodiments of the present invention provide a concept relating to a processing system comprising at least one processor and the computer program product described above. The at least one processor is adapted to execute the computer program code of the computer program product.

[0037] Embodiments of the present invention provide a system for obtaining expected results of functions in a code file. The system includes a processor configuration configured to perform the steps of: identifying an execution response corresponding to a matching past function in a log of previously executed functions and their corresponding execution responses, when it is determined that a function matches a past function in a log of previously executed functions and their corresponding execution responses; and determining an expected result of the function based on the identified execution response.

[0038] Embodiments of the present invention provide a further system for generating logs of previously executed functions and their corresponding execution responses. The system includes a processor configuration configured to execute a function, obtain an execution response to the function, log the function as a past function, and log the execution response corresponding to the past function.

[0039] While this disclosure includes a detailed description of cloud computing, it should be understood that the implementations of the teachings described herein are not limited to cloud computing environments. Rather, embodiments of this disclosure can be implemented in combination with any other type of computing environment that is currently known or may be developed in the future.

[0040] Cloud computing is a service delivery model that enables convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, network bandwidth, servers, processing, memory, storage, applications, virtual machines, and services) that can be rapidly provisioned and released with minimal administrative effort or interaction with service providers. This cloud model may include at least five characteristics, at least three service models, and at least four deployment models.

[0041] The characteristics are as follows:

[0042] On-demand self-service: Cloud consumers can unilaterally prepare computing power, such as server time and network storage, automatically as needed, without requiring human interaction with service providers.

[0043] Broad network access: Computing power is available over the network and accessible through standard mechanisms. This facilitates utilization by heterogeneous thin or thick client platforms (e.g., mobile phones, laptops, PDAs).

[0044] Resource pooling: A provider's computing resources are pooled and delivered to multiple consumers using a multi-tenant model. Various physical and virtual resources are dynamically allocated and reallocated as needed. Generally, consumers have a sense of location independence because they do not manage or know the exact location of the resources provided. However, consumers may be able to identify the location at a higher level of abstraction (e.g., country, state, data center).

[0045] Rapid Elasticity: Computing power can be prepared quickly and flexibly, allowing it to scale out automatically and immediately, and to be quickly released and scale in immediately. To consumers, the computing power available for preparation often appears unlimited and can be purchased in any quantity at any time.

[0046] Measured Services: Cloud systems leverage metric capabilities at a certain level of abstraction, appropriate for the type of service (e.g., storage, processing, bandwidth, active user accounts), to automatically control and optimize resource usage. Resource usage can be monitored, controlled, and reported, providing transparency to both service providers and consumers.

[0047] The service model is as follows:

[0048] Software as a Service (SaaS): The functionality offered to consumers is the ability to use the provider's applications running on a cloud infrastructure. These applications can be accessed from various client devices via thin client interfaces such as web browsers (e.g., webmail). Consumers do not manage or control the underlying cloud infrastructure, including the network, servers, operating systems, storage, or even individual application functions, except for configuring a limited number of user-specific applications.

[0049] Platform as a Service (PaaS): The functionality offered to consumers is the ability to deploy applications they have created or acquired to cloud infrastructure using programming languages ​​and tools supported by the provider. Consumers do not manage or control the underlying cloud infrastructure, including networks, servers, operating systems, and storage, but they can control the deployed applications and, in some cases, the configuration of their hosting environment.

[0050] Infrastructure as a Service (IaaS): The functionality provided to consumers is the provision of processors, storage, networking, and other basic computing resources that enable consumers to deploy and run any software, including operating systems and applications. Consumers do not manage or control the underlying cloud infrastructure, but they can control the operating system, storage, and deployed applications, and in some cases, partially control certain network components (e.g., host firewalls).

[0051] The deployment model is as follows:

[0052] Private Cloud: This cloud infrastructure is operated exclusively for a specific organization. This cloud infrastructure can be managed by that organization or a third party and can reside on-premises or off-premises.

[0053] Community Cloud: This cloud infrastructure is shared by multiple organizations to support a specific community with common interests (e.g., mission, security requirements, policies, and compliance). This cloud infrastructure can be managed by the organization or a third party and can reside on-premises or off-premises.

[0054] Public Cloud: This cloud infrastructure is provided to a large number of people or large industry groups and is owned by organizations that sell cloud services.

[0055] Hybrid Cloud: This cloud infrastructure combines two or more cloud models (private, community, or public). While maintaining the unique entities of each model, they are bound together by standards or individual technologies to achieve data and application portability (e.g., cloud bursting for load balancing across clouds).

[0056] Cloud computing environments are service-oriented environments that emphasize statelessness, low coupling, modularity, and semantic interoperability. At the core of cloud computing is the infrastructure, which includes a network of interconnected nodes.

[0057] Figure 1 shows a schematic diagram of an example of a cloud computing node. Note that cloud computing node 10 is merely an example of a suitable cloud computing node and is not intended to imply any limitation on the scope or functionality of the embodiments of the present invention described herein. In any case, cloud computing node 10 is capable of implementing, performing, or both of the functions described herein.

[0058] Within the cloud computing node 10 resides a computer system / server 12. The computer system / server 12 can operate with many other general-purpose or dedicated computing system environments or configurations. Examples of well-known computing systems, environments, or configurations, or combinations, that may be suitable for use with the computer system / server 12 include, but are not limited to, personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputer systems, mainframe computer systems, and distributed cloud computing environments that include any of these systems or devices.

[0059] The computer system / server 12 can be described in general terms in relation to computer system executable instructions, such as program modules executed by the computer system. Generally, program modules can include routines, programs, objects, components, logic, data structures, etc., that perform a specific task or implement a specific data type. The computer system / server 12 can be implemented in a distributed cloud computing environment where tasks are executed by remote processing units linked via a communication network. In a distributed cloud computing environment, program modules can be stored in both local and remote computer system storage media, including memory storage devices.

[0060] As shown in Figure 1, the computer system / server 12 within the cloud computing node 10 is shown as a general-purpose computing device. The components of the computer system / server 12 may include (but are not limited to) one or more processors or processing units 16, system memory 28, and a bus 18 connecting various system components such as the system memory 28 to the processor 16.

[0061] Bus 18 represents one or more of several types of bus structures, including memory buses or memory controllers using any of the various bus architectures, peripheral buses, accelerated graphics ports (AGP), and processor or local buses. As a non-exclusive example, such architectures include the Industry Standard Architecture (ISA) bus, Microchannel Architecture (MCA) bus, Expansion ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.

[0062] The computer system / server 12 generally includes various computer system-readable media. Such media can be any available media accessible to the computer system / server 12, and include both volatile and non-volatile media, as well as both removable and non-removable media.

[0063] The system memory 28 may include computer system-readable media as volatile memory (such as RAM 30 or cache memory 32 or both). The computer system / server 12 may further include other removable / non-removable volatile / non-volatile computer system-readable media. As an example only, the storage system 34 may be provided for reading and writing to a non-removable non-volatile magnetic medium (not shown; commonly referred to as a “hard drive”). Also, although not shown, a magnetic disk drive for reading and writing to removable non-volatile magnetic disks (e.g., “floppy disks”) and an optical disk drive for reading and writing to removable non-volatile optical disks (such as CD-ROMs, DVD-ROMs, or other optical media) may be provided. In these examples, each may be connected to the bus 18 by one or more data medium interfaces. As further illustrated and described below, the memory 28 may include at least one program product having a set of program modules (e.g., at least one) configured to perform the functions of embodiments of the present invention.

[0064] As a non-limiting example, a program / utility 40 having a set (at least one) of program modules 42 can be stored in memory 28, as can an operating system, one or more application programs, other program modules, and program data. Each of the operating system, one or more application programs, other program modules, and program data, or any combination thereof, may include an implementation of a network environment.

[0065] The program module 42 generally performs the functions or methods, or both, of the embodiments of the present invention described herein. For example, some or all of the functions of the DHCP client 80 can be implemented as one or more program modules 42. Furthermore, the DHCP client 80 can be implemented as a separate dedicated processor or as one or more processors to provide the functions described herein. In embodiments, the DHCP client 80 performs one or more of the processes described herein.

[0066] Furthermore, the computer system / server 12 can communicate with one or more external devices 14 such as a keyboard, pointing device, or display 24, one or more devices that enable interaction between the user and the computer system / server 12, or any device that enables communication between the computer system / server 12 and one or more other computing devices (e.g., a network card or modem), or a combination thereof. Such communication can be performed via the input / output (I / O) interface 22. In addition, the computer system / server 12 can communicate with one or more networks (such as a local area network (LAN), a general-purpose wide area network (WAN), or a public network (e.g., the Internet), or a combination thereof) via the network adapter 20. As shown in the figure, the network adapter 20 can communicate with other components of the computer system / server 12 via the bus 18. Although not shown in the figure, other hardware components, software components, or both can be used in conjunction with the computer system / server 12. Examples of these include (but are not limited to) microcode, device drivers, redundant processing units, external disk drive arrays, RAID (Redundant Array of Inexpensive Disks or Redundant Array of Independent Disks) systems, tape drives, and data archive storage systems.

[0067] Here, Figure 2 shows an exemplary cloud computing environment 50. As shown in the figure, the cloud computing environment 50 includes one or more cloud computing nodes 10. Local computer devices used by cloud consumers (e.g., PDAs or mobile phones 54A, desktop computers 54B, laptop computers 54C, or automotive computer systems 54N, or a combination thereof) can communicate with these nodes. The nodes 10 can communicate with each other. The nodes 10 can be grouped physically or virtually (not shown) in one or more networks, such as the private, community, public, or hybrid clouds or a combination thereof. This allows the cloud computing environment 50 to provide infrastructure, platforms, or software as a service, or a combination thereof, without requiring cloud consumers to maintain resources on their local computer devices. Note that the types of computer devices 54A-N shown in Figure 2 are merely examples, and it should be understood that the computing nodes 10 and the cloud computing environment 50 can communicate with any type of electronic device via any type of network or network addressable connection (e.g., using a web browser) or both.

[0068] Here, Figure 3 shows a set of functional abstraction layers provided by the cloud computing environment 50 (Figure 2). It should be understood that the components, layers, and functions shown in Figure 3 are merely illustrative, and the embodiments of the present invention are not limited to these. As illustrated, the following layers and corresponding functions are provided.

[0069] The hardware and software layer 60 includes hardware components and software components. Examples of hardware components include a mainframe 61, a reduced instruction set computer (RISC) architecture-based server 62, server 63, blade server 64, storage 65, and a network and network components 66. In some embodiments, the software components include network application server software 67 and database software 68.

[0070] The virtualization layer 70 provides an abstraction layer. From this layer, virtual entities such as virtual servers 71, virtual storage 72, virtual networks 73 including virtual private networks, virtual applications and operating systems 74, and virtual clients 75 can be provided.

[0071] As an example, the management layer 80 can provide the following functions: Resource preparation 81 enables the dynamic procurement of computing resources and other resources used to perform tasks within the cloud computing environment. Metering and pricing 82 enables cost tracking as resources are used within the cloud computing environment and billing or invoicing for the consumption of these resources. As an example, these resources may include licenses for application software. Security enables not only protection of data and other resources but also identification and verification of cloud consumers and tasks. The user portal 83 provides consumers and system administrators with access to the cloud computing environment. Service level management 84 enables the allocation and management of cloud computing resources to ensure that requested service levels are met. Service Level Agreement (SLA) planning and execution 85 enables the pre-arrangement and procurement of cloud computing resources that are expected to be needed in the future in accordance with the SLA.

[0072] Workload layer 90 provides examples of functions available in a cloud computing environment. Examples of workloads and functions available from this layer include mapping and navigation 91, software development and lifecycle management 92, virtual classroom education delivery 93, data analysis processing 94, transaction processing 95, and the forecast function prediction process 96 described herein. In accordance with aspects of the present invention, the workload / function of the forecast function prediction process 96 operates to perform one or more of the processes described herein.

[0073] Figure 4 shows a cloud computing node according to another embodiment of the present invention. In particular, Figure 4 is another cloud computing node that includes the same cloud computing node 10 as in Figure 1. In Figure 4, the computer system / server 12 also includes, or communicates with, a predictive function response client 170 and a predictive function response server 160.

[0074] According to aspects of the present invention, the expected function response client 170 can be implemented as one or more program codes within a program module 42 stored in memory as separate or combined modules. Furthermore, the expected function response client 170 may be implemented as a separate dedicated processor, or as one or more processors, to provide the functionality of these tools. While executing the computer program code, the processing unit 16 can read data, write data, or both to memory, a storage system, or an I / O interface 22 or a combination thereof. The program code performs the processing of the present invention.

[0075] As an example, the predictive function response client 170 may be configured to communicate with the predictive function response server 160 via a cloud computing environment 50. As illustrated with reference to Figure 2, for example, the cloud computing environment 50 may be the Internet, a local area network, a wide area network, a wireless network, or a combination thereof. In embodiments of the proposed predictive function response mechanism, the predictive function response server 160 may provide data to the client 170. As those skilled in the art will understand, the predictive function response client 170 and the predictive function response server 160 may communicate directly. Alternatively, a relay agent may be used as an intermediary to relay messages between the predictive function response client 170 and the predictive function response server 160 via the cloud computing environment 50.

[0076] Figure 5 is a simplified schematic diagram of Method 200 for obtaining the expected result of a function in a code file.

[0077] If function 210 is received or detected in the code file, it may be compared with past functions stored in log 220 of previously executed functions and their corresponding execution responses. If it is determined / detected that the function matches a past function in the log (step 230), the execution response corresponding to that matching past function is identified (step 240).

[0078] Next, the expected result of function 210 may be determined based on the execution response identified for a matching past function (step 250).

[0079] As will be explained in more detail below, logs may be generated over time by recording functions and the results of their execution. If records of past functions and their execution responses exist in the log, when a code file is opened in an interactive development environment (IDE), the code file can be scanned to check whether the functions (and optionally function parameters) contained in the file match any of the past functions listed in the log.

[0080] The IDE may be configured to provide the user with an expected result for a function if any of the functions in the code file match a past function in the log. For example, the IDE may visually display the expected result through an icon in the sidebar or a pop-up.

[0081] In other words, the method may further include generating a visual representation of the expected results to be provided to the user. This visual representation of the expected results may be provided in a function within the code file so that the user can view it within the context of the code file.

[0082] The scanning and matching of functions within a code file can occur while the developer is writing new code. This means that when a user writes a function call that matches a past function in the log, they can immediately receive feedback about the expected response. In other words, they can receive feedback without having to execute the function and search for exceptions, as they can obtain the expected result before executing the function in the code file. To put it another way, when a new function is provided to the code file by user input, this new function can be immediately compared to past functions in the log to determine if any matches exist.

[0083] Therefore, the present invention provides a means to make the development process faster and more efficient for any software development team, by enabling engineers to receive real-time feedback on specific function calls while writing code, without having to perform debugging or testing first.

[0084] When writing a function, it is often necessary for the user to define its parameters. These parameters may be dynamic parameters that change over time or each time the code is executed, or constant parameters that remain constant regardless of the number of times the code is executed.

[0085] According to an exemplary embodiment, the method 200 described above may further include obtaining one or more past parameters for executing a past function. The past parameters may be stored in log 220 along with the past function and its execution response. If a function is provided in a code file and the function includes one or more parameters for its execution, the method may further include comparing the one or more parameters with one or more past parameters and determining, based on the comparison, that the function matches one of the past functions in the log.

[0086] In other words, the comparison of a function with past function logs may be based not only on the function itself, but also on the parameters used to execute the function. This makes the comparison between the function and past functions more accurate, and the predicted results more accurate.

[0087] The method described above may be applied to a single function in a code file, or to multiple functions in a code file. If multiple functions in a code file have not been compared to a log of past functions, the method may further include identifying multiple functions in the code file and determining, for each of the multiple functions, whether the function matches a past function in the log.

[0088] If it is determined that one or more of the multiple functions match one or more past functions in the log, the execution response corresponding to any of the matching past functions in the log may be identified and used to determine the expected results for the multiple matching functions.

[0089] Furthermore, a given function, i.e., a parent function, may contain one or more dependent functions that are called to complete the parent function. If a function in a code file contains one or more dependent functions, the method may further include comparing those dependent functions with a log of past functions.

[0090] If it is determined that one or more dependent functions match one or more past functions in the log, the execution response corresponding to one or more matching past functions may be identified in the log, and the expected result of the function may be predicted based on the identified execution response.

[0091] In other words, based on the execution response obtained from the log, the expected result of executing one or more dependent functions may be determined, and this can be used to predict the result of the parent function.

[0092] In other words, this method can provide a means to determine the expected end result in code that contains back-to-back calls of functions that match past functions found in the log. For example, a function is called on one line of code, and the output of that function is passed as a parameter to a function on the next line. If both functions match past functions in the log, and there is a past function entry in the log using the same parameters, an estimate of the combination of these two function calls can be generated and displayed to the user in the IDE.

[0093] Figure 6 is a simplified schematic diagram of method 300 for generating a log of previously executed functions and their corresponding execution responses. This method may be repeated for each function executed on a system implementing an aspect of the present invention.

[0094] This method first executes function F1 in step 310. Function F1 is logged in log 320 as a past function. In addition to the function, any parameters provided for the execution of the function may also be logged as past parameters. The function may be executed in debug mode or test mode.

[0095] Next, the execution response R1 for the executed function is obtained (step 330) and recorded in log 320 along with the previous function.

[0096] As this process is repeated over time, log 320 accumulates multiple past functions, their corresponding execution responses, and the parameters used to execute those past functions. Therefore, the more functions that are executed, the higher the probability that a new function will match a past function in the log.

[0097] In other words, when a code file is executed in debug mode or as part of an automated test running, the function call stack is continuously recorded in log 320, which is available to the IDE. Recording the function call stack during program execution means that a record is formed of all function calls made during the execution of the program and tests, along with the input parameters for each function.

[0098] Because function records exist in the log, when another code file is opened in the IDE, it can scan the entire code file and check whether any of the functions and parameters contained in the file match any of the past functions listed in the log. If any of the functions match any of the past functions in the log, the IDE can visually display the expected result of that function, derived from the execution results of the matching past function, for example, by an icon in the sidebar or a pop-up display.

[0099] The process of scanning code files and comparing functions against past functions in the log may occur while the developer is writing new code. Therefore, if a developer writes a function call with non-dynamic parameters (such as fixed values ​​or variables assigned fixed values), they can immediately receive feedback about the expected response to that function.

[0100] Next, as described above with reference to Figure 5, or as described later with reference to Figures 7 and 8, you may use logging to determine the expected response to a function present in the code file.

[0101] Figure 7 shows a method 400 as an example of obtaining the expected result of a function in a code file, according to one aspect of the present invention.

[0102] In this method, first, in step 410, the user opens the code file. Next, in step 420, the IDE used to open the code file may scan it to identify functions within the code file. The functions identified in step 420 within the code file may then be compared with past functions in the log in the next step, 430.

[0103] If no match is found between the function in the code file and the past function in the log at step 440, the method proceeds to step 450, and the process may wait for further user input.

[0104] On the other hand, if a match exists between a function in the code file and a past function in the log in step 440, the method may proceed to step 460. In step 460, the line(s) in the code file where the matching function exists are identified. Then, in step 470, the expected result may be returned for the identified line.

[0105] In certain cases, if the parameters passed to a function in the code file match the parameters passed to a past function in the log, a perfect match can be considered found, and the execution response to the past function may be extracted as the expected response.

[0106] The method may then proceed to step 450 and await further user input. If the developer writes a new function, the method may detect user input in step 480. The method may then return to step 420 to identify the new function. Next, the method may repeat the process of cross-referencing the new function with the log to see if the function has been called before with the same parameters. In that case, step 460 is executed again for the new line of code. A valid correspondence between past functions and their execution responses allows for inferring the expected response when writing a new function. That is, by linking such past functions with their associated saved execution responses in the log, a new function can be modeled during development, and that model can be used to predict the expected response to the function under development.

[0107] Figure 8 shows a method 500 as an example of debugging a code file according to one aspect of the present invention.

[0108] This method first starts debugging the code file in step 510. Next, the method proceeds to step 520, waiting for the debugger to call a function. When the function is called by the debugger, it is compared to a previous function in the log (step 530).

[0109] If, in step 540, the method determines that the called function matches a previous function in the log, it may proceed to step 550 and return that previous function and its execution result to the debugger.

[0110] On the other hand, if step 540 determines that there is no match between the called function and past functions in the log, the method proceeds to step 560, where the called function may be added to the log as a past function for future reference. Furthermore, a pointer to the output of the called function is generated. This pointer is returned to the debugger in step 570. This allows the debugger to retrieve the execution result when the function is executed and add it to the log along with past functions for future reference.

[0111] Next, the method may return to step 520 and be repeated for each function the debugger calls.

[0112] For further illustration, a simple embodiment of the method of the present invention is shown below.

[0113] In this example, the developer is tasked with writing a function to retrieve the total amount of disk space available on a number of servers in a given region. The developer writes a new, untested function (get_disk_space_europe()). This function utilizes two well-tested functions (get_servers(region)) and (disk_space(server)). These two functions each have multiple entries in the log with different associated arguments, return values, and frames.

[0114] In this example, in a previous execution of the function (get_servers(region)), (Europe) was passed to the function as an argument, and the function generated a list of 10 European servers. In this example, all the servers in the list returned from the function call described above have been previously tested as arguments to the function disk_space, and this information is stored in the backend.

[0115] By transposing a function call to its past return value, developers can be presented with an expected return value when writing such a function, even if the function's execution may take a considerable amount of time and it has never been executed before. After transposition, in this example, the function (get_disk_space_europe()) would simply add 10 numbers to the list of European servers. This can be done quickly in the background, generating insights at the IDE level and displaying them to the developer.

[0116] In this example, the function used may be non-deterministic and depends on an API call whose return value changes based on the server state. If there is a discrepancy in the return value from a stored frame entry (the frame entry is otherwise identical), it can be inferred that such a change has occurred, and this information can be displayed to the user if necessary.

[0117] As an extension of this embodiment, in addition to providing a predicted response value for a new function in a fraction of the time it takes to run the function, additional metrics (such as historical moving averages) related to the execution of a matching past function may also be provided.

[0118] For example, the developer mentioned above could write a function like (get_disk_space_europe) to start tracking disk usage over time in a particular region. By using the method described above, the expected result returned to the developer can effectively execute this new function retrospectively and efficiently using frame data in persistent storage (i.e., logs). This provides the developer with a series of historical values ​​(e.g., with a trend) over time before executing the function.

[0119] The method of the present invention described above can facilitate efficient development while minimizing computationally or otherwise costly function execution by using past results as accurate or best-case approximations. In this way, the method of the present invention reduces development costs (by reducing the need for API calls), reduces the time required to write mock tests, improves the feasibility of development in air-gapped or offline environments, and allows developers to correct logical errors in code if the expected response return value differs significantly from the developer's expectations.

[0120] Those skilled in the art should understand that, in embodiments of the present invention, the proposed concept offers numerous advantages over conventional predictive approaches for predicting function results. These advantages include, but are not limited to, the ability to efficiently and accurately identify the predicted result of a function based on a log of past functions and their corresponding execution responses.

[0121] As a further advantage over technical challenges, the systems and processes described herein provide a computer implementation method for efficiently predicting predictive function results. This method may be provided over (or via) a distributed communication network. In this case, a computer infrastructure such as the computer systems shown in Figures 1 and 4, or a cloud environment as shown in Figure 2, can be provided, and one or more systems for performing the processes of the present invention can be acquired (e.g., created, purchased, used, modified, etc.) and deployed on the computer infrastructure. In this regard, the deployment of the system may include one or more of the following:

[0122] (i) Installing program code from a computer-readable medium onto a computing device such as the computer system shown in Figure 1. (ii) Adding one or more computing devices to the computer infrastructure, more specifically to the cloud environment, and (iii) To incorporate or modify one or more existing systems of a computer infrastructure, or both, so that the computer infrastructure can perform the processes of the present invention.

[0123] While various embodiments of the present invention have been described as examples, they are not intended to be exhaustive or limit the invention to these embodiments. As will be apparent to those skilled in the art, many modifications and variations are possible without departing from the scope and spirit of each embodiment described. The terminology used herein has been selected to best describe the principles, practical applications, or technical improvements to the technology observed in the market of each embodiment, or to enable those skilled in the art to understand each embodiment disclosed herein.

[0124] This disclosure may be an integrated system, method, or computer program product or combination thereof at any possible level of technical detail. The computer program product may include a computer-readable storage medium storing computer-readable program instructions for causing a processor to perform aspects of this disclosure.

[0125] A computer-readable storage medium can be a tangible device capable of holding and storing instructions used by an instruction execution device. Examples of computer-readable storage media may include electronic storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or appropriate combinations thereof. More specific examples of computer-readable storage media include portable computer diskettes, hard disks, RAM, ROM, EPROM (or flash memory), SRAM, CD-ROM, DVD, memory stick, floppy disk, punch cards, or grooved raised structures, as well as mechanically encoded devices on which instructions are recorded, and appropriate combinations thereof. The computer-readable storage media used herein should not be interpreted as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses passing through optical fiber cables), or electrical signals transmitted through wires.

[0126] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computer device / processor. Alternatively, they can be downloaded to an external computer or external storage device via a network (e.g., the Internet, LAN, WAN, or wireless network, or a combination thereof). The network may include copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers or edge servers, or a combination thereof. A network adapter card or network interface within each computer device / processor receives computer-readable program instructions from the network and transfers them for storage in a computer-readable storage medium in the respective computer device / processor.

[0127] The computer-readable program instructions for performing the operations of this disclosure may be assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, configuration data for integrated circuits, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk and C++, and procedural programming languages ​​such as the C programming language or similar programming languages. The computer-readable program instructions are executable as a standalone software package, either entirely on the user's computer or partially on the user's computer. Alternatively, they may be executable partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer may be connected to the user's computer via any type of network, including LANs and WANs, or it may be connected to an external computer (for example, via the Internet using an Internet service provider). In some embodiments, electronic circuits, including, for example, programmable logic circuits, field-programmable gate arrays (FPGAs), and programmable logic arrays (PLAs), can execute computer-readable program instructions by utilizing state information of computer-readable program instructions in order to customize the electronic circuits for the purpose of performing aspects of the present disclosure.

[0128] Embodiments of the Disclosure described herein are explained with reference to flowcharts or block diagrams, or both, of methods, apparatus (systems), and computer program products according to embodiments of the Disclosure. Each block in a flowchart or block diagram, and any combination of blocks in a flowchart or block diagram, are executable by computer-readable program instructions.

[0129] The above computer-readable program instructions can be provided to a processor of a computer or other programmable data processing device to produce a machine. This creates a means for these instructions, executed via such computer or other programmable data processing device processor, to perform functions / operations identified in one or more blocks in a flowchart or block diagram, or both. The above computer-readable program instructions can further be stored in a computer-readable storage medium that can be instructed to function in a particular manner to a computer, programmable data processing device, or other device, or a combination thereof. Thus, the computer-readable storage medium on which the instructions are stored constitutes a product containing instructions for performing functions / operations identified in one or more blocks in a flowchart or block diagram, or both.

[0130] Alternatively, a computer execution process may be generated by loading computer-readable program instructions into a computer, another programmable device, or other device, and having a series of operational steps executed on that computer, other programmable device, or other device. This ensures that the instructions executed on the computer, other programmable device, or other device perform functions / operations identified in one or more blocks in a flowchart, block diagram, or both.

[0131] The flowcharts and block diagrams in the drawings of this disclosure illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of instructions containing one or more executable instructions for performing a particular logical function. In some other implementations, the functions shown within a block may be executed in an order different from the order shown in each figure. For example, two consecutively shown blocks may actually be achieved as a single process, executed simultaneously or nearly simultaneously, executed in a partially or entirely overlapping manner in time, or, in some cases, executed in reverse order, depending on the functions involved. Each block in a block diagram or flowchart or both, and combinations of multiple blocks in a block diagram or flowchart or both, are executable by a dedicated hardware-based system that performs a particular function or operation, or executes a combination of dedicated hardware and computer instructions.

[0132] While various embodiments of this disclosure have been described as examples, they are not intended to be exhaustive or limit the scope to these embodiments. As will be apparent to those skilled in the art, many modifications and variations are possible without departing from the scope and spirit of each embodiment described. The terminology used herein has been selected to best describe the principles, practical applications, or technical improvements to the technologies found in the market of each embodiment, or to enable those skilled in the art to understand each embodiment disclosed herein.

Claims

1. 1. A computer-implemented method for obtaining expected results of a function in a code file, comprising: If it is determined that the function matches a past function in the log of previously executed functions and their corresponding execution responses, identifying execution responses corresponding to the matching past functions in the log; determining an expected outcome of the function based on the identified execution response; Including, Computer-implemented methods.

2. determining the expected result occurs prior to executing the function in the code file; The computer-implemented method of claim 1 .

3. generating a visual representation that provides the predicted results to a user. The computer-implemented method of claim 1 .

4. the visual representation of the predicted outcome is provided in the function within the code file; The computer-implemented method of claim 3 .

5. There is a plurality of functions, the plurality of functions including a first function and a second function in the code file, and there are one or more past functions in the code file, and the method further comprises: determining whether the first function and the second function match at least one of the one or more past functions in the log; When it is determined that the first function and the second function match at least one of the one or more past functions in the log, and one or more matching past functions are identified, identifying one or more execution responses corresponding to the one or more matching past functions in the log; determining an expected outcome of one or more of the plurality of functions based on the identified one or more execution responses; further comprising: The computer-implemented method of claim 1 .

6. generating the log over time. The computer-implemented method of claim 1 .

7. The method further includes generating the log, wherein generating the log comprises: Executing a function, obtaining an execution response to the function; and recording the function in the log as the past function. The computer-implemented method of claim 1 .

8. generating the log further includes recording the execution responses corresponding to the past functions in the log. The computer-implemented method of claim 7.

9. The function is Debug mode, or Runs in test mode, 9. The computer-implemented method of claim 8.

10. The method further includes obtaining one or more historical parameters for performing the historical function; the log further includes the one or more historical parameters. The computer-implemented method of claim 1 .

11. The function in the code file includes one or more parameters for executing the function, and the method includes: comparing the one or more parameters to the one or more historical parameters; determining, based on the comparison, that the function matches the past function in the log; further comprising: The computer-implemented method of claim 10.

12. accepting a new function in the code file via user input; When it is determined that the new function matches a second past function in the log and the matching second past function is identified, identifying an execution response corresponding to the matching second past function in the log; determining an expected outcome of the new function based on the identified execution response; and further comprising: The computer-implemented method of claim 1 .

13. The function in the code file includes one or more dependent functions; The method comprises: If it is determined that the one or more dependent functions match one or more past functions in the log, identifying execution responses corresponding to the one or more matching past functions in the log; predicting an expected outcome of the function based on the determined execution response; and further comprising: The computer-implemented method of claim 1 .

14. 1. A system including one or more computer processors, the system comprising: If the function determines that it matches a previous function in the log of previously executed functions and their corresponding execution responses, Identifying execution responses corresponding to the matching past functions in the log; and determining an expected outcome of the function based on the identified execution response. system.

15. There is a plurality of functions, the plurality of functions including a first function and a second function in a code file, and one or more past functions are present in the code file, and the system further comprises: determining whether the first function and the second function match at least one of the one or more past functions in the log; When it is determined that the first function and the second function match at least one of the one or more past functions in the log, and one or more matching past functions are identified, identifying one or more execution responses corresponding to the one or more matching past functions in the log; and determining an expected outcome of one or more of the plurality of functions based on the determined one or more execution responses. The system of claim 14.

16. further configured to generate the log over time. The system of claim 14.

17. The system is further configured to generate the log, wherein generating the log comprises: Executing a function, obtaining an execution response to the function; and recording the function in the log as the past function.

17. The system of claim 16.

18. A computer program including program instructions executable by a server, the program instructions comprising: If the function determines that it matches a previous function in the log of previously executed functions and their corresponding execution responses, identifying execution responses corresponding to the matching past functions in the log; determining an expected outcome of the function based on the identified execution response; performing a method including Computer program.

19. There is a plurality of functions, the plurality of functions including a first function and a second function in a code file, and one or more past functions are present in the code file, and the method further comprises: determining whether the first function and the second function match at least one of the one or more past functions in the log; When it is determined that the first function and the second function match at least one of the one or more past functions in the log, and one or more matching past functions are identified, identifying one or more execution responses corresponding to the one or more matching past functions in the log; determining an expected outcome of one or more of the plurality of functions based on the identified one or more execution responses; further comprising:

19. A computer program according to claim 18.

20. The method further includes generating the log over time.

19. A computer program according to claim 18.