SQLRules Desktop V1 - Coverage Evaluation for SQL Database Queries

SQLRules Desktop is a standalone application for evaluating the coverage of SQL database queries (see SQLRules). Coverage criteria are implemented in a set of rules, that when evaluated with respect to a given database determine the coverage of the database with respect to the query.

NOTE: This version (V1) is deprecated. Please, use the new Version 2.



Download here the latest version. Next, unpack the ZIP file. The following filles will be present in your directory:
After running it for the first time, the following files are generated:

First at all, you must be sure that you have your database running and the appropriate jdbc database driver is in the classpath (or in the folder where the application has been unzipped). Below are some direct links to download the drivers for some databases (maven):

Quick Start

Launch the main class of sqlrules.jar using the following java command (where drivername.jar is the name of the vendor's database driver file. Note that you don't need specify a driver name if your are going to use the jdbc-odbc bridge driver):

java -classpath drivername.jar;sqlrules.jar in2test.application.sqlrules.SQLRules

Alternatively, you may edit the sqlrules.bat script file specifying this command and then run the script.

The following window will be displayed:

SQLRules main window


Specifying query parameters

Parameters in a query may be specified using one of the following syntax (:name or ?nn?). The first one is the oracle-style syntax for named parameters and the second one is the syntax used by SQLMutation and SQLFpc. The actual values that are to be used when running the rules are specifyed in the Parameters section. The following is an example of two parameters ?1? and ?2? with actual values 3 and 'X' respectively:

    <parameter name="?1?" value="3" />
    <parameter name="?2?" value="'X'" />

Note that character values must include single quotes as same as in sql statements.

Generating and running rules

The first required step is to generate the schema by clicking the Generate Schema button, which generates the database schema for the tables and views involved in the query.

After selecting the kind of rules to be generated (Full Predicate Coverage Rules or Mutants) you will click the Generate Rules button. The web service that generates the rules is invoked and then the rules appear in the Rules/Mutants section (xml format at the top and tabular format at the bottom). If some problem occours in the generation the <error> tag including the error message appears in the xml format.

For each rule, the information presented is:

Once that the rules have been correctly generated, the button Run Rules executes each one using the loaded data in the database and determines if it is covered or not:

For each rule, the results of the execution are:

The total count of rules, dead rules or rules with error appears under the tag <summary> in the Rules/Mutants section.

Other available options:

Specifying connection info

The information required to access the database is explained below:

XML database schema syntax

The schema content is definde as indicated in the OpenApi specification (see DbSchema, DbTable and DbColumn in the Schemas section):

The schema may include three attributes, namely:

Both catalog and schema attributes are optional. However, they are relevent in order to determine what tables are to be found. Recall that according to the SQL Standard, a table specification may be qualified in the form [[catalog.]schema.]name. If a table name is not qualified (using catalog and/or schema), a default catalog and/or schema is assumed. In that case the deafaults are the indicated by dbcatalog and/or dbschema:

Supported database vendors and drivers

Latest builds of these applications has been tested with Java 1.8 on Windows and linux

As it uses standard jdbc methods to discover the database schema, it will work with virtually any database vendor, provided that you have the appropriate jdbc driver.

Some rules and mutants may fail when running under MS Access because of some non standard syntax features of MS Access SQL


Release notes

Version Date Changes
3.0.2 2022.05 Uses the new version of the sqlrules services api (V3) 2017.03.11 Changed library to generate Visual Comparison 2017.02.25 Java 6 to 8 compatibility 2012.11.25 spr.25312: Query without order by is invalidated when running mutants for SQLServer 2011.08.29 spr.25057: Oracle timestamp column name returned as TIMESTAMP(6)
1.0.65 2010.05.03 Added query timeout
Connection recovery from ORA-12152 Oracle errors
1.0.63 2009.08.05 Added visual comparison of queries
1.0.57 2008.07.31 Initial release