Data Base Testing - 1.0a

Embed Size (px)

Text of Data Base Testing - 1.0a

  • 8/13/2019 Data Base Testing - 1.0a

    1/12

    2011

    Aditi Technologies Pvt Ltd

    Data Base Testing 1.0a

    DATA BASE TESTINGDraft Version of Data Base Testing

  • 8/13/2019 Data Base Testing - 1.0a

    2/12

    August 26, 2011 DATA BASE TESTING

    DB Testing Page 1

    ContentsDATA BASE TESTING ...................................................................................................................................... 2

    Database Testing brief .............................................................................................................................. 3

    Why Database or back end testing is so important .............................................................................. 3

    Differences between back end testing and front end testing .............................................................. 3

    Back end test methodology .................................................................................................................. 3

    Structural testing: ................................................................................................................................. 3

    Functional testing: ................................................................................................................................ 3

    Boundary testing: .................................................................................................................................. 3

    Stress testing: ........................................................................................................................................ 4

    Test a Database via a front end ............................................................................................................ 4

    Entry Criteria ............................................................................................................................................. 4

    Test Objects .............................................................................................................................................. 4

    Tasks .......................................................................................................................................................... 5

    Test Environment Preparation .............................................................................................................. 5

    Test a Table ........................................................................................................................................... 5

    Test Stored Procedure .......................................................................................................................... 6

    Test Triggers .......................................................................................................................................... 6

    Automation ........................................................................................................................................... 7

    Roles & Responsibilities ............................................................................................................................ 7

    Deliverables............................................................................................................................................... 8

    Exit Criteria ................................................................................................................................................ 8

    Appendix ................................................................................................................................................... 7

    SQL Queries most used in DB Testing ................................................................................................... 8

    Common defects in SQL databases ....................................................................................................... 9

    Administration issues for database testing ........................................................................................ 10

    Tools .................................................................................................................................................... 10

    References .............................................................................................................................................. 11

  • 8/13/2019 Data Base Testing - 1.0a

    3/12

    August 26, 2011 DATA BASE TESTING

    DB Testing Page 2

    DATA BASE TESTINGVerification of Database,

    Data integrity

    o The complete data belonging to each entity should be stored in the database.

    Depending on the database design, the data may be present in a single table or multiplerelated tables. Parent-child relationships should exist in the data. There should not be

    any missing data.

    Correctness of the data stored in the database

    o The data should be present in the correct table and correct field within the table.

    Correctness and completeness of data migration (in case some or all the original data has come

    from another source)

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3034837&SiteID=1

    Functionality and performance of user objects e.g. functions, procedures, triggers, jobs

    o Perform API testing on the user objects to test them.

    Database performance (query execution times, throughput etc.) and locking problems

    o Identify the main queries (or procedures) that are used in the application and time them

    with sample data. Locking problems may become apparent when multiple inserts/

    updates are being made to the same entity simultaneously.

    Data security

    o Check if any data that should be encrypted e.g. passwords, credit card numbers is in

    plain text or not. The database should not have the default passwords. Even application

    accounts should have passwords that are complex and not easily guessed.

    Database fields (if they meet the specifications e.g. width, data type etc. as given in the design

    documentation/ data dictionary etc.)

    Normalization level

    Compliance of user objects code to coding guidelines

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3034837&SiteID=1http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3034837&SiteID=1http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3034837&SiteID=1
  • 8/13/2019 Data Base Testing - 1.0a

    4/12

    August 26, 2011 DATA BASE TESTING

    DB Testing Page 3

    Database Testing brief

    Why Database or back end testing is so important

    A back end is the engine of any client/server system. If the back end malfunctions, it may cause system

    deadlock, data corruption, data loss and bad performance. A bug in a back end may put serious impacton the whole system. Too many bugs in a back end will cost tremendous resources to find and fix bugs

    and delay the system developments

    It is very likely that many tests in a front end only hit a small portion of a back end. Many bugs in a back

    end cannot be easily discovered without direct testing. Back end testing has several advantages: The

    back end is no longer a "black box" to testers. We have full control of test coverage and depth. Many

    bugs can be effectively found and fixed in the early development stage.

    Differences between back end testing and front end testing

    It is not easier to understand and verify a back end than a front end because a front end usually has

    friendly and intuitive user interfaces.

    A back end has its own objects, such as, tables, stored procedures and triggers. Data integrity and

    protection is critical. Performance and multi-user support are big issues. Slowness in operation can be

    vital to the projects future. There are no sufficient tools for back end testing. SQL language is mainly a

    testing tool. However, there are a large number of test tools available for front end testing.

    To be able to do back end testing, a tester must have strong background in Database and SQL language.

    It is relatively difficult to find testers who understand both Database server and SQL testing.

    Back end test methodology

    Back end test methodology has many things in common with front end testing and API testing. Many

    test methods can be used for back end testing. Structural testing and functional testing are more

    effective approaches in back end testing

    Structural testing:

    A back end can be broken down into a finite number of testable pieces based on a back ends structure.

    Tests will verify each and every object in a type of structure.

    Functional testing:

    A back end can be broken down into a finite number of testable pieces based on applications

    functionality. The test focus is on functionality of input and output but not on the implementation and

    structure. Different projects may have different ways to break down.

    Boundary testing:

    Many columns have boundary conditions. For example, in a column for percentages, the value cannot

    be less than zero and cannot be greater than 100%. We should find out these types of boundary

    conditions and test them.

  • 8/13/2019 Data Base Testing - 1.0a

    5/12

    August 26, 2011 DATA BASE TESTING

    DB Testing Page 4

    Stress testing:

    It involves subjecting a database to heavy loads. For incidence, many users heavily access the same table

    that has a large number of records. To simulate this situation, we need to start as many machines as

    possible and run the tests over and over.

    Test a Database via a front end

    Sometimes back end bugs can be fou