The Test Harness

The 'Test Harness' is comprised of a series of almost 200 SQL script files that allows the creation of multiple scenarios for SQL statement comparison. It's part of a course "intended to teach students a repeatable and reliable method for optimizing SQL..."

In fact, it's not really an application - it's just a very complicated set of SQL script files run on the command-line inside Sql*Plus. While effective, it is, in my opinion, very, very 'klunky'. The number one request in these classes has been for a UI version. More information about the course may be found here. (It's an excellent, course by the way.)

It was my job to transform this command-line method of executing SQL statements and displaying test results into a rich UI extension inside Oracle's free SqlDeveloper IDE. Only problem, there's hardly any SqlDeveloper API documentation. Actually, there's none at all. (Ah... but there are sneaky tricks around that obstacle.)

I'm happy to say, most of the hurdles have been crossed and I have transformed the command-line version of this...

harnesscommandline

...into this...

harnessui

The application is not finished but the framework has been finished and the rest is mostly a matter of UI plumbing and polishing. What I'm most proud of is none of the underlying database schema objects needed to change for the UI version. In other words, a user could choose to use the command-line version or UI version on the same connection.

There are many existing dba, power-users who may prefer the command line version, you know how dba's are, and I didn't want to affect those users. I also didn't want to essentially maintain two sets of scripts for the same application. So I was a concerned that I may have had to make modifications to the UI version that were separate from the command-line version.  This would have been unfortunate, as it would make the applications much more difficult to maintain.

Luckily, I was able to architect the UI version so that there was no impact on the command-line version. Additionally, it's possible changes may be made to either version with little impact on the other.

All the script files and their containing SQL were transformed to a series of 'QuerySteps' organized into 'QueryGroups' which are initialized from xml files. What this means, for the most part, is that the underlying queries, and their order, may be subject to modification and the UI may quite possibly not ever be touched. Of course, if there's a major change in functionality, I may need to address that, but for the most part, the queries may be modified, inserted, or rearranged and only the xml would need to be touched. The underlying code would not need any modification.

8/12/2008 | Comments (0) in Java | SqlDeveloper
Email