By Seth Watts—As IDT continues to grow and develop additional automated software testing capabilities, at least one trend seems to emerge: all of our solutions utilize a relational database in some capacity. What benefits do relational databases provide for software in general, and more specifically, for automated testing tools and products?
Benefits to Software in General
The answer to this question might vary slightly from product to product, but there are tremendous benefits to using relational databases in software in general.
Relational databases have been around for 40 years and in that time they have become incredibly stable. Confidence in relational databases can be inferred from their ubiquitousness; they are used to support everything from blogging (casual), to online shopping (financial), to space travel (critical).
The capacity of a relational database is dependent upon the size of the supporting file system, but it is not uncommon to maintain tables with millions of records. There are stories of billion-plus record databases that require over a terabyte of hard drive space.
Relational database transactions are amazingly quick. I was quite surprised the first time that I executed more than a million queries in a negligible amount of time. Often compared against file system transactions, a well-indexed relational database will win, in terms of performance, every time.
In the software industry today, database knowledge is expected of practically all engineers, and most software related degrees require that students take a database class before graduating. Procedures for altering data structures, utilizing constraints (e.g. primary key, foreign reference), and backing-up/restoring data are well documented.
A single transaction in a relational database, regardless if it is composed of a single query or multiple queries, is viewed as a single atomic item. In that respect, the same fate is guaranteed for all of the encapsulated queries. The queries will either all execute or all not execute, preventing an uncertain state resulting from only some of the queries executing.
Ability to Query
An inherent quality of a relational database is the ability to query results based upon some criteria, usually an attribute, value or range. Interaction with a relational database is overwhelmingly carried out using SQL (Structured Query Language), where common operations include INSERT, DELETE, SELECT, UPDATE, CREATE, JOIN, WHERE, and ORDER BY.
Benefits to Automated Software Testing
It is clear that relational databases are useful to persist and interact with data. So how does the use of a relational database specifically benefit automated software testing?
The concept of automation aims to reduce the amount of human influence in a given scenario. As automated software testing evolves, we see a need to establish meaningful connections between data or events, just as a human operator might establish during operation. Examples of this might be to align requirements with behaviors, to reconcile truth data with test data, or to connect multiple events to the same actor. Relational databases provide excellent support for making these connections through mechanisms such as foreign keys, JOIN operations, and customized queries.
There are multiple flavors of automated software testing that range from automating user interface tests to automating analysis of massive amounts test data, and each flavor benefits uniquely from the use of a relational database. Some of these benefits can be demonstrated using one of IDT’s flagship products, ATRT: Analysis Manager, as an example. In ATRT: Analysis Manager, the use of a relational database acts as a data agnostic repository, aggregating data from multiple sources into a single location, which facilitates the comparison of any two data records. A critical aspect of large data analysis is data reduction, which relational databases support through limiting results to only columns of interest (SELECT operation), limiting results to only rows of interest (WHERE operation), ordering the data in a meaningful way (ORDER BY operation), or any combination of the operations.
Often people consider XML as an alternative to using a relational database. In closing, I’d like to share a tip from XML guru Elliotte Rusty Harold, author of Effective XML:
“XML is not a database. It was never meant to be a database. It is never going to be a database. Relational databases are proven technology with more than 20 years of implementation experience. They are solid, stable, useful products. They are not going away. XML is a very useful technology for moving data between different databases or between databases and other programs. However, it is not itself a database. Don’t use it like one.“
Relational databases are tools that can provide tremendous benefit in software development, and furthermore, automated software testing.
Seth Watts is a software engineer at Innovative Defense Technologies (IDT). He is a contributing member of the ATRT: Test Manager and the ATRT: Analysis Manager development teams.