A system, computer readable storage medium including instructions, and a computer-implemented method for testing a software unit of an application is described. A method signature for a method of the software unit of the application is received. A generic test specification for a generic test of the method is identified based on the method signature, the generic test specification being one of a plurality of test specifications, wherein the generic test specification includes a definition for at least one reference input parameter value of the method and a definition for at least one reference output parameter value of the method. The method is executed using the at least one reference input parameter value to produce at least one test output parameter value. A test result is determined based on a comparison between the at least one test output parameter value and the at least one reference output parameter value.
Legal claims defining the scope of protection, as filed with the USPTO.
1. A method comprising: receiving a first method signature for a first method of a software unit of an application, the first method signature comprising a plurality of parameters including at least one input parameter and at least one output parameter; identifying, based only on the at least one input parameter and the at least one output parameter of the first method signature without using a method name of the first method and using at least one processor, a generic test specification for a generic test of the first method, the generic test specification being one of a plurality of test specifications, wherein each generic test specification is identified by an associated method signature, and wherein the generic test specification includes a definition for at least one reference input parameter value of the first method corresponding to the at least one input parameter and a definition for at least one reference output parameter value of the first method corresponding to the at least one output parameter; executing the first method using the at least one reference input parameter value to produce at least one test output parameter value; and determining a test result based on a comparison between the at least one test output parameter value and the at least one reference output parameter value.
2. The method of claim 1 , further comprising, prior to executing the first method using the at least one reference input parameter value to produce at least one test output parameter value, obtaining the at least one reference input parameter value and the at least one reference output parameter value from application data in accordance with the definition for the at least one reference input parameter value and the definition for the at least one reference output parameter value included in the generic test specification.
3. The method of claim 1 , wherein the test result indicates that the first method passes the generic test when each of the at least one test output parameter value corresponds to each of the at least one reference output parameter value.
4. The method of claim 1 , further comprising: identifying, based on the first method signature, a non-generic test specification for a non-generic test of the first method, wherein the non-generic test specification includes a definition for at least one non-generic reference input parameter value of the first method and a definition for at least one non-generic reference output parameter value of the first method; obtaining the at least one non-generic reference input parameter value and the at least one non-generic reference output parameter value from application data in accordance with the definition for the at least one non-generic reference input parameter value and the definition for the at least one non-generic reference output parameter value included in the non-generic test specification; executing the first method using the at least one non-generic reference input parameter value to produce at least one non-generic test output parameter value; and determining a non-generic test result based on a comparison between the at least one non-generic test output parameter value and the at least one non generic reference output parameter value.
5. The method of claim 4 , wherein the non-generic test result indicates that the first method passes the non-generic test. when the at least one non-generic test output parameter value corresponds to the at least one non-generic reference output parameter value, and wherein the non-generic test result indicates that the first method fails the non-generic test when the at least one non-generic test output parameter value does not correspond to the at least one non-generic reference output parameter value.
6. The method of claim 4 , wherein the at least one non-generic reference input parameter value defined in the non-generic test specification is a valid value determined from the application data.
7. The method of claim 1 , wherein the at least one reference input parameter value defined in the generic test specification is an invalid value determined from application data.
8. The method of claim 1 , wherein the software unit of the application is a business object that includes methods executable to perform operations associated with business logic.
9. The method of claim 1 , wherein the application is one of a plurality of applications conforming to a software architecture paradigm.
10. The method of claim 1 , wherein the generic test specification is usable to perform a negative test that tests whether the first method produces expected values for an output parameter in response to invalid values for input parameters.
11. The method of claim 1 , wherein the plurality of test specifications is included in a test class for the application.
12. The method of claim 1 , wherein the generic test specification includes a definition for at least one reference exception for the first method.
13. The method of claim 1 , further comprising: receiving a second method signature for a second method, the second method signature comprising a plurality of parameters including at least one input parameter and at least one output parameter, the second method having different source code from the first method; identifying, based only on the parameters of the second method signature, a generic test specification for a generic test of the second method, the generic test specification for the generic test of the second method being the generic test specification for the generic test of the first method, wherein the generic test specification includes a definition for at least one reference input parameter value of the second method corresponding to the at least one input parameter of the second method signature and a definition for at least one reference output parameter value of the second method corresponding to the at least one output parameter of the second method signature; executing the second method using the at least one reference input parameter value to produce at least one second test output parameter value; and determining a second test result based on a comparison between the at least one second test output parameter value and the at least one reference output parameter value.
14. The method of claim 1 , wherein the test result indicates that the first method fails the generic test when each of the at least one test output parameter value does not correspond to each of the at least one reference output parameter value.
15. A system to test a software unit of an application, comprising: at least one processor; memory; and at least one program stored in the memory, the at least one program comprising instructions to: receive a first method signature for a first method of the software unit of the application, the first method signature comprising a plurality of parameters including at least one input parameter and at least one output parameter, the first method signature further comprising a method type; identify, based only on the at least one input parameter, the at least one output parameter, and the method type of the first method signature without using a method name of the first method and using at least one processor, a generic test specification for a generic test of the first method, the generic test specification being one of a plurality of test specifications, wherein each generic test specification is identified by an associated method signature, wherein the generic test specification is usable to test functionality that is common across a plurality of methods, and wherein the generic test specification includes a definition for at least one reference input parameter value of the first method corresponding to the at least one input parameter and a definition for at least one reference output parameter value of the first method corresponding to the at least one output parameter; execute the first method using the at least one reference input parameter value to produce at least one test output parameter value; and determine a test result based on a comparison between the at least one test output parameter value and the at least one reference output parameter value.
16. The system of claim 15 , further comprising instructions to obtain, prior to executing the first method using the at least one reference input parameter value to produce at least one test output parameter value, the at least one reference input parameter value and the at least one reference output parameter value from application data in accordance with the definition for the at least one reference input parameter value and the definition for the at least one reference output parameter value included in the generic test specification.
17. The system of claim 15 , wherein the test result indicates that the first method passes the generic test when each of the at least one test output parameter value corresponds to each of the at least one reference output parameter value.
18. The system of claim 15 , wherein the test result indicates that the first method fails the generic test when each of the at least one test output parameter value does not correspond to each of the at least one reference output parameter value.
19. A non-transitory computer readable storage medium storing at least one program configured for execution by a computer, the at least one program comprising instructions to: receive a method signature for a method of a software unit of an application, the method signature comprising a plurality of parameters including at least one input parameter and at least one output parameter; identify, based only on the at least one input parameter and the at least one output parameter of the method signature without using a method name of the first method and using at least one processor, a generic test specification for a generic test of the method, the generic test specification being one of a plurality of test specifications, wherein each generic test specification is identified by an associated method signature, wherein the generic test specification is usable to test functionality that is common across a plurality of methods, and wherein the generic test specification includes a definition for at least one reference input parameter value of the method corresponding to the at least one input parameter and a definition for at least one reference output parameter value of the method corresponding to the at least one output parameter; execute the method using the at least one reference input parameter value to produce at least one test output parameter value; and determine a test result based on a comparison between the at least one test output parameter value and the at least one reference output parameter value.
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
December 30, 2010
August 19, 2014
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.