Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database testing Prepared by Saurabh sinha. Database testing mainly focus on: Data integrity test Data integrity test Stored procedures test Stored procedures.

Similar presentations


Presentation on theme: "Database testing Prepared by Saurabh sinha. Database testing mainly focus on: Data integrity test Data integrity test Stored procedures test Stored procedures."— Presentation transcript:

1 Database testing Prepared by Saurabh sinha

2 Database testing mainly focus on: Data integrity test Data integrity test Stored procedures test Stored procedures test Type test Type test Data size test Data size test Event Driven item test Event Driven item test Input item verification Input item verification

3 Data integrity test Once a value undergoes any of the below actions Once a value undergoes any of the below actions (Update, Delete, Insert) (Update, Delete, Insert) The Db should be verified for the changes performed on related entities (ie) foreign key, primary key and all dependent entities. The Db should be verified for the changes performed on related entities (ie) foreign key, primary key and all dependent entities.

4 Stored procedures test Every stored procedure is to be tested separately for its functionality Every stored procedure is to be tested separately for its functionality (Based on separate functions it performs)‏ (Based on separate functions it performs)‏ Stored procedure need to be broken up into action items based on functions & then each action item needs to be tested separately as the result of complete stored procedure. Stored procedure need to be broken up into action items based on functions & then each action item needs to be tested separately as the result of complete stored procedure. conti ….

5 Execution may differ from the results obtained by partial execution. Execution may differ from the results obtained by partial execution. This also helps in validating the modularity of code (White box)‏ This also helps in validating the modularity of code (White box)‏

6 What is needed for Stored procedure test ? The number of arguments being passed. The number of arguments being passed. The data type of each of the arguments being passed The data type of each of the arguments being passed The order of arguments being passed The order of arguments being passed The return value The return value The data type of the return value The data type of the return value

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

8 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 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 Often the data types chosen by developers are not the same as suggested by the DBA, especially for the fields like Ph (text / Number)‏ Ph (text / Number)‏ Description ( large text) Description ( large text)

9 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. 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 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 The data is passed to this system with direct user interaction and bypassing front end validation

10 Event driven item test Event driven actions like Triggers or scheduled actions need to be tested on 2 parameters 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. conti……

11 2. Actions performed by the previously mentioned events. Here the contents of such stored procedures or scheduled actions are verified for the functionality

12 Input Item Verification This is the process of verification of the input items. 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 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 text box (ideal for content management systems), box and Active X controls are tested for validation only at front end (screen testing)‏ Often, it is seen that the input items like Text box, Rich text box (ideal for content management systems), Combination box and Active X controls are tested for validation only at front end (screen testing)‏Conti………

13 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 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

14 Essential elements needed for database testing Backend table structure is very important thing. Backend 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 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 ( Functional requirement spec)‏ So we can have a database design document which help us to know the structure the specification might be given in FRS ( Functional requirement spec)‏ cont ……

15 Database design documents Database design documents If the tester has the idea about the table structure and design then they can check the performance issues also If the tester has the idea about the table structure and design then they can check the performance issues also Admin user id & password Admin user id & password Build Build Any Application Interface – ex -TOAD Any Application Interface – ex -TOADcont….

16 DSN Name Data source name (DSN) Data source name (DSN) A data source name (DSN) is a data structure that contains the information about a specific database that an Open Database Connectivity ( ODBC ) driver needs in order to connect to it. A data source name (DSN) is a data structure that contains the information about a specific database that an Open Database Connectivity ( ODBC ) driver needs in order to connect to it. Included in the DSN, which resides either in the registry or as a separate text file, is information such as the name, directory and driver of the database, and, depending on the type of DSN, the ID and password of the user. Included in the DSN, which resides either in the registry or as a separate text file, is information such as the name, directory and driver of the database, and, depending on the type of DSN, the ID and password of the user. The developer creates a separate DSN for each database. To connect to a particular database, the developer specifies its DSN within a program. The developer creates a separate DSN for each database. To connect to a particular database, the developer specifies its DSN within a program.

17 What is way of writing test cases for database testing? 1. Understand the functional requirement 2. Find out the back end tables, joins, cursors, triggers, stored procedures (SP), input and output parameters used 3. Write the test case with different input values for checking all the paths of SP. 4. Writing test cases for database testing is not Black box testing. It is white box testing.

18 How to test database procedures & Triggers ? Requirements should get from developer Requirements should get from developer Understand the input and output of the Procedures / Triggers. Understand the input and output of the Procedures / Triggers. Execute the Procedures & Triggers and update the results. Execute the Procedures & Triggers and update the results.

19 What steps does a tester take in testing stored procedures? Understand the requirement of SP Understand the requirement of SP Check whether all required indexes, joins, updates, deletions are correct by comparing with the tables mentioned in the stored procedures Check whether all required indexes, joins, updates, deletions are correct by comparing with the tables mentioned in the stored procedures Ensure that whether the stored procedure follows the standard format like comments, updated by etc. Ensure that whether the stored procedure follows the standard format like comments, updated by etc.cont….

20 Check the procedure calling name, calling parameters and expected responses for different set of input parameters Check the procedure calling name, calling parameters and expected responses for different set of input parameters Run the procedure thru database client programs like TOAD or query analyzer Run the procedure thru database client programs like TOAD or query analyzer Rerun the procedure with different parameters and check results against expected values. Rerun the procedure with different parameters and check results against expected values.

21 Thank you


Download ppt "Database testing Prepared by Saurabh sinha. Database testing mainly focus on: Data integrity test Data integrity test Stored procedures test Stored procedures."

Similar presentations


Ads by Google