Professional Documents
Culture Documents
Basic Database Testing
Basic Database Testing
Basic Database Testing
GuyFromChennai.com Kumar S
Check Valid Connection
Connection validation is especially important in real time applications, which must run
with no or minimal downtime. test is performed to verify the database connection is
active/up. In fact, there can be various situations where a connection can be lost
(e.g., because a database is down or there are some network problems). We can test
this with two approaches.
Using Vendor specific API
Test-Fail query approach.
GuyFromChennai.com Kumar S
Check Valid Connection
Action
Select the Connection string with the required credentials
Execute the connect Factory Method
Test the returned value(s) for successful connection.
If the exception corresponds to a closed connection, try to re-establish a connection
and re-execute a query.
If the same exception is thrown, then try connecting to the failover database.
GuyFromChennai.com Kumar S
Data Type Validation
Action
This test is performed to verify that the data type used by the DBA are same
as expected.
Check the received values with the no of expected values
If the No of values match then
Check for the data type with the fields' data type
If data types match then
allow the actions like Insert, Update
Else
throw exception
Else
throw exception
GuyFromChennai.com Kumar S
Input Verification
Action
This is the process of input data validation. Though it is not totally a part of database
testing, this has to be performed essentially during database testing.
The input items are tested for validation in the front end
Check if the Maximum field length is correct
Check for any junk/special characters in the input
If any of the above fails
throw exception
GuyFromChennai.com Kumar S
Data Integrity
Action
This test is performed when anyone of the data undergoes any of the actions below,
Insert
Update
Delete
After the actions mentioned above, the db should be verified for the changes performed
on related entities such as
Primary Key
Foreign key
and any other Dependant entities
If there is any error/mismatch , then rollback and throw exception
GuyFromChennai.com Kumar S
Backup & Restore
Action
This test is performed to ensure the backed up data is valid and accurate
Backup the whole database schema
try creating another schema
Import all the data from the backup
Check the data is accurate and same as the source database schema
Check the No of tables and table columns are the same
Check the rows are the same as the source schema
If any mismatch then throw exception
GuyFromChennai.com Kumar S