Associating probes with test cases

A probe (hereinafter also referred to as a breakpoint) can be added into source code of an application program. The probe can be exported to a file or any other form of storage. The probe is then associated with a unique test case for the application program thereby creating a direct mapping between the application program and the test case for the application program. In one embodiment, the probe can be added to at least one of a function or module of the application program.

BACKGROUND

The present disclosure relates to the field of software testing and, more particularly, to associating probes (e.g., breakpoint) with test cases.

Inventors have realized that in the current scenario analyses of code is time consuming. This is especially true if no or inadequate documentation is available. Further, the users analyzing a given functionality in, for example, an application program may not be the owner of the code, which is a condition that when coupled with inadequate document results in a time consuming and error prone testing situation.

SUMMARY

Embodiments of the invention are directed to a method, system and computer program product for testing application, for example application programs, by adding a probe (hereinafter also referred to as a breakpoint) in the application program. The probe is exported to a file or any other form of storage. The probe is then associated with the test case for the application program thereby creating a direct mapping between the application program and the test case for the application program. In a further embodiment, the probe is added to at least one of a function or module of the application program.

In a further embodiment, the breakpoint is imported to check the relevant functions or modules of the application program. In yet a further embodiment, the breakpoint is exported to a filed using a tool, (e.g., software tool such as ECLIPSE, for example). In one embodiment, the probe is added by the developer or engineer developing or testing the application program.

It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not necessarily restrictive of the present disclosure. The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate subject matter of the disclosure. Together, the descriptions and the drawings serve to explain the principles of the disclosure. For a better understanding of the aspects of the invention presented herein, together with other and further features and advantages thereof, reference is made to the following description, taken in conjunction with the accompanying drawings, and the scope of the invention will be pointed out in the appended claims.

DETAILED DESCRIPTION

Reference will now be made in detail to the subject matter disclosed, which is illustrated in the accompanying drawings. It will be readily understood that the components of the embodiments of the invention, as generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations in addition to the described exemplary embodiments. Thus, the following more detailed description of the embodiments of the invention, as represented in the figures, is not intended to limit the scope of the disclosure, as claimed, but is merely representative of selected exemplary embodiments of the invention.

Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the various embodiments of the invention can be practiced without one or more of the specific details, or with other methods, components, materials, etc. In other instances, well-known structures, materials, or operations are not shown or described in detail to avoid obscuring aspects of the embodiments of the invention. The illustrated embodiments of the invention will be best understood by reference to the drawings. The following description is intended only by way of example and simply illustrates certain selected exemplary embodiments of the invention as claimed herein.

Assume that a first user was asked to write an application program (hereinafter referred to as code or software core) as illustrated in the exemplary embodiment100ofFIG. 1, which has the capability of migrating any old projects to a new version. The user went through the migration framework and understood the mechanism. It takes the first user roughly about a week (one week) to understand the framework and implement it, and the first user wrote a code in December 2005. The first user comes up with a migratory as illustrated inFIG. 1, which is illustrated as an application program. It should however be obvious to one skilled in the art that such a migratory code may be written in various other forms, and all such form fall under the scope of the invention.

After completion of writing the migratory code, the first user wrote a test case which looked as follows:i. Start RAD 6.0 with a workspace.ii. Create a Web Project for example RAD6 Project.iii. Open website diagram.iv. Add three pages to it.v. Save the diagram.vi. Export the project as an interchange file, for example Migration.zip.vii. Start RAD 7.0 with a fresh workspace.viii. Import Migration.zip interchange file created in step (vi).
After this the first user opens the code. The first user has created a single Class file with seven (7) functions. This is a small addition to the already present for example 600 files in the component. The first user now inserts a probe (hereinafter also referred to as breakpoints) as illustrated in an exemplary embodiment200ofFIG. 2at the relevant portions in the code, which will be encountered when the migration of the code takes place.

After insertion of the probes as illustrated in the exemplary embodiment inFIG. 2, the first user then exports the breakpoints using an already existing export option in the debugger tool as illustrated in an exemplary embodiment300inFIG. 3, thereby creating an external breakpoint file (migration.bkpt as illustrated inFIG. 3). The breakpoint file is attached to the test case that is written by the first user.

The component that is written by the first user is transitioned over a period of time to another team located in another geographical location, for example another country. The first user who worked on this case decides to move and has now left a vacuum to a second user who might come to take over this work on the same application program.

The second user from a new team executes the test case and realizes that the files are not being migrated correctly to the new version. Therefore there is a problem as hand that needs to be solved and since the first user was involved in the work on the application program. The second user opens the defects in a tool such as Rational® Clear Quest® and the developer manager for the application program assigns the defects noticed to a third user. The third user has joined the team a week ago, for example in July 2008, and is knowledgeable only on what a basic ECLIPSE plug-in looks like and how to use the debugger. The third user has opened the test case, and imported the break points into his code workspace as illustrated by the functionality of the tool as illustrated in an exemplary embodiment400ofFIG. 4.

In this way, the third user is able to recreates the scenarios as illustrated in an exemplary embodiment500inFIG. 5, and he finds that one particular method that was supposed to find the files required for migration was not working correctly He quickly analyses the reasons why the files were not being populated and corrects the issue. He updates the breakpoints and saves them back to the test case. Therefore, the third user who hadn't seen the component code ever before, solved a migration problem written more than two and a half years ago. An advantage was that the third user didn't have to work to find the probable code areas where the problem could be existing. Yet a further advantage was that he didn't have to spend any time into understanding the migration framework. Yet a further advantage was that he didn't have to refer to any documentation, and finally he ended up fixing a problem without any component code coverage.

Reference is now made toFIG. 6which illustrates an exemplary embodiment of a method600for associating probes with a test case. The scenario would be to consider that a functionality needs to be added to a software product. The aim here would be to create the functionality in the code and test the functionality. The functionality will be tested frequently and if any defects or bugs are found, then the code can be fixed by the developers. In step610the functional requirements are received. In step620as illustrated, the code for the functionality that is received is written by the developer or user. In step630, the test case for testing the functionality is written, where the test case is actually a function test case which tests the functionality of the code. In step640, the developer inserts a probe into the new parts of the code that the developer has written. The developer inserts the probes in the new functions that have been added to the already existing code. In step650the probes are exported by the developer to a file, for example using a development environments such as ECLIPSE. In step6660, the developer attaches the breakpoints to the test case, where the test case is generally a document, and it should be obvious to one skilled in the art that such a document may contain artifacts. The essential feature is the method600is associating the breakpoints/probes with the test case which creates a direct mapping of the functionality with the code powering it.

Reference is now made toFIG. 7, which illustrates an exemplary embodiment700of how the problems encountered with the defects may be solved by an unknown user. In step710the test cases are executed for example by the testing team. In step720, the tester who is not the developer of the code realizes that there is a defect in the functionality of the code. In step730, the tester creates a defect in the defect tracking, which may be an external tool associated with the testing environment, and also specifies the test cases that illustrates the defect. In step740, he defect is now assigned to a developer, who in this instance may not be the same developer who has written the code, to fix the defect that has been found while executing the test case. In step750, the developer who is assigned the test case opens he test case document. The developer is able to recover the breakpoint file from the test case, and the breakpoints are inserted into the development environment. In step750, when the developer debugs the code, the parts of the code that are responsible for the functionality will be targeted. The developer can easily analyze the targeted sections of the code and analyze the problems with the code easily. An advantage is that the developer does not have to spend time investigating the code to determine the relevant portions of the code/functionality in the code giving rise to the defect. Even if the developers in the project change, a new developer need not sped time investigating where the defect occurs, thereby saving cost and time.

Reference is not made toFIG. 8illustrating a block diagram of an exemplary data processing system800, in which the method as disclosed inFIG. 6andFIG. 7may be implemented. The data processing system800includes for example a computing system such as a desktop computer, laptop computer, PDA, mobile phone and the like, that can be used for implementing exemplary embodiments of the present invention. Data processing system800includes one or more processors, for example processor804as illustrated inFIG. 8. Processor804is coupled to a communication infrastructure802(for example, a communications bus, cross-over bar, or network). Various software embodiments are described in terms of this exemplary data processing system. After reading this description, it will become apparent to a person of ordinary skill in the relevant art(s) how to implement the invention using other data processing systems and/or computer architectures.

Exemplary data processing system800can include display interface808that forwards graphics, text, and other data from the communication infrastructure802(or from a frame buffer not shown) for display on display unit810. Data processing system800also includes main memory806, which can be random access memory (RAM), and may also include secondary memory812. Secondary memory812may include, for example, hard disk drive814and/or removable storage drive816, representing a floppy disk drive, a magnetic tape drive, an optical disk drive, etc. Removable storage drive816reads from and/or writes to removable storage unit818in a manner well known to those having ordinary skill in the art. Removable storage unit818, represents, for example, a floppy disk, magnetic tape, optical disk, etc. which is read by and written to by removable storage drive816. As will be appreciated, removable storage unit818includes a computer usable storage medium having stored therein computer software and/or data.

In exemplary embodiments, secondary memory812may include other similar means for allowing computer programs or other instructions to be loaded into the computer system. Such means may include, for example, removable storage unit822and interface820. Examples of such may include a program cartridge and cartridge interface (such as that found in video game devices), a removable memory chip (such as an EPROM, or PROM) and associated socket, and other removable storage units822and interfaces820which allow software and data to be transferred from removable storage unit822to data processing system800.

Data processing system800may also include a communications interface824. Communications interface824allows software and data to be transferred between the data processing system and any other external devices. Examples of communications interface824may include a modem, a network interface (such as an Ethernet card), a communications port, a PCMCIA slot and card, etc. Software and data transferred via communications interface824are typically in the form of signals which may be, for example, electronic, electromagnetic, optical, or other signals capable of being received by communications interface824. These signals are provided to communications interface824via communications path (that is, channel)826. Channel826carries signals and may be implemented using wire or cable, fiber optics, a phone line, a cellular phone link, an RF link, and/or other communications channels.

The terms “computer program medium,” “computer usable medium,” and “computer readable medium” are used to generally refer to media such as main memory806and secondary memory812, removable storage drive816, a hard disk installed in hard disk drive814, and signals thereof. Computer program products are means for providing software to the computer system. The computer readable medium allows the computer system to read data, instructions, messages or message packets, and other computer readable information from the computer readable medium. The computer readable medium, for example, may include non-volatile memory, such as Floppy, ROM, Flash memory, Disk drive memory, CD-ROM, and other permanent storage. It can be used, for example, to transport information, such as data and computer instructions, between computer systems. Furthermore, the computer readable medium may comprise computer readable information in a transitory state medium such as a network link and/or a network interface, including a wired network or a wireless network, which allows a computer to read such computer readable information.

Computer programs (also called computer control logic) are typically stored in main memory806and/or secondary memory812. Computer programs may also be received via communications interface824. Such computer programs, when executed, can enable the computer system to perform the features of exemplary embodiments of the invention as discussed herein. In particular, computer programs, when executed, enable processor804to perform the features of data processing system800. Accordingly, such computer programs represent controllers of the data processing system.

As will be appreciated by one skilled in the art, the present invention may be embodied as a system, method, and/or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.), and/or or an embodiment combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module” or “system.” Furthermore, the present invention may take the form of a computer program product embodied in any tangible medium of expression having computer usable program code embodied in the medium.

While exemplary embodiments of the invention have been described, it will be understood that those skilled in the art, both now and in the future, may make various improvements and enhancements which fall within the scope of the claims that follow. These claims should be construed to maintain the proper protection for the invention first described.