You are on page 1of 16

White Paper On Database Testing Approach

(Job Jar Unique ID: ITP-CAP-Testing707)

Presented by Vishweshwar Rao.V

1 Contents
1. Introduction ............................................................................................................................................... 4 1.1 Background .......................................................................................................................................... 4 1.2 Goal and Objectives of Database Testing ............................................................................................ 4 2. FIG: Data base testing Flow Diagram: .................................................................................................. 6 3. Database testing Estimation .............................................................................................................. 7 3.1 Database testing with in Scope ............................................................................................................ 7 3.2 Database testing out of Scope.............................................................................................................. 7 3.3 Database testing prerequisites ............................................................................................................. 8 4. Database Testing Approach ................................................................................................................. 8 4.1 Creation of Database Test Plan: ........................................................................................................... 8 4.2 Creation of Database Test Scripts: ....................................................................................................... 9 4.2.1. Database integration testing ............................................................................................................ 9 4.2.1.1. Test the schema objects: ................................................................................................................ 9 4.2.1.2. Verify that all constraints are in place. ............................................................................................ 9 4.2.1.3. Verify the data elements are created as per Database model diagram .......................................... 9 4.2.2. Database Security testing ................................................................................................................ 9 4.2.2.1. Authentication and Authorization .................................................................................................... 10 4.2.2.2. Roles and Privileges ....................................................................................................................... 10 4.2.2.3. Database Vulnerability .................................................................................................................... 10 4.2.3. Database Performance testing ........................................................................................................ 11 4.3. Database Test Script Execution ......................................................................................................... 12 4.4. Review Database Test Results ........................................................................................................... 13 4.5. 5. 6. 7. 8. Preparation of Database Test Report ................................................................................................. 14 Database Closure ............................................................................................................................... 14 Database Testing Tools ...................................................................................................................... 14 Risk and Contingencies ...................................................................................................................... 15 Hardware & System Environment setup ............................................................................................. 15

8.1 Hardware .............................................................................................................................................. 15 8.2 Software ............................................................................................................................................. 15 8.2.1 Server Configuration: ......................................................................................................................... 15 8.2.2 Client Configuration: .......................................................................................................................... 15 Appendix A: Review and Sign-off ............................................................................................................... 15

Document Title: File Name: Author(s):

Teradata View Point for Analysis and Testing Database Testing Approach Vishweshwar Rao.V

Reviewed By: Version 1.0

Document Revision History

Version 1.0

Date 02/04/2012

Changed By Vishweshwar Rao.V

Change Creation

1. Introduction The primary goal of this document is to establish an approach to Database testing. It defines the general approach that will be used for testing the Database and to evaluate the results of testing, and is the top-level plan that serves as a guideline for the software quality assurance process. The database testing of applications is crucial for ensuring high software quality as undetected faults can result in corrupted data. This document purely talks about the goals and object of database testing, approach for database testing, database testing prerequisites, In-scope of testing, out-scope of testing, Entry and exit Criteria for database testing. 1.1 Background The database testing of an application can be broadly partitioned into the test cases generation, test data preparation and test outcomes verification. At a high level database testing is to validate the integrity of the data, authentication of the database, to test the volume data flow. All these are based on client requirement. A project requires Database testing when below activities are to be performed: Database migration. ETL (Extract, Transform and Load data). Changes in Database model or structure. Business needs are changed from database prospective. 1.3 Goal and Objectives of Database Testing Testing the applications in order to ensure high software quality with efficient and effective software testing, data handling is crucial within the software development .Testing of database applications is of great importance in both the development and Production phase since undetected faults in these applications may result in incorrect modification or accidental removal of crucial data. Once the data are mistakenly modified, the error may propagate and lead to more data corruption if it is left undetected.

Objectives: Analyzing the requirements. Analyzing the data base i.e. data model. Data flow and data schema. Document your Actual and expected understandings from database testing perspective. Identify testing phase objectives specified and prioritize. Set up the Data base Testing environment. Generate test data by providing logical description of how you will extract, transform, and load the data Prepare Database related test scripts. Log the Defects identified and document into the standard template Manage the defect tracking sheet. Generate and analyze test Result Reports after completion of testing. Preparation and proving the Database testing Sing-off document.

2. FIG: Data base testing Flow Diagram:

3. Database testing Estimation Estimating the efforts for the database testing is relatively similar like, estimating the functionality or performance. Various factors considered during the database testing are as follows. 1. 2. 3. 4. 5. 6. 7. Database testing test Plan Database testing strategy Environment setup Test data generation Database test scripts and test Results Defect Report Database test closer Report( Database test Sign- off doc)

3.1 Database testing with in Scope a. Database integration testing Validating all objects, Schema and data in destination database Validating the data at each phase Validating reports from source vs. destination Performing functional testing of the end-state systems after all migration and consolidation System Integration testing i.e. end to end testing (to validate the flow of data from front end to back end)

b. Database security testing Validating Businesses Role based testing Input checking and validation SQL insertion attack testing Pre encoded Attack testing c. Database performance testing Performance tuning Database optimization Testing concurrency Testing database growth based on real time situation information provided. 3.2 Database testing out of Scope 1. Database testing during maintenances phase. 2. Database testing for change request. 3. Data base testing for Business rules provided after Assessment phase

4. All activities not mentioned in the In Scope section.

3.3 Database testing prerequisites Following are some of the prerequisites needed for database testing Data model, table structure of the database should be provided. Mockup documents or diagrams on database should be provided. The database migration document should be provided. Database requirements should be specified and documented. Role and privilege document should be provided. SLA (Service Level Agreement) should be provided. 4. Database Testing Approach Database testing Approach provides the information on methodology followed for database testing to ensure software quality is provided along with finding the defects from the database and removed at the early stage. 4.1 Creation of Database Test Plan In this process you should define your inputs and outputs by documenting record layouts. You should also identify and define your location of source and target, file/table sizing information, volume information, and how the data will be transformed. Understand what the data combinations are and define what results are expected. Include error checks. Decide how many test cases need to be built. Look at technical risk. Test business requirements by Understanding the data flow. The test objectives are prioritized and scope is approved. Entry Business Requirements, Functional Requirement Inputs Task Analyze the requirements -scope and out-scope activities Prioritizing the activities. Verification/Validation Database Test Plan Review Database Test plan Outputs Completion of Database test plan and taking approvals Exit

4.2 Creation of Database Test Scripts 4.2.1. Database integration testing Database Integration testing examines the interaction of each component of the system. Consider the following factors for writing scripts on database integration testing Test the schema objects: The type and number of each object in the original database has to be compared to that in the Target database. Queries can be written in the two databases to produce a count of each type of object, write a query in both the database to check the values and objects match the source and destination. Following Schema Objects will be tested: Tables Schema Validation Functions Triggers Stored Procedures Views. Constraints 4.2.1.1. Verify that all constraints are in place. For each table having a parent-child relationship, Referential integrity is to be checked. 4.2.1.2. Verify the data elements are created as per Database model diagram Check for the proper transformation of the data type and domain values of the columns, any constraints, such as NULL and CHECK constraint on the columns have to be verified before performing the data migration. A representative set of data from the original database can be used for this purpose. If the application has been migrated, running a few frequently used business transactions would ensure whether the schema has been successfully migrated. Check the Number of Records and their content in each table in Pre and Post Migration Test the Stored Procedures, Functions and Triggers which are very critical to the Business. Migrated Data is checked for correctness or completeness in comparison with Pre Migrated Data. Check by running against a new database instance to ensure that there are no problems with the new software.

Check if any Subtle changes in the new database, such as data types, data in the data dictionary (additional rows in the data dictionary, object type changes, and so forth) can have an effect regardless of whether or not the application is directly connected to a new instance. Check if the connection between two components involves, then those connections should also be tested.

4.2.2 Database Security testing

4.2.2.1. Authentication and Authorization It must be verified that only authenticated, authorized users have access to the objects (Tables, Stored Procedures, Functions and Views) in the database. 4.2.2.2. Roles and Privileges 1. System and Database Privileges need to be tested 2. Verification should also be done to check that users and roles of the source database have been correctly mapped to respective Server users and roles, and that all objects in the database have the appropriate access rights granted. 4.2.2.3. Database Vulnerability Identifying vulnerabilities in a systems database by checking the Configuration of the database security parameters or improper implementation of the business logic used to access the database (e.g., SQL insertion attacks). These vulnerabilities may result in the disclosure or modification of sensitive data in the database. To test these prepare the test data for SQL insertion attacks in input fields through front end and check.

10

4.2.3. Database Performance testing a. Check and collect the readings for the Performance of the new database by generating the data, based on pre and post up gradations of database. One should understand the performance profile of the application under the current database. Core business logic SPs are identified and tested against source database. b. Stress testing has to be done on the target database under high volume and loads. Write SQL scripts for generating high data or use DTP to dump large data.

Environment setup. Entry Data model diagram, Functional Requirements, Test plan. Inputs Task Creating Database Test scripts Generating Database Test data Database Test scripts Review and Test data Review. Database Test scripts Outputs Completion of creation of Database test Scripts and Review of Exit Database test scripts.

Verification/Validation

11

4.3. Database Test Script Execution Database test Scripts shall be executed by tester based on requirements. All Database test runs shall be recorded in the test Report. If the observed behavior matches with the expected behavior, then P (Pass) shall be entered in the observed behavior column; otherwise F (Fail) shall be entered. For every run, observed behavior shall be recorded. Test runs shall be repeated until all the defects are closed. All defects shall be recorded by the concerned tester and tracked. Severity will be provided based on the type of defect identified. Defect Reporting and Closing shall be done using Defect Form/ Defect tracking Tool. Reviewed Database Test Scripts Entry Inputs Task Database Test Scripts Database Test Plan Execute Database Test Scripts. Enter observed behavior for every run and repeat the same Until all the defects are closed.

the Project folder. Defects using Defect Form/ Defect tracking Tool Test evaluation form. Verification/Validation Defect Log and Defect Summary Report Outputs Defect Log and Defect Summary Report is prepared Exit

12

4.4. Review Database Test Results The Database Test results shall be reviewed by the TL (Team Leader). The TL (Team leader) may assign the task of review within the team. Reviewer may take some sample test Scripts and conduct testing to verify the correctness. The reviewer shall verify the following: All the relevant test Scripts are executed The choice of test scripts have covered the main scenarios The testing is as per the corresponding database test plan Identified defects are captured and analyzed. Completion of Database test Script execution Entry Reviewed Database Test Scripts Defect log Report Inputs Task Review of the Database test results. Review on relevant test Scripts are executed Review the test Scripts that covers main scenarios The testing is as per the corresponding database test plan Testing shall be signed off and all the review comments are Closed. Test Report evaluation and Review Verification/Validation Outputs Test evaluation reports Defect Log Report Defect summary report Completion of the execution of the database test Scripts Defect Log Report and Defect summary Report is prepared

Exit

13

4.5. Preparation of Database Test Report The TL (Team Leader) prepares the Test Summary Report after evaluation. Metrics specified in the test plan shall be prepared and analyzed. Test Summary Report shall cover Test Execution and Defect Data summary. Defect Log and Defect Summary Report is prepared and Test Entry Reports/ Scripts Defect log Report Inputs Task Test Evaluation Forms Defect Summary Reports Test Report evaluation and Review Verification/Validation Database Test Report Outputs Test Report Completion Exit

5. Database Closure Submit the summary reports Issue log Lesson learned meetings. 6. Database Testing Tools TOAD Enterprise Manager (Oracle Server) Query Analyzer-SQL server Profiler (SQL Server) PL/SQL developer Squirrel SQL Client (common for both SQL Server and Oracle) Visual Studio Team Edition for Database Professionals (for SQL Server migration testing only). 7. Risk and Contingencies The following table identifies current test effort risks and outlines possible remedy and will be updated weekly, with actual test effort by the test team.

14

Risk Test Environment Ready

Probability 15%

Severity Low

Contingency Plan If the test environment is not ready by the time the First drop is ready, test execution will be delayed.

8. Hardware & System Environment setup Environment: Separate environment will be setup for testing with the below requirements 8.1 Hardware Ex:-Intel(R) Pentium(R) 4 CPU 3.00GHz 2.99 GHz, 2 GB of RAM 8.2 Software 8.2.1 Server Configuration: Operating System: Windows 2000 Server / Windows 2003 Server. Oracle Server: Oracle server, version 10g. SQL Server 2008/2005 8.2.2 Client Configuration: Operating System: Windows XP Professional or Microsoft Windows 2000/2003/2007, Professional Oracle Client: Oracle client, version 10g.

9 Appendix
Appendix A Review and Sign-off
Person Role Contact Reviewed Date

15

Appendix B Glossary/ Definitions

Term

Definition

16

You might also like