DataBase Testing: Best Practices

Posted on Apr 8 2009 - 10:04am by Raj

Why Data base testing is needed?
•  To check if the data has been inserted/Deleted/Modified in the database
•  Validate the Database integrity in the database
•  Check the performance of the database and design the database to improve performance
•  Check the database privileges for different users
•  Check if the data displayed in the front end is same as that of the back end.
•  Check for Data loss
•  Check the Database Flags
•  Database Tuning
•  Check for Data security that is Encryption and Decryption
Skills Requirements for Database Testing
•  SQL Queries, Joins
•  RDBMS concepts
•  PL/SQL basics
•  DB Connection procedure
•  Understand ER diagram
•  Understand Table structures and Data types
•  Data type in front and back end should be mapped and compatible.
•  Knowledge of Tool to access database using TOAD
(Tool for oracle application development)
•  Data migration
Data base Tuning
•  Check the Data types used in the Table design
•  Check if stored procedures are used which can enhance performance
•  Check the database queries used for fetching data from the data base, for eg: developer might have used a subquery which is time consuming than a simple join
•  Check the size of the database which can be split into separate tables
Is the query specific to the field requirement
•  Data base server has the right hardware requirements?
Problems due to network bandwidth
Database testing for Web applications
Web applications have more dynamic content
Can be text based, tabular and graphical information on the web page.
For Eg: Stock or mutual fund
Steps performed in a web based environment
•  Query the database
•  Relevant data extracted from the database
•  Extracted data must be organized as content object
•  Content object should be displayed on the web page
•  Database Testing a web based application is crucial to ensure the following
1) Avoid hang in the middle of a transaction
2) Poor usability
3) Avoid frequent downtime
4) Reduce turn around time for processing a transaction by the webserver
5)Load all the content objects to the client interface irrespective of the browser types.
Challenges in Testing Web based applications
In a web based application the database server is not directly connected to the client. The database is often in a remote environment. Client side request is rarely presented in the form(SQL) that can be input to the DBMS TestCases need to be designed to uncover errors during the communication between the WebApp and the remote database. So test cases need to be designed to uncover errors in the content object format. Testing can become complicated in a distributed Database environment.
Automated Database testing
Tool Shows the differences and can report the defect to the developer
Tools Used are
Silk Test (Borland)
Perl (Open Source Software)
Python (Written in ‘C’ : Freeware software for all VB,.Net and Java applications)
Best Practices
•  Include Database testing in the Test Plan
•  Estimate for Database testing
•  Naming convention for Table name for eg: tbl For View vw
•  Assign Primary key and define proper relationships
•  Perform Multiuser tests
•  Perform Database tuning
•  Normalized database
•  Create Users and proper privileges to users
•  Perform Security testing on database
•  Risk Mitigation for Database Crashes
•  Refresh Database while testing the DB

About the Author

Leave A Response