Method and apparatus for executing unit tests in application host environment
First Claim
1. A method of testing a program operating in a first environment, the program having a plurality of units, including at least one unit under test, the method comprising:
- operating at least one programmed processor to perform a series of acts, the series of acts being identified by executable instructions with which the at least one programmed processor is programmed, the series of acts comprising;
a) executing a test agent in a second environment, the test agent specifying a test to be performed in the first environment to test the at least one unit under test and communicating regarding the specified test with the at least one unit under test in the first environment via a non-public interface of the at least one unit under test, wherein the first environment is an executing application program and the program is an add-in to the application program;
b) executing, in response to executing the test agent, the specified test in the first environment, the executing of the specified test comprising accessing, by the specified test, of non-public attributes, variables or other parameters of the application program of the first environment during the executing of the specified test and further comprising generating a test result indicative of a performance characteristic of the unit under test; and
c) providing the test result and information regarding at least some of the accessed non-public attributes of the application program of the first environment, non-public variables of the application program of the first environment or other non-public parameters of the application program of the first environment to the test agent through the execution of the specified test, wherein the providing comprises communicating to the test agent in the second environment the test result and the information via the non-public interface of the at least one unit under test.
2 Assignments
0 Petitions
Accused Products
Abstract
A development environment in which unit tests are prepared. The unit tests run in a host environment for more complete and accurate testing of program units. The development environment uses a test execution shim to access an adapter running in the host environment. The host adapter may invoke other program objects that run specific tests. Such objects may late bind to the unit under test. An accessor class may facilitate late binding to the specific unit under test while allowing tests authored in the development environment to use context sensitive information needed to access the unit under test.
-
Citations
20 Claims
-
1. A method of testing a program operating in a first environment, the program having a plurality of units, including at least one unit under test, the method comprising:
operating at least one programmed processor to perform a series of acts, the series of acts being identified by executable instructions with which the at least one programmed processor is programmed, the series of acts comprising; a) executing a test agent in a second environment, the test agent specifying a test to be performed in the first environment to test the at least one unit under test and communicating regarding the specified test with the at least one unit under test in the first environment via a non-public interface of the at least one unit under test, wherein the first environment is an executing application program and the program is an add-in to the application program; b) executing, in response to executing the test agent, the specified test in the first environment, the executing of the specified test comprising accessing, by the specified test, of non-public attributes, variables or other parameters of the application program of the first environment during the executing of the specified test and further comprising generating a test result indicative of a performance characteristic of the unit under test; and c) providing the test result and information regarding at least some of the accessed non-public attributes of the application program of the first environment, non-public variables of the application program of the first environment or other non-public parameters of the application program of the first environment to the test agent through the execution of the specified test, wherein the providing comprises communicating to the test agent in the second environment the test result and the information via the non-public interface of the at least one unit under test. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
11. A method of testing a program operating in a first environment, the first environment storing data and including at least one interface to expose a first portion of the data outside the first environment, wherein the first portion of the data exposed by the at least one interface is public data and wherein a second portion of the data not exposed by the at least one interface is non-public data, the program having a plurality of units, at least one of the units being a unit under test, the method comprising:
-
operating at least one programmed processor to perform a series of acts, the series of acts being identified by executable instructions with which the at least one programmed processor is programmed, the series of acts comprising; a) loading the program in the first environment; b) exposing a first interface of an object in the first environment; c) receiving with the object an instruction to operate the first environment in a test mode and, in response to the instruction, setting the first environment in the test mode and using the object to load a test adapter of the first environment, the test adapter of the first environment being executed within the first environment and being separate from the at least one unit under test; d) using the test adapter executing in the first environment to execute a test of the at least one unit under test in the first environment; e) accessing, with the test through the interface, non-public attributes in the first environment, non-public variables in the first environment or other non-public parameters in the first environment during execution of the test, wherein the accessing comprises communicating via a second interface of the unit under test, and wherein the non-public attributes, the non-public variables and the non-public parameters are non-public data not available outside the first environment via the at least one interface; and f) providing information regarding at least some of the accessed non-public attributes, non-public variables or other non-public parameters in the first environment through the first interface to a test agent executing in a second environment. - View Dependent Claims (12, 13, 14, 15, 16)
-
-
17. A computer-readable storage medium having computer-executable instructions for performing steps implementing a software system providing a development environment in which a test program may be developed for testing a unit of a program operating in one of a plurality of host environments, the computer-executable instructions performing the steps of:
-
a) creating a test agent configured to execute in the development environment; b) creating a test execution shim configured to execute in the development environment, configured to interact with the test agent, and configured to provide an interface to at least one of the plurality of host environments; and c) creating one of a plurality of host adapters, each host adapter configured to execute in one of the plurality of host environments, each host environment being an executing application program and the host adapter being separate from a unit being tested, each host adapter being configured to be used by the test agent to invoke execution of a test program in one of the plurality of host environments, wherein invoking execution of a test program comprises late binding an accessor class of the test program to the unit of the program being tested to provide access to non-public properties of the unit. - View Dependent Claims (18, 19, 20)
-
Specification