Generating queries using cardinality constraints
First Claim
1. A method for testing a component of a database application, the method comprising:
- populating, as specified by a user, a column in a database with test data that falls within a certain range specified by the user;
specifying, by the user, a desired cardinality constraint suitable for testing the component, the component operating on a computing device, wherein the component is a software component;
specifying, by the user, a parametric pattern query that includes a parameter, wherein the parametric pattern query is compatible with the database, and wherein the parametric pattern query is configured to restrict cardinality when evaluated against the database;
selecting a candidate value;
evaluating, by the computing device via the component, the parametric pattern query against the database with the parameter set to the candidate value;
calculating, by the computing device, a cardinality error as a difference between a returned cardinality and the desired cardinality constraint, wherein the returned cardinality results from the evaluating; and
adjusting the candidate value based on the calculated cardinality error and then repeating the evaluating the parametric pattern query against the database with the parameter set to the adjusted candidate value and the calculating the cardinality error until the calculated cardinality error is within an allowable limit.
2 Assignments
0 Petitions
Accused Products
Abstract
A query generation using cardinality constraints process including choosing a first set of parameters for a query, calculating an additional set of parameters based on the first set of parameters, executing the query using additional set of parameters, evaluating the cardinality error the additional set of parameters, and refining the additional set of parameters to meet the desired cardinality constraint. Creating a query and selecting parameters for the query to meet a desired cardinality constraint or set of cardinality constraints when the query is executed against a database may be difficult. A query generation using cardinality constraints process may create a set of parameters for a query which satisfies a desired cardinality constraint or set of cardinality constraints. An application of such a query generation using cardinality constraints process may be database component and code testing.
121 Citations
20 Claims
-
1. A method for testing a component of a database application, the method comprising:
-
populating, as specified by a user, a column in a database with test data that falls within a certain range specified by the user; specifying, by the user, a desired cardinality constraint suitable for testing the component, the component operating on a computing device, wherein the component is a software component; specifying, by the user, a parametric pattern query that includes a parameter, wherein the parametric pattern query is compatible with the database, and wherein the parametric pattern query is configured to restrict cardinality when evaluated against the database; selecting a candidate value; evaluating, by the computing device via the component, the parametric pattern query against the database with the parameter set to the candidate value; calculating, by the computing device, a cardinality error as a difference between a returned cardinality and the desired cardinality constraint, wherein the returned cardinality results from the evaluating; and adjusting the candidate value based on the calculated cardinality error and then repeating the evaluating the parametric pattern query against the database with the parameter set to the adjusted candidate value and the calculating the cardinality error until the calculated cardinality error is within an allowable limit. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A system for testing a component of a database application, the system comprising:
-
a server configured to populate a column in a database with test data that falls within a certain range specified by a user; a query generator configured to specify, as indicated by the user, a desired cardinality constraint suitable for testing the component, the component operating on the system, wherein the component is a software component, wherein the system is a computing device; the query generator further configured to specify, as indicated by the user, a parametric pattern query that includes a parameter, wherein the parametric pattern query is compatible with the database, and wherein the parametric pattern query is configured to restrict cardinality when evaluated against the database; the query generator further configured to select a candidate value; a query evaluation layer configured for evaluating, via the component, the parametric pattern query against the database with the parameter set to the candidate value; the query generator further configured for calculating a cardinality error as a difference between a returned cardinality and the desired cardinality constraint wherein the returned cardinality results from the evaluating; the query generator further configured to adjust the candidate value based on the calculated cardinality error and further configured to then repeat the evaluating the parametric pattern query against the database with the parameter set to the adjusted candidate value and the calculating the cardinality error until the calculated cardinality error is within an allowable limit. - View Dependent Claims (10, 11, 12, 13, 14, 15)
-
-
16. A computer-readable medium storage device comprising computer-executable instructions that, when executed by a processor, cause a computing device to perform a method for testing a component of a database application, the method comprising:
-
populating, as specified by a user, a column in a database with test data that falls within a certain range specified by the user; specifying, by the user, a desired cardinality constraint suitable for testing the component, the component operating on a computing device, wherein the component is a software component; specifying, by the user, a parametric pattern query that includes a parameter, wherein the parametric pattern query is compatible with the database, and wherein the parametric pattern query is configured to restrict cardinality when evaluated against the database; selecting a candidate value; evaluating, by the computing device via the component, the parametric pattern query against the database with the parameter set to the candidate value; calculating, by the computing device, a cardinality error as a difference between a returned cardinality and the desired cardinality constraint wherein the returned cardinality results from the evaluating; and adjusting the candidate value based on the calculated cardinality error and then repeating the evaluating the parametric pattern query against the database with the parameter set to the adjusted candidate value and the calculating the cardinality error until the calculated cardinality error is within an allowable limit. - View Dependent Claims (17, 18, 19, 20)
-
Specification