Friday, March 25, 2011

Database Testing

Database Testing mainly focus on

Data integrity test
Stored procedures test
type test
data size test
event driven item test
input item verification

Data integrity test:
Once value undergoes any of the actions like Update,Delete,Insert.
The Db should be verified for the changes performed on related entries (ie) foreign key, Primary key and all dependent entries.

Stored procedures test:
Every stored procedure is to be tested separately for its functionalities.
Based on separate functions its performs
Stored procedure need to be broken up into actions items based on functions & then each action item needs to be tested separately as the result of complete stored procedure.
Execution may differ from the results obtained by partial execution
This also helps in validating the modularity of code(White box).

Whats needed for Stored Procedure test?
The number of arguments being passed.
The data type of each of the arguments being passed
The order of arguments being passed
The Return value
The data type of the return value

What you will do from this?
Based on these we can categories to write both positive and negative test cases
Example: Consider a Stored procedure taking 2 data as input and returning that with the sum of two data's

Type test:
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 chosen by developers are not the same as suggested by the DBA especially for the fields like Ph
Text/Number),Description(large test)

Data size test:
Performance of data size testing is often done only at the front end during the unit testing, but it is essential to perform it at back end separately.This ensures smooth transition while appending functionality and integrating modules as during these phases.The data is passed to this system with direct user interaction and bypassing front end validation.


Event driven item test:

Event driven actions like triggers or scheduled actions need to be tested on 2 parameters
1.Events that trigger these actions - Here QA needs to check the events on which any of the trigger can get fired /executed. This testing can be done with the help of DBA also.
2.Actions performed by the previously mentioned events. Here the contents of such stored procedures or scheduled actions are verified for the functionality.

Input item verification:
This is the process of verification of the input items.
Even though this is not totally a part of database testing but this has to be performed essentially during database testing of the web based applications.
Often, it is seen that the input items like text box, Rich test box(ideal for content management systems)
combination box and axtive x controls are tested for validation only at front end(Screen testing).
But these are again to be tested with 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).

Essential elements needed for database testing:
Back end table structure is very important thing.
Need to know about database structure and the specification of each table like the size of column and if any primary key.
So we can have a database design document which help us to know the structure the specification might be given in FRS.
Database design documents.
If the tester has the idea about the table structure and design then they can check the performance issues also.
Admin user id & password
Build
Any Application interface – ex – TOAD

No comments: