Italian Trulli

Database Testing Tutorial with Example : Sample Test Cases

Test Tribe
.

 Database Testing Tutorial: How To Test Database?

What is Database Testing?
Database Testing is a type of software testing in which test engineers test the schema, tables, triggers, etc. of the Database under test. Database testing also includes performing data validity, data integrity testing, and performance checks related to the database.

Database Testing: Environment Setup
Step 1 Download and install any SQL (MySQL, SQL Server).
Step 2 Download SQL sample database. 


Database Testing: Schema Testing 
How to Test Schema of Database?. 
  • Check table presence in the database schema.
  • Check table name convention.
  • Check the number of columns in the table.
  • Check the column name in the table.
  • Check the datatype of the column in the table.
  • Check the size of the column in the table.
  • Check the null field in the table
  • Check the column key in the table
Show table: Used to display the table available in the database(MySQL).

Describe Statement: Describe used to describe the structure of the table.

Syntax
Describe employee;

Use Statement 
The SQL USE statement is used to select any existing database in the SQL schema.

Syntax
Use databasename;

How to Get the Number of Columns in a table?

How to get all column names from a table?

How to get the datatype of the column in a table?

how to check the column size in a table? 

How to check the null field in a table?

How to check the constraint in the table? 

Types of Database Testing
Below the list of database testing is given.
  • Structural Database Testing
  • Functional Testing
  • Non-functional Testing
Lets, Understand each type one by one.
Database Testing with Examples



Structural Database Testing
Structural Database Testing is a database testing technique that deals with table and column testing, schema testing, stored procedures and views testing, Checking triggers, etc.
  • Schema / Mapping Testing
  • Stored Procedures and Views Testing
  • Trigger Testing
  • Tables and Column testing
  • Keys and indexes testing
  • Database Server Check
Functional Testing
Functional Database Testing is a type of database testing that is used to validate the functional requirements of a database from the end-users perspective.
Example:
  • Check that the field is mandatory while allowing NULL values on that field? 
  • Check that the length of each field is of sufficient size?
  • Check that all similar fields have the same names across tables? 
  • Check that there are any computed fields present in the Database?

Non-functional Testing
Non-functional Testing is a database testing technique that load-testing, risk testing in the database, stress testing, minimum system requirements, and dealing with the performance of the database.

Here some of the important parts of non-functional database testing are listed below:
  • Load testing 
  • Stress Testing 
  • Security Testing 
  • Usability Testing 
  • Compatibility Testing

What to Test in Database Testing (checklist)?
  • Transaction 
  • Database Schema
  • Trigger
  • Stored Procedure (SP)
  • Constraints
  • Table and Column

How to Test Database?
General Steps for database testing are listed below.
  • Step 1) Prepare the environment 
  • Step 2) Run a test 
  • Step 3) Check the test result 
  • Step 4) Validate according to the expected results 
  • Step 5) Report the findings to the respective stakeholders
Database Testing Tools
Some of the important database testing tools are listed below.

  • Database Benchmark 
  • Database Rider 
  • Db stress 
  • DbUnit 
  • DB Test Driven 
  • HammerDB 
  • JdbcSlim JDBC (Java DataBase Delta Testing) 
  • Nbi 
  • NoSQLMap 
  • NoSQLUnit 
  • ruby-plsql-spec 
  • SeLite 
  • sqlmap 
  • tSQLt 
  • Tsung 
  • utPLSQL
What is ACID properties validation in database testing?
  • Atomicity
  • Consistency
  • Isolation
  • Durability

Test Cases for Database Testing: Database Testing Scenarios

What are the Test Cases For Database Testing?

Here, Important Test cases for database testing are given...
  • Verify whether data getting saved in the database column properly or not when the user clicks on the save button.
  • Check whether the data is saved in a defined column and table or not. 
  • Verify the database name.
  • Verify the name of the log file. 
  • Verify the disk space allocation for databases. 
  • Verify the names of all tables, columns, and their types. 
  • Verify the null value checks. 
  • Verify the keys (primary/foreign), indexes, and data types of columns used.
  • Verify the primary key for the table is created or not.
  • Data should be rolled back in case of failed transactions.


Hope!!! The above Tutorial on Database testing is helpful for you...

Team,
QA acharya

Tags: Database testing tutorial with example, Test case for database testing, Database testing test cases, tool for database testing.

Databases Testing Tutorials



Post a Comment

0 Comments