QAShrink - Query-Aware Shrink Test Databases

QAShrink is an application for reducing the size of a database. It starts from considers an initial database and the set of queries that are executed against it. The database is reduced in order to preserve the SQLFpc coverage (Full Predicate Coverage or MCDC) of the data with respect to the queries.

This tool is described in the following papers:



Download here the latest version of QAShrink. After, 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 adequate jdbc database driver is in your default directory. Here you can find the drivers for some databases:

Quick Start

Launch the main class of qashrink.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;qashrink.jar in2test.application.qashrink.QAShrink

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

The following window will be displayed:

QAShrink main window

Procedure to generate the reduced database:

Reducing the database

When clicking the Do Shrink button, the reduction process begins. Because this process may take some time, it is executed in a separate thread while showing progress information to the user. Do not press any key until the process finishes.

Afther finishing, all the results of the process are presented at the lower part of the screen.

Populating the destination reduced database

After the Shrinking has been done, you must specify where the reduced database will be created by filling the Destination Reduced Database field. This field must include the full database name (catalog and schema). For instance, in Oracle it is the name of the database user, in SQL Server it is the name of the database, a dot, and the owner (which usually is dbo).

You have two different options:


Specifying connection info

The information required to access the database is explained below:

Supported SQL Syntax, database vendors and drivers

Currently DBShrink supports most of features of SQL (tested with Oracle and SQL Server), including queries with joins, groups, subqueries and views.

Latest builds of these applications has been developed and tested in Eclipse 4.3.2 using Java JDK 1.8 and JavaCC 4.2 under Windows 10, but may run on lower JRE versions.

As it uses standard jdbc methods to discover the database schema, it will work with virtually any database vendor, provided that you have a jdbc driver. As of Java JDK 1.8 the jdbc-odbc bridge is not supported, you should run a lower version of the JRE in order to use it.

This is the list of configurations that have been used for testing latest builds:

Database Product NameVersionDatabase Driver NameVersion
Oracle 11g Enterprise Oracle JDBC Driver
Microsoft SQL Server 2008 10.00.5500 Microsoft SQL Server 2005 JDBC Driver 1.2.2828.100

Release notes

Version Date Changes 2017.02.25 Java 6 to 8 compatibility 2015 Version 2.0 2013 Version 2.0 beta. It supports views, groups, subqueries and reduction optimizations 2009 Initial release