Maybe you won’t ever have to deal with database testing during your career as a QA specialist. Nevertheless, knowing the basics can come in handy someday. So here’s a brief guideline on databases that will help quickly grasp the essentials.
What Is a Database?
A database is an organized collection of data stored and accessed electronically. There are specific rules that define the general principles of data description, storage, and management. These rules are applied for all systems and applications that can use the data from this particular database.
The information from a database is accessed through a DBMS – a database management system. Such system provides ways to modify, extract, and access data for other users and programs. The programming language designed for managing data is known as SQL.
What are Different Types of Databases?
Dozens of database types exist nowadays. Some of the most widely-used ones are the following:
- Relational databases have items organized as a set of tables with rows and columns, providing the most efficient access to organized data.
- Object-oriented databases utilize the data represented in the form of objects, just like it goes in object-oriented programming.
- Datastore databases were designed for quick analysis and query execution.
- Distributed databases store data across multiple computers that can be located in the same physical location or distributed over the network of connected devices.
- Graph databases store data in the context of entities and relationships between them.
- Hierarchical databases utilize the familiar branch structure to manage data.
- Non-relational databases (NoSQL) allow the processing and storage of semi-structured and unstructured data.
- Analytical databases (OLTP) are suitable for a large number of operations performed by different users.
New types of databases appear constantly thanks to the rapidly developing new technologies. Some of them are:
- Autonomous databases.
- Cloud databases.
- Open-source databases.
- Documentary databases (JSON).
- Multi-model databases.
Some of the most popular database software and systems are:
- MySQL.
- Oracle Database.
- Microsoft Access.
- Microsoft SQL Server.
- MongoDB.
- ElasticSearch.
Database Testing Essentials
During database testing, you need to keep good track of data integrity and record updates. It is convenient to organize this information in a table to monitor it effectively.
So, whenever a specific action is performed on the front-end of the application, the corresponding action is called on the back-end. Software testers can use the CRUD mnemonic to check if the records have been updated after each action.
- C (Create): When a user saves a transaction, a database runs the INSERT operation.
- R (Read): When a user views/searches for a stored transaction, a database runs the SELECT operation.
- U (Update): When a user edits an existing record, a database runs the UPDATE operation.
- D (Delete): When a user deletes a record, a database runs the DELETE.
Types of Database Testing
- Structural database testing implies using tables, columns, and database schemas for testing the stored procedures and triggers.
- Functional database testing is about verifying the health of a database from a user’s point of view. It can be white-box or black-box testing.
- Non-functional database testing includes database performance, load, and risk testing, as well as the minimum system requirements analysis.
Basic Attributes of Database Testing
Before proceeding to database testing, you should get familiar with several terms: transactions, triggers, and procedures.
- A transaction is an action with a database that leads to positive or negative results.
- A trigger is a special type of stored procedure automatically executed after certain data modification actions.
- A procedure is a set of statements or functions that control transactions in a database.
Database Test Scenarios
- Now, let’s move to the practical tips. Below, you will find some examples of what to check when working on database testing. These are the basic test scenarios you will most certainly need to use.
- Write requests and execute them through the user interface.
- Delete or move an existing cell with information.
- Find an existing entry in a cell, change it, and save the entry.
- Check the log file for failures or errors.
- Check the number of transactions for a specified period.
- Check the number of rows read in the table per transaction.
- View an average number of sorting operations.
- View the name of a procedure, as well as the names, and types of parameters.
- Check the signal at the output (whether an output of zero lines is performed or only a few records are shown).
- Check the function of the stored procedure.
- Check the authenticity of the trigger name and its updates.
- Run a trigger with updated data.
- Check functions, such as update, insert, and delete triggers.
- Check data types by viewing the values of the fields.
To Sum Up
Of course, every product comes with a list of things to check in a particular database. Nevertheless, if you understand the basic principles of database testing, you won’t have problems dealing with more specifics. So start by learning the terminology and preparing a set of general test scenarios that suit different projects.