The invention relates generally to computer software development, and more particularly, to a software debugger that is activated to provide program debug data when certain Key Performance Indicators (KPIs) of a software program meet established criteria.
An important step in the process of developing computer software is program debugging. Debugging refers to the identification and removal of errors within a software program, which can be costly and time consuming, depending on the complexity of the software being developed. Accordingly, software debug tools, commonly referred to as debuggers, have been developed to reduce the debug cycle time.
A software debugger typically executes as a self-contained process for controlling the application program under test through operating system primitives designed for that purpose. The debugging application provides utilities to assist a programmer in locating and correcting program errors. For instance, most debuggers provide control functions for stepping through the executing code of a program, monitoring the status of input/output ports, and for monitoring and modifying the contents of memory locations and central processing unit registers.
The debugging application also allows a software developer to set a breakpoint against a line of code in a program under test, which causes the execution of the program to pause when it reaches the target line of code. During the pause, program state data like the contents of the program variables, local storage and system registers may be examined by the developer to identify potential errors in the code. This is very useful when a developer or tester is interested in the program state around pre-determined lines of code. However, a breakpoint utility is not helpful when a run-time error exists in the program and the developer does not know the approximate lines of code that might cause the run-time problem. As a result, the developer cannot rely on breakpoints to pause the execution of the program and look for a possible cause of the error in the source code of the program.
From the foregoing, it is appreciated that there still exists a need for activating a program debugger during execution without having to know an approximate location for setting a code breakpoint as currently practiced.
In accordance with aspects of the invention, an exemplary embodiment of a method, system and computer program product for debugging a computer program is described. The method comprises establishing target values for one or more Key Performance Indicators related to the performance of the program, enabling a debugger coupled to the program, and activating the debugger when a Key Performance Indicator reaches its established target value during execution of the program.
The details of the preferred embodiments of the invention, both as to its structure and operation, are described below in the Detailed Description section in reference to the accompanying drawings. The Summary is intended to identify key features of the claimed subject matter, but it is not intended to be used to limit the scope of the claimed subject matter.
The invention relates to a method, system and computer program product for activating a software debugger during the execution of a program when a key performance indicator of the program meets certain desired criteria. The execution of the program is paused and enters a debug mode during which a software developer may examine system and program data relating to the program execution at the time when the key performance indicator reached its target value and triggered the debugger.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a method, system or computer program product. Accordingly, aspects of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module” or “system.” Furthermore, aspects of the present invention may take the form of a computer program product embodied in one or more computer readable medium(s) having computer readable program code embodied thereon.
Any combination of one or more computer readable medium(s) may be utilized. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider).
Aspects of the present invention are described below with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer readable medium that can direct a computer, other programmable data processing apparatus, or other devices to function in a particular manner, such that the instructions stored in the computer readable medium produce an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures described below illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Referring now to the drawings and in particular to
With reference now to
The Key Performance Indicator store 217 maintains information about key performance indicators of the application program 214 that are of interest to the user. This information includes relevant indicator parameters and predetermined performance criteria that would trigger the program debugger 213 when the particular indicator meets the established criteria. In the exemplary embodiments of the invention, the Key Performance Indicator store 217 includes, for each performance indicator of interest, an indicator name, a normal operating range and a target value that the program debugger would be activated when the indicator reaches the target value. An example of the type of information associated with some key performance indicators is described below with reference to
The program debugger 301 further communicates with a user interface 311 through which a user may specify one or more performance indicators of interest that relate to the execution of the program. These performance indicators might include, among others, system resource measurements and the transactions and processes being handled by the program 304. As examples, the key performance indicators might relate to the processor's throughput (CPU usage), system memory usage, cache utilization, as well as the numbers of data queries, transactions, client requests and server responses processed by the program 304.
In addition, the user interface 311 allows the user to examine contents of the debugged program's variables, memory state and particular lines in the source code of the program 304 for identifying potential causes of program code defects. Through the interface 311, the user may further control the execution of the program 304 using common debug functions such as setting breakpoints in the source code of the program 304, and forwarding or rewinding the execution. Further details on an exemplary user interface 311 are described below with reference to
Referring now to
At block 512, the program debugger is enabled to run in the background of the system while the program under test is being executed. The debugger might be in an inactive mode for some period of time while the program instructions are processed by the computer, as shown in block 513. The debugger continues in this inactive loop as long as no Key Performance Indicator meets its set target criteria, as determined in block 514. When one of the identified Key Performance Indicators meets its target value, the program debugger is triggered and pauses the execution of the program, at block 515. The process next enters a debug mode during which a user could examine a snapshot of the program in its execution state in system memory, per block 516. Using a debugger interface like the one described in
In debug mode, the user could execute selected lines of code in the program, re-execute a portion of the code, or continue with the program execution starting from the point in the program where the execution was last paused. A forward mode is shown in block 517 where the program execution is unpaused by the debugger and allowed to run for a period of time as specified by the user (block 520). In the rewind mode shown by block 518, the execution is unpaused by the debugger and the program is re-executed for a time period as specified by the user (block 521). Another option available to the user is to resume the execution of the program starting from the location in the program code where the debugger was activated, as shown by block 519. At that point, the debugger returns to its inactive state, per block 513.
A window 612 of the exemplary user interface screen 610 displays a trace of the program's running threads and memory stacks at the point when one of the Key Performance Indicators reached its target value. Further details of the window 612 are illustrated in
The subject matter described above is provided by way of illustration only and should not be construed as limiting. Various modifications and substitutions of the described components and operations can be made by those skilled in the art without departing from the spirit and scope of the present invention defined in the following claims, the scope of which is to be accorded the broadest interpretation so as to encompass such modifications and equivalent structures. As will be appreciated by those skilled in the art, the systems, methods, and procedures described herein can be embodied in a programmable computer, computer executable software, or digital circuitry. The software can be stored on computer readable media. For example, computer readable media can include a floppy disk, RAM, ROM, hard disk, removable media, flash memory, a “memory stick”, optical media, magneto-optical media, CD-ROM, etc.