Software testing in parallel with different database instances
View Patent ↗Test cases written to test a software application can be dynamically distributed among a set of software application instances such that different sets of test cases can execute simultaneously in parallel, thereby speeding up testing relative to executing the test cases sequentially. To avoid database conflicts that may occur when different test cases are executed in parallel, each software application instance can be associated with a different database instance. Accordingly, a first test case executing in association with a first database instance can avoid interfering with a second test case executing in association with a second database instance.
1 . A method, comprising:
dynamically distributing, by a processor, a group of test cases into different test sets prior to initiating execution of the group of test cases in association with parallel testing of a software application, wherein the group of test cases;
is configured to test interactions between the software application and a database, and
was initially configured for execution of individual test cases, of the group of test cases, in a sequential execution order in association with a same instance of the database;
initiating, by the processor, different software application instances of the software application, wherein after initiation of the different software application instances:
the different software application instances execute to create, as tightly-coupled in-memory databases, different database instances of the database that respectively correspond to the different software application instances; and
executing, by the processor, the different test sets in parallel in association with corresponding instances of:
the different software application instances, and
the different database instances that respectively correspond to the different software application instances,
wherein executing the different test sets in parallel causes the individual test cases to be executed in an order that differs from the sequential execution order.
2 . The method of claim 1 , further comprising:
collecting, by the processor, test result sets associated with execution of the different test sets in parallel; and
combining, by the processor, the test result sets into an aggregated test result report.
3 . The method of claim 1 , wherein execution of the different test sets in parallel causes the different database instances to store different data.
4 . The method of claim 1 , wherein:
the group of test cases includes a first test case and a second test case, the first test case and the second test case both being configured to access a same data element in the database,
the distributing causes:
the first test case to be assigned to a first test set associated with a first software application instance that corresponds to a first database instance, and
the second test case to be assigned to a second test set associated with a second software application instance that corresponds to a second database instance, and
executing the different test sets in parallel avoids database errors by permitting the first test case and the second test case to simultaneously access different instances of the same data element in the first database instance and the second database instance.
5 . The method of claim 1 , wherein the different software application instances are initiated in association with at least one of:
different virtual machines, or
different processing threads.
6 . The method of claim 1 , wherein:
code of the group of test cases is expressed in a set of class files, individual class files of the set of class files each including one or more methods, and
the distributing is performed at one or more of:
a class level associated with the set of class files, or
a method level associated with the one or more methods.
7 . The method of claim 1 , further comprising:
identifying, by the processor, test cases within a particular test set that is associated with a particular software application instance;
distributing, by the processor, the test cases among different test subsets, wherein the different test subsets are associated with different processing threads that correspond to the particular software application instance; and
executing, by the processor, and via the different processing threads, the different test subsets in parallel, in association with the particular software application instance and a particular database instance that corresponds to the particular software application instance.
8 . The method of claim 1 , wherein the group of test cases is dynamically distributed based at least in part on predicting execution times of the different test sets.
9 . The method of claim 1 , wherein:
the different software application instances respectively create the different database instances as table-locking databases or record-locking databases, and
executing the different test sets in parallel in association with the corresponding instances of the different software application instances and the different database instances avoids at least one of table-locking errors or record-locking errors associated with the table-locking databases or the record-locking databases.
10 . The method of claim 1 , wherein the software application is a policy management system configured to manage policies by accessing and modifying policy data records stored in the database.
11 . The method of claim 1 , wherein the interactions between the software application and the database, tested via the group of test cases during execution of the different test sets in parallel, comprise the different software application instances accessing and modifying records stored in the tightly-coupled in-memory databases respectively created by the different software application instances.
12 . A computing device, comprising:
a processor; and
memory storing computer-executable instructions that, when executed by the processor, cause the processor to perform operations comprising:
dynamically distributing a group of test cases into at least a first test set and a second test set prior to initiating execution of the group of test cases in association with parallel testing of a software application, wherein the group of test cases:
is configured to test interactions between the software application and a database, and
was initially configured for execution of individual test cases, of the group of test cases, in a sequential execution order in association with a same instance of the database;
initiating a first software application instance of the software application and a second software application instance of the software application, wherein the initiating causes:
the first software application instance to, after initiation of the first software application instance, execute to create a first database instance of the database as a first in-memory database that corresponds to the first software application instance, and
the second software application instance to, after initiation of the second software application instance, execute to create a second database instance of the database as a second in-memory database that corresponds to the second software application instance; and
executing the first test set and the second test set in parallel, wherein:
the first test set executes in association with the first software application instance and the first database instance,
the second test set executes in association with the second software application instance and the second database instance, and
executing the first test set and the second test set in parallel causes the individual test cases to be executed in an order that differs from the sequential execution order.
13 . The computing device of claim 12 , wherein execution of the first test set and the second test set in parallel causes the first database instance and the second database instance to store different data.
14 . The computing device of claim 12 , wherein the first software application instance and the second software application instance are associated with at least one of:
different virtual machines on the computing device, or
different processing threads on the computing device.
15 . The computing device of claim 12 , wherein the operations further comprise:
distributing test cases within the first test set among different test subsets, the different test subsets being associated with different processing threads on the computing device that correspond to the first software application instance; and
executing, via the different processing threads, the different test subsets in parallel in association with the first software application instance and the first database instance.
16 . One or more non-transitory computer-readable media storing computer-executable instructions that, when executed by a processor, cause the processor to perform operations comprising:
dynamically distributing a group of test cases into different test sets prior to initiating execution of the group of test cases in association with parallel testing of a software application, wherein the group of test cases:
is configured to test interactions between the software application and a database, and
was initially configured for execution of individual test cases, of the group of test cases, in a sequential execution order in association with a same instance of the database;
initiating different software application instances of the software application, wherein after initiation of the different software application instances:
the different software application instances execute to create, as in-memory databases, different database instances of the database that respectively correspond to the different software application instances; and
executing the different test sets in parallel in association with corresponding instances of:
the different software application instances, and
the different database instances that respectively correspond to the different software application instances,
wherein executing the different test sets in parallel causes the individual test cases to be executed in an order that differs from the sequential execution order.
17 . The one or more non-transitory computer-readable media of claim 16 , wherein execution of the different test sets in parallel causes the different database instances to store different data.
18 . The one or more non-transitory computer-readable media of claim 16 , wherein the different software application instances are initiated in association with at least one of:
different virtual machines, or
different processing threads.
19 . The one or more non-transitory computer-readable media of claim 16 , wherein the operations further comprise:
distributing test cases within a particular test set, associated with a particular software application instance, among different test subsets, the different test subsets being associated with different processing threads corresponding to the particular software application instance; and
executing, via the different processing threads, the different test subsets in parallel in association with the particular software application instance and a particular database instance that corresponds to the particular software application instance.
20 . A system comprising:
means for dynamically distributing a group of test cases into different test sets prior to initiating execution of the group of test cases in association with parallel testing of a software application, wherein the group of test cases:
is configured to test interactions between the software application and a database, and
was initially configured for execution of individual test cases, of the group of test cases, in a sequential execution order in association with a same instance of the database;
means for initiating different software application instances of the software application, wherein after initiation of the different software application instances:
the different software application instances execute to create, as in-memory databases, different database instances of the database that respectively correspond to the different software application instances; and
means for executing the different test sets in parallel in association with corresponding instances of:
the different software application instances, and
the different database instances that respectively correspond to the different software application instances,
wherein executing the different test sets in parallel causes the individual test cases to be executed in an order that differs from the sequential execution order.