IP Library › Granted Patent US 7,552,422
Granted Patent B2
US 7,552,422 · App. 10/815,019 · Granted Jun 23, 2009

Test case inheritance controlled via attributes

Assignee: Microsoft 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,552,422
App. No.
10/815,019
Granted
Jun 23, 2009
Kind
B2
Abstract

The present invention is directed towards a test case inheritance behavior that can be controlled via attributes. A base test class from which test objects are derived are useful for reducing test case code and management. For example, base test classes and their derived objects can be used to implement steps that are common between the entire set of classes (e.g., launching a piece of software to be tested and getting it to a certain stage). The principle of inheritance simplifies management of the test software when, for example, the base class is modified, all of the tests which derive from that test case automatically are modified. Accordingly, only one item needs to be modified (instead of every tests) when a change is necessary to modify the way the software launches.

Claims (36)

1. A computer-storage medium having computer-executable components, comprising:

a test case scenario object configured to coordinate a test of a particular software object by specifying test methods to be included in the test;

a test runtime object including a plurality of attributes and a test extraction engine configured to extract an ordered list of the test methods based on the attributes to control application of the test methods without modifying the test methods, wherein;

the test extraction engine is configured to select and arrange the test methods in a hierarchy that comprises a base class and subclasses, wherein each of the subclasses derives from the base class; and

inheritance is selectively applied to the test methods according to the attributes to determine if the test methods in each of the subclasses inherit from the base class; and

a test harness that is arranged to provide system test services to support the application of the ordered list of the test methods in the test of the particular software object.

2. The computer-storage medium of claim 1 , wherein the test extraction engine is configured to use a comparison function that is defined within the attributes to modify the order of the test methods according to the attributes.

3. The computer-storage medium of claim 1 , wherein the base class test methods comprise a setup method and a teardown method.

4. The computer-storage medium of claim 3 , wherein the subclass test methods comprise a setup method and a teardown method.

5. A method for automated testing, comprising:

providing test methods that are arranged to test an electronic system;

providing a runtime test object configured to use a plurality of attributes specified for a particular test to:

extract from among the provided test methods, the provided test methods being presented in a hierarchy that comprises a base class and subclasses, wherein each of the subclasses derives from the base class; and

selectively apply principle of inheritance to each of the extracted test methods according to the attributes to determine which of the subclasses inherits from the base class in accordance with the arrangement of the methods within the hierarchy without modifying the test methods; and

using a test harness to provide system test services for the test methods.

6. The method of claim 5 , further comprising using a comparison function that is defined within the attributes to order the extracted test methods.

7. The method of claim 5 , wherein the base class test methods comprise a setup method and a teardown method.

8. The method of claim 7 , wherein the subclass test methods comprise a setup method and a teardown method.

9. A computer-storage medium having computer-executable components describing a test automation system, comprising:

a test case scenario object that describes test methods arranged to test an electronic system, wherein the test methods that are arranged in a hierarchy that comprises a base class and subclasses, wherein each of the subclasses derives from the base class;

a test runtime object configured to:

extract the test methods described by the test case scenario object; and

selectively apply a principle of inheritance to each of the test method to determine whether the subclasses will inherit from the base class from which the subclasses are derived in accordance with the arrangement of the methods within the hierarchy; and a test harness that is arranged to provide the test methods.

10. The computer-storage medium of claim 9 , further comprising a test extraction engine that is configured to order the test methods.

11. The computer-storage medium of claim 10 , wherein the test extraction engine is configured to use a comparison function that is defined within the attributes to order the test methods.

12. The computer-storage medium of claim 9 , wherein the base class test methods comprise a setup method and a teardown method.

13. The computer-storage medium of claim 9 , wherein the subclass test methods comprise a setup method and a teardown method.

14. A computer-implemented method for testing computer software, comprising:

receiving a test case scenario describing a plurality of test methods to be performed on the computer software, wherein the plurality of test methods are arranged in a hierarchy including at least one base class and one or more subclasses derived from the base class;

providing the test case scenario to a test runtime object, the test runtime object being configured to:

respond to the test case scenario to order the test methods for application to the computer software; and

based on the test case scenario, collect a plurality of attributes to be applied to the test methods identified to determine if inheritance should be applied to the subclasses within the base class; and

engaging a test harness through the test runtime object, wherein the test runtime object invokes desired system test services from the test harness for testing the computer software to perform the tests described by the test case scenario without the test case scenario having to specify the desired system test services.

15. The computer-implemented method of claim 14 , further comprising using a comparison function that is defined within the attributes to order the extracted test methods.

16. The computer-implemented method of claim 14 , wherein the base class test methods comprise a setup method and a teardown method.

17. The computer-implemented method of claim 16 , wherein the subclass test methods comprise a setup method and a teardown method.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 15, 2015
From: MICROSOFT CORPORATION
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 034766/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 31, 2004
From: GERBER, PETER; POTTER, ORVILLE JAY IV; ROBINSON, MICHAEL PAUL
To: MICROSOFT CORPORATION
Reel/Frame 015183/0297 →
Continuity (1)
Related Publication 20050251719A1 · Nov 10, 2005