IP Library Granted Patent US 7,996,816
Granted Patent B2
US 7,996,816 · App. 11/560,200 · Granted Aug 9, 2011

Method and apparatus for dynamically binding service component implementations for specific unit test cases

Assignee: International Business Machines Corporation
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,996,816
App. No.
11/560,200
Granted
Aug 9, 2011
Kind
B2
Abstract

The present invention enables a component under test to bind to a single component, that is capable of simulating most depended upon services, including the details of their interface, whether or not they return explicit results or cause side effects, and regardless of the state of their implementation. This invention includes features that allow for dynamic reconfiguration to meet the needs of both manual and automated testing, including the ability to control normal and exceptional results, as well as features to support both unit and integration testing.

Claims (47)

1. A computer implemented method of binding depended upon service implementations for specific unit test cases for a component, the computer implemented method comprising:

loading a set of data entries that correspond to results of an operation of the depended upon service;

simulating an interface for the depended upon service, wherein the component depends upon the depended upon service, and wherein simulating the interface for the depended upon service is performed by a generic service component, and wherein the generic service component delegates to a stub function to return a result that includes dynamic aspects;

invoking the operation of the depended upon service;

determining a data entry from the set of data entries that corresponds to the result of the operation of the depended upon service;

assigning the data entry as the result; and

outputting the result.

2. The computer implemented method of claim 1 , further comprising:

in response to a determination that a data entry from the set of data entries that corresponds to the operation of the depended upon service does not exist, prompting a user to manually enter data that corresponds to the operation.

3. The computer implemented method of claim 1 , further comprising:

determining a data entry from the set of data entries that changes a state of the unit test case by modifying a result expected to be returned by subsequent calls to one or more depended upon services, including the depended upon service; and

processing the data entry.

4. The computer implemented method of claim 1 , further comprising:

examining the result to determine whether a normal return or an exceptional return is expected.

5. The computer implemented method of claim 4 , further comprising:

in response to a determination that the normal return is expected, determining a type of return.

6. The computer implemented method of claim 1 , wherein determining the result from the data entry further comprises:

matching context information and parameters of a call to an entry in cache to determine the result.

7. The computer implemented method of claim 1 , wherein determining the result from the data entry further comprises:

selecting the result from input data, wherein the input data is selected in a sequential manner.

8. The computer implemented method of claim 1 , further comprising:

outputting a cache to serve as a configuration file.

9. The computer implemented method of claim 1 , further comprising:

compiling a configuration file.

10. A computer program product comprising a non-transitory computer usable medium including computer usable program code for specific unit test cases for a component, the computer program product comprising:

computer usable program code for loading a set of data entries that correspond to results of an operation of a depended upon service;

computer usable program code for simulating an interface for the depended upon service, wherein the component depends upon the depended upon service, and wherein simulating the interface for the depended upon service is performed by a generic service component, and wherein the generic service component delegates to a stub function to return a result that includes dynamic aspects;

computer usable program code for invoking the operation of the depended upon service;

computer usable program code for determining a data entry from the set of data entries that corresponds to the result of the operation of the depended upon service;

computer usable program code for assigning the data entry as the result; and

computer usable program code for outputting the result.

11. The computer program product of claim 10 , further comprising:

computer usable program code, in response to a determination that a data entry from the set of data entries that corresponds to the operation of the depended upon service does not exist, for prompting a user to manually enter data that corresponds to the operation.

12. The computer program product of claim 10 , further comprising:

computer usable program code for determining a data entry from the set of data entries that changes a state of the unit test case by modifying a result expected to be returned by subsequent calls to one or more depended upon services, including the depended upon service; and

computer usable program code for processing the data entry.

13. The computer program product of claim 10 , further comprising:

computer usable program code for examining the result to determine whether a normal return or an exceptional return is expected.

14. A data processing system for binding depended upon service implementations for specific unit test cases for a component, the data processing system comprising:

a storage device, wherein the storage device stores computer usable program code; a bus coupled to the storage device; and

a processor coupled to the bus, wherein the processor executes the computer usable program code to:

load a set of data entries that correspond to results of an operation of the depended upon service;

simulate an interface for the depended upon service, wherein the component depends upon the depended upon service, and wherein simulating the interface for the depended upon service is performed by a generic service component, and wherein the generic service component delegates to a stub function to return a result that includes dynamic aspects;

invoke the operation of the depended upon service;

determine a data entry from the set of data entries that corresponds to the result of the operation of the depended upon service;

assign the data entry as the result; and

output the result.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 16, 2006
From: FRANCIS, TIMOTHY MARC; HAMBRICK, GEOFFREY MARTIN; KINDER, STEPHEN JOSEPH
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 018528/0212 →
Continuity (1)
Related Publication 20080115116A1 · May 15, 2008