Software Testing Learning Hub

Why Database Testing is important? How is Database Testing done?

Now a days most of the software uses the database to stored the data. software retrieves or modify this data on the request of the end user or administrator of the application or website.

we can stored any kind of data like banking data, user information, transactions, logs and many more in to the database. database is used to make software more dynamic and effective to respond to the end user request.

here are some bullet points about the importance of database testing.

  • Data is important asset of the software
  • functionality can be controlled by values in the database.
  • under optimized database design leads to major functionality failure.
  • Incorrect or inefficient or badly written SQL queries can also lead functionality failure
  • Integration testing usually does not focused on the database which may cause several issues on database side

by now i am sure that you can understand the importance of database in the application and also need for testing as well.

Lets see how to do the Database testing…

Following are different ways to conduct the database testing.

1) Unit Test Level: Here we can test the Stored procedures as an unit like same what we do for the code.

2) Black Box Level:  This can be done during your functional Test execution but focus of conducting the tests should be from database point of view. you have to make sure that different set of values needs to be used in the test so that it can give some different results lets take an example, for entering the numeric value try to give large number of digits such as 9999999999999999999999 etc which is acceptable but from database front that much digit provision is not made so in database that value gets truncated and test will gets failed.

During test execution make sure that stated values are getting stored in proper tables or not.

3) White Box Level:  This is also inline with Unit testing but one step further to it. you need to conduct code reviews of stored procedures and write the white box test cases to make sure that stored procedures are working as expected along with it make sure that stored procedures are well optimized and take less time to execute.

 4) Data Type Tests: As you know from front end we can enter any type of data to an input fields. not limited to numeric or alphabets but also multilingual data. so during testing make sure that database field has correct data type or not else it may lead to Loss of Data or truncation of Data.

5) Data Integrity and Consistency Tests: These tests consists of different operation on data to make sure that Data is integrated correctly and giving the consistent and correct results. you need to conduct ADD/MOD/DEL operations on the application under test.

6) Event Based Tests: Trigger Testing ans effect of actions written in the trigger comes in these tests.