in Technology by
What To Test while doing Database Testing Checklist?

1 Answer

0 votes
by

#1) Transactions

When testing Transactions it is important to make sure that they satisfy the ACID properties.

These are the statements commonly used:

  • BEGIN TRANSACTION TRANSACTION#
  • END TRANSACTION TRANSACTION#

The Rollback statement ensures that the database remains in a consistent state.

  • ROLLBACK TRANSACTION#

After these statements are executed, use a Select to make sure the changes have been reflected.

  • SELECT * FROM TABLENAME <tables which involve the transactions>

#2) Database Schemas

A Database Schema is nothing more than a formal definition of how the data is going to be organized inside a DB. To test it:

  • Identify the Requirements based on which the Database operates. Sample Requirements:
    • Primary keys to be created before any other fields are created.
    • Foreign keys should be completely indexed for easy retrieval and search.
    • Field names starting or ending with certain characters.
    • Fields with a constraint that certain values can or cannot be inserted.
  • Use one of the following methods according to the relevance:
    • SQL Query DESC<table name> to validate the schema.
    • Regular expressions for validating the names of the individual fields and their values
    • Tools like SchemaCrawler

#3) Triggers

When a certain event takes place on a certain table, a piece of code (a trigger) can be auto-instructed to be executed.

For Example, a new student joined a school. The student is taking 2 classes: math and science. The student is added to the “student table”.  A Trigger could add the student to the corresponding subject tables once he is added to the student table.

The common method to test is to execute the SQL query embedded in the Trigger independently first and record the result. Follow this up with executing the Trigger as a whole. Compare the results.

These are tested in both the Black-box and White-box testing phases.

  • White box testing:  Stubs and Drivers are used to insert or update or delete data that would result in the trigger being invoked. The basic idea is to just test the DB alone even before the integration with the front end (UI) is made.
  • Black box testing:

a) Since the UI and DB, integration is now available; we can Insert/Delete/Update data from the front end in a way that the Trigger gets invoked. Following that, Select statements can be used to retrieve the DB data to see if the Trigger was successful in performing the intended operation.

b) The second way to test this is to directly load the data that would invoke the Trigger and see if it works as intended.

#4) Stored Procedures

Stored Procedures are more or less similar to user-defined functions. These can be invoked by Call Procedure/Execute Procedure statements and the output is usually in the form of result sets.

These are stored in the RDBMS and are available for applications.

These are also tested during:

  • White box testing: Stubs are used to invoke the stored procedures and then the results are validated against the expected values.
  • Black box testing: Perform an operation from the front end (UI) of the application and check for the execution of the stored procedure and its results.

#5) Field Constraints

The Default value, Unique value, and Foreign key:

  • Perform a front-end operation which exercises the Database object condition
  • Validate the results with a SQL Query.

Checking the default value for a certain field is quite simple. It is part of business rule validation. You can do it manually or you can use tools like QTP. Manually, you can perform an action that will add value other than the default value of the field from the front end and see if it results in an error.

The following is a sample VBScript code:

<table border="0" cellpadding="0" style='background:none !important; border-radius:0px !important; border-spacing:0px; border:0px !important; bottom:auto !important; box-shadow:none !important; box-sizing:content-box !important; direction:ltr !important; float:no

Related questions

0 votes
    Suppose you need to perform a mobile application testing, what would be the facts you will take into consideration while selecting the test automation tool?...
asked Feb 9, 2021 in Technology by JackTerrance
0 votes
    I'm working on a casual game on XNA with the intention of deploying to the Xbox 360. I'm not ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 20, 2022 in Education by JackTerrance
0 votes
    While doing online payments, what kind of websites should be trusted? Select the correct answer from above options...
asked Dec 20, 2021 in Education by JackTerrance
0 votes
    Write the following in while(): For (i=1;i =100;i++){Print( %d \ ,i);} (Will no one be able to solve ... as i am doing an exam now) Select the correct answer from above options...
asked Dec 17, 2021 in Education by JackTerrance
0 votes
    ________ is an operational framework that stimulates software consistency and standardization through automation while emphasizing ... (2)DevSecOps (3)DevOps (4)Automation...
asked May 18, 2021 in Technology by JackTerrance
0 votes
    Explain about the problems which you have faced during your past experience while handling mobile application testing programs in the Cloud environment?...
asked Feb 7, 2021 in Technology by JackTerrance
0 votes
    What are the bugs you have found out while performing mobile application testing during your past experience?...
asked Feb 7, 2021 in Technology by JackTerrance
0 votes
    Verification is: 1). Checking that we are building the right system 2). Checking that we are building the system right ... documents 4). How much of the code has been covered...
asked Nov 20, 2020 in Technology by Editorial Staff
0 votes
    Explain the difference between Smoke Test Vs Build Acceptance Testing?...
asked Oct 17, 2020 in Technology by JackTerrance
+1 vote
    Mention a few test cases and explain them in ETL Testing?...
asked Oct 15, 2020 in Technology by JackTerrance
0 votes
    What is the output for the following function test(x) { while(x < 5) { x++; } return x; } alert(test(2)); 1. 6 2. 3 3. 2 4. 5...
asked Feb 25, 2021 in Technology by JackTerrance
0 votes
    In _________ approach, the code is analyzed for security vulnerabilities, while the application is run either manually or by an automated test. 1. RASP 2. IAST 3. SAST 4. DAST...
asked Oct 28, 2020 in Technology by JackTerrance
0 votes
    What is the output for the following function test(x) { while(x < 5) { x++; } return x; } alert(test(2)); A) 6 B) 3 C) 2 D) 5 #insurance and Loans...
asked Oct 9, 2020 in Technology by JackTerrance
0 votes
    Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
...