Database Testing - Part II

Database Testing mainly concentrates on the following :

1. Data Integrity Test

2. Stored Procedure Test

3. Type Test

4. Data Size Test

5. Event Driven Item Test

6. Input Item Verification

Data Integrity Test .
Actions : Updating / Deletion/ Fresh Insertion / Display of new screen / Time bound actions

Once a value undergoes any of the above actions (Update / Delete / Insert) the database should be verified for the changes performed on related entities

i.e. Foreign Key / Primary Key and all dependent entities .

Stored Procedure Test .

Actions : Updating / Deletion/ Fresh Insertion / Display of new screen / Time bound actions

Every Stored Procedure is to be separately for its functionality (Based on separate functions it performs ) Stored Procedure needs to be broken up into Action Items based on Functions and then Each action items needs to be tested separately as the result of complete Stored Procedure.

Execution may diff from the result obtained by partial execution . This also helps in validating the modularity of code (White Box).

In the case of Stored Procedure , to come up with the test cases one can consider the following…..

The no. of arguments being passed .
The data type of each of the argument being passed .
The order of the argument being passed .
The return value .
The data type of the return value .
Based on these you can write both positive and negative test cases, consider a simple example of a Stored Procedure taking 2 numbers as input and returning the sum of the 2 numbers .


Type Test .

Actions : Updating / Deletion/ Fresh Insertion / Display of new screen / Time bound actions

This test is performed to verify that the data types used by the DBA are same as expected by agreed upon by the developer . Often the data types choosen by the developers are not the same as suggested by the database administrators , especially for the field like….

Phone (Num./Text)
Description (Large Text)
These kinds of mismatches often do not effect the functionality and normal execution of code , but prove to be very Costly during Updating of the Product or during addition of features to the existing modules .

Data Size Test .

Actions : Updating / Deletion/ Fresh Insertion / Display of new screen / Time bound actions

Performance of Data size testing is often done only at the front end during the unit testing , nut it is essential to perform it at back end separately .

This ensure smooth transition while appending functionality and integrating modules as during these Phases , the data is passed to the system with direct user interaction and bypassing front end validation .

Event Driven Item Test .

Actions : Updating / Deletion/ Fresh Insertion / Display of new screen / Time bound actions

Event Driven Action (Triggers or Schedule Actions) needs to be tested on two parameters….

Events that triggers these actions : Here QA needs to check the events on which any of the trigger can get fired/executed . This testing can also be done with the help of DBA also.
Actions performed by above stated events . Here the content of such stored procedure or scheduled actions are verified for the functionality.
Input Item Verification .

Actions : Updating / Deletion/ Fresh Insertion / Display of new screen / Time bound actions

This is the process of e verification of the input items (Though this is not totally a part of database testing , but this is to be performed essentially during Database Testing of the Web Based Application .

Often it is seen that the input items( TextBox /RTB/ Combination Box/ Active X-Controls) are tested for validation only at the front end (Screen testing) but these are again to be tested for Junk Character values to confirm that they do not push in such characters which the databases Often misrepresent or Replace with other Characters (this testing can partially be performed during Unit testing also by the developer .