Saturday, 29 November 2014

A Comprehensive guide to learn Database Testing

Here in this blog we will learn about Database Testing, its types and its importance. Database testing in equally important as GUI testing because of the reason that all data retrieved on interfaces are fetched from databases so to validate the correct behavior of application database testing is necessary.

This comprehensive blog will make readers understand about database testing in details it is recommended to take some professional training to gain practical knowledge of testing databases. QACampus institute in Noida is one of the best place from where aspirants can get a practical training for database testing with advance automation tools.

Database Testing :

Database testing is the process of testing data accessing, data integrity, query retrieving, updation, deletion and modifications, etc.

In most of the cases GUI testing is given more importance by the testers and developers as it is the visible part of application. However there is another important part i.e DATABASE that needs to be tested and validated properly as all the data or information are stored in database.

To understand it properly let us take an example of Banking application where a number of users make transactions. From the point of database testing the below mentioned points needs to be followed and tested :
  • The transaction information is stored in the application's database and displays them in a correct manner whenever requested by the user.
  • Not information should lost in transaction process.
  • Application should not save any partial or aborted operation's information.
  • Any unauthorized access of user's information will not be permitted by the application.

To ensure all the above mentioned objectives a data testing or data validation needs to be done.

Database Testing Types :

There are three types of Database Testing :

1. Structural Testing
2. Functional Testing
3. Non-Functional Testing

1. Structural testing

In this testing all the elements inside data repository which are used for data storage and do not allow to be manipulated directly by the users are to be validated. In such testing types database servers validation is also an important consideration. This test requires a very good knowledge of SQL queries. The test includes :

(1) Schema testing

The main objective of schema testing is to ensure the similarity between back-end and front-end in schema mapping. Thus it is also known as mapping testing.

(2) Database table/column testing

During this test it is to be ensured that columns and database fields in front-end is compatible with back-end fields. Naming conventions and length of database fields are validated according to the requirement.

(3) Keys and indexes testing

During keys and indexes testing it is to be checked whether the required
 primary as well as foreign key constraints have been created properly on required tables.
 Also the validity of foreign key references have been checked.

(4) Stored procedures testing

While performing stored procedures testing it is to be ensured that validation for coding standard conventions, exceptions and error handling and all the loops/conditions needs to be done to ensure whether the development team adopted these required standards or not.

(5) Trigger testing

This test is to be performed to ensure whether the specified coding conventions have been followed by the developers while coding the triggers. Also it has been validated that required insert, update, delete triggers are functioning properly according to the expectations.

(6) Database server validations

This test has been performed to ensure the required database server configuration, authorizing the user to perform only the required actions and to allow the maximum number of transactions as specified by the requirement specification.

2. Functional database testing

The functional database testing is the process of ensuring the steadiness of end user's operations and transactions with requirement specifications.
  • Make sure that field should be mandatory while allowing NULL value in that field.
  • Make sure that length of each field should be of sufficient size?
  • Make sure that all similar fields have similar names across the complete tables?
  • Make sure for any computed fields exists in the Database?
This process is the validation of field mappings from end user's viewpoint. During this scenario, the tester perform an operation at database level and then navigate to the relevant user interface item to check whether all the field validations have been implemented or not.

The vice versa test has been followed by the tester where first an operation is carried out at user interface and then the same is verified from the back end.

Following are some points which needs to be considered for database validations.
  • Checking data integrity and consistency
During this process it is to be ensured that data should be logically organized, the stored data in the respective tables is correct and the data must be stored as per the requirement specifications.
  • Login and user security
In this testing process the login and security credentials needs to be validated to prevent unauthorized login/access and to validate whether the user is permitted to perform only the operations which are specified in business requirements. Also it has been checked that the sensitive data like passwords, credit card details and other transaction details are encrypted properly and not able to access by the unauthorized user.

3. Non-functional testing

Non-functional testing for database testing are categorized into different categories such as usability testing, security testing, stress testing, load testing and compatibility testing. The stress and load testing comes under performance testing and serves two purposes during non-functional testing.
  • Risk Analysis : It actually helps to determine the various system response time requirements under specified loads. Since load testing cannot reduce risk directly but risk identification and determination processes provides opportunities to reduce risks.
  • Minimum system configuration requirement : Through formal testing, the minimum system configuration requirement that can meet the performance goals will be analyzed. Through this software, hardware and associated cost can be minimized.
  • Load testing : This testing is the process of testing through which system's behavior have been checked under varying load. It help the tester to identify maximum capacity of database and the bottlenecks in database which are causing problems.
  • Stress testing : Stress testing is the process of identifying the strength of the application under heavy load and to check how application will handle the increased load. Through this database robustness, availability and error handling capacity can be checked.
Conclusion :

The above mentioned theory is enough to understand in brief the database testing, different types and the importance of database testing. All the above mentioned considerations are important to perform a database test for ensuring its correct behavior, operations and proper mapping with user interfaces.