IP Library Granted Patent US 9,274,936
Granted Patent B2
US 9,274,936 · App. 13/904,238 · Granted Mar 1, 2016

Database code testing framework

Inventor: Alexey Soshin (Ramat Gan, IL)
Assignee: SAP Portals Israel Ltd
G06F11/3692G06F11/3688G06F11/3664G06F17/30289
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 9,274,936
App. No.
13/904,238
Granted
Mar 1, 2016
Kind
B2
Abstract

The present disclosure involves systems, software, and computer-implemented methods for providing an integrated testing framework within a database system for testing database code. An example method includes identifying a test script associated with a database, identifying an expected result to be produced by the test script, the expected result stored in an expected results table in the database, executing the test script within the database, where executing the test script produces an actual result, and comparing, within the database, the actual result produced by the test script with the expected result from the expected results table to determine a success condition associated with the execution of the test script.

Claims (51)

1. A computer-implemented method executed by one or more processors, the method comprising:

identifying a test script stored in a first database, wherein the test script tests software code stored in and executed by the first database;

identifying an expected result associated with the test script, the expected result stored in an expected results table in the first database;

executing the test script within the first database by a test wrapper function stored in the first database, the test wrapper function receiving the test script as a parameter and configured to treat the test script as having failed when observing that the test script has taken longer than a maximum time to run, where executing the test script produces an actual result; and

comparing, within the first database by the test wrapper function, the actual result produced by the test script with the expected result from the expected results table to determine a success condition associated with the execution of the test script within the first database;

wherein identifying the test script, identifying the expected result, executing the test script, and comparing the actual result are performed internal to the first database without an external testing framework.

2. The method of claim 1 , wherein the test script is a first test script, the method further comprising identifying a second test script stored in the first database, the first test script and the second test script associated with a test battery.

3. The method of claim 2 , wherein the first test script and the second test script are associated with the test battery by a common annotation included within the first test script and the second test script.

4. The method of claim 2 , further comprising:

determining whether the success condition indicates that the first test script succeeded or failed; and

executing the second test script upon determining that the success condition indicates that the first test script succeeded.

5. The method of claim 2 , further comprising:

determining whether the success condition indicates that the first test script succeeded or failed; and

providing an indication of an error associated with the test battery upon determining that the success condition indicates that the first test script failed.

6. The method of claim 2 , further comprising executing the second test script substantially simultaneously with the first test script.

7. The method of claim 1 , wherein the test script includes one or more annotations, and wherein executing the test script further comprises:

analyzing the one or more annotations; and

modifying the execution of the test script based on the one or more annotations.

8. The method of claim 1 , wherein executing the test script within the first database includes detecting an exception produced by the test script, and stopping execution of the test script in response to detecting the exception.

9. The method of claim 1 , wherein executing the test script within the first database includes inserting the actual result produced by the test script into a test results table.

10. The method of claim 9 , wherein comparing the actual result produced by the test script with the expected result from the expected results table includes executing a query against the expected results table and the test results table to compare the expected result to the actual result.

11. The method of claim 1 , wherein identifying the expected result includes:

reading a parameter from within a request to execute the test script; and

adding the parameter to the expected results table prior to execution of the test script.

12. A computer program product encoded on a tangible, non-transitory storage medium, the computer program product comprising computer readable instructions for causing one or more processors to perform operations comprising:

identifying a test script stored in a first database, wherein the test script tests software code stored in and executed by the first database;

identifying an expected result associated with the test script, the expected result stored in an expected results table in the first database;

executing the test script within the first database by a test wrapper function stored in the first database, the test wrapper function receiving the test script as a parameter and configured to treat the test script as having failed when observing that the test script has taken longer than a maximum time to run, where executing the test script produces an actual result; and

comparing, within the first database by the test wrapper function, the actual result produced by the test script with the expected result from the expected results table to determine a success condition associated with the execution of the test script within the first database;

wherein identifying the test script, identifying the expected result, executing the test script, and comparing the actual result are performed internal to the first database without an external testing framework.

13. The computer program product of claim 12 , wherein the test script is a first test script, the operations further comprising identifying a second test script stored in the first database, the first test script and the second test script associated with a test battery.

14. The computer program product of claim 13 , wherein the first test script and the second test script are associated with the test battery by a common annotation included within the first test script and the second test script.

15. The computer program product of claim 13 , the operations further comprising:

determining whether the success condition indicates that the first test script succeeded or failed; and

executing the second test script upon determining that the success condition indicates that the first test script succeeded.

16. The computer program product of claim 13 , the operations further comprising:

determining whether the success condition indicates that the first test script succeeded or failed; and

providing an indication of an error associated with the test battery upon determining that the success condition indicates that the first test script failed.

17. The computer program product of claim 13 , the operations further comprising executing the second test script substantially simultaneously with the first test script.

18. The computer program product of claim 12 , wherein the test script includes one or more annotations, and wherein executing the test script further comprises:

analyzing the one or more annotations; and

modifying the execution of the test script based on the one or more annotations.

19. The computer program product of claim 12 , wherein executing the test script within the first database includes detecting an exception produced by the test script, and stopping execution of the test script in response to detecting the exception.

20. A system, comprising:

memory for storing data; and

one or more processors operable to:

identify a test script stored in a first database, wherein the first database is stored in the memory, and wherein the test script tests software code stored in and executed by the first database;

identify an expected result associated with the test script, the expected result stored in an expected results table in the first database stored in the memory;

execute the test script within the first database stored in the memory by a test wrapper function stored in the first database, the test wrapper function receiving the test script as a parameter and configured to treat the test script as having failed when observing that the test script has taken longer than a maximum time to run, where executing the test script produces an actual result; and

compare, within the first database stored in the memory by the test wrapper function, the actual result produced by the test script with the expected result from the expected results table to determine a success condition associated with the execution of the test script within the first database;

wherein identifying the test script, identifying the expected result, executing the test script, and comparing the actual result are performed internal to the first database without an external testing framework.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 11, 2013
From: SOSHIN, ALEXEY
To: SAP PORTALS ISRAEL LTD
Reel/Frame 030590/0384 →
Continuity (1)
Related Publication 20140359581A1 · Dec 4, 2014