Database Testing Introduction

Data : Data are basic raw facts and figure.
Information : When data is organized in proper way and meaning full way then it become information.
Que: What is Sql?

Ans : SQL (pronounced "ess-que-el") stands for Structured Query Language. SQL is used to communicate with a database. According to ANSI (American National Standards Institute), it is the standard language for relational database management systems. SQL statements are used to perform tasks such as update data on a database, or retrieve data from a database.

Ques: What is RDBMS ? Ans : A relational database management system (RDBMS) is a database management system (DBMS) that is based on the relational model.
OR “Rdbms is a type of database management system (DBMS) that stores data in the form of related tables ”.

What is Database : 
—A database is a collection of information that is organized so that it can easily be accessed, managed, and updated. In one view, databases can be classified according to types of content: bibliographic, full-text, numeric, and images.—
— A database is basically a collection of information organized in such a way that a computer program can quickly select desired pieces of data.
Traditional databases are organized by fields, records, and files. A field is a single piece of information; a record is one complete set of fields; and a file is a collection of records.

Que : What we test in database testing ?
Ans : Database testing includes :
> data validity testing.
> data integrity testing.
> Performance related to database.

Que : What are different stages involves in database testing ?
And : In DB testing we need to check for -
> The file size validation.
> Check Contraints.
> Indexes are done or not.

Why do we test the database?
1) Data Mapping: In the software systems, data often travels back and forth from the UI (user interface) to the backend DB and vice versa.
— —2) ACID properties validation:  atomicity, consistency, isolation and durability.
> Atomicity: means that a transaction either fails or passes. This means that even if a single part of transaction fails- it means that the entire transaction has failed. Usually this is called the “all-or nothing” rule.
> Consistency : The consistency property ensures that the database remains in a consistent state before the start of the transaction and after the transaction is over. An example in a double-entry accounting system illustrates the concept of a true transaction. Every debit requires an associated credit.
>  Isolation: Ensures that transactions are securely and independently processed at the same time without interference, but it does not ensure the order of transactions. For example, user A withdraws $100 and user B withdraws $250 from user Z’s account, which has a balance of $1000. Since both A and B draw from Z’s account, one of the users is required to wait until the other user transaction is completed, avoiding inconsistent data. If B is required to wait, then B must wait until A’s transaction is completed, and Z’s account balance changes to $900. Now, B can withdraw $250 from this $900 balance.
> Durability : Once a transaction is done and committed, no external factors like power loss or crash should be able to change it.
  3). —Data Integrity : This means that following any of the CRUD operations, the updated and most recent values/Status of shared data should appear on all the forms and screens.
4). Business rule conformity:  More complex databases means more complicated components like relational constraints, triggers, stored procedures, etc. So testers will have to come up with appropriate SQL queries in order to validate these complex objects.

Database Testing Process
—The general test process for DB testing is not very different from any other application. The following are the steps:
Step #1) Prepare the environment
Step #2) Run a test
Step #3) Check test result
Step #4) Validate according to the expected results
Step #5) Report the findings to the respective stakeholders

Types of Testing
—The 3 types of Database Testing are Database
—Structural Testing
—Functional Testing
—Non-functional Testing

Structural Database Testing:- The structural data testing involves the validation of all those elements inside the data repository that are used primarily for storage of data and which are not allowed to be directly manipulated by the end users. The validation of the database servers is also a very important consideration in these types of testing.

Schema testing:- The chief aspect of schema testing is to ensure that the schema mapping between the front end and back end are similar.
Database table, column testing :-Validation of the compatibility of the, data type, field lengths, primary key, foreign key, Check, Index etc.
        Trigger testing :- Whether the required coding conventions have been followed during the coding phase of the Triggers.
Database server Validation testing; Check the database server configurations as specified by the business requirements.

Functional database Testing: The Functional database testing as specified by the requirement specification needs to ensure most of those transactions and operations as performed by the end users are consistent with the requirement specifications.
Checking data integrity and consistency
Login and user security  (SQL Injection)

Non-Functional Database Testing: Nonfunctional testing in the context of database testing can be categorized into various categories as required by the business requirements. These can be load testing, stress testing, security testing, usability testing, and compatibility testing and so on.

Que : Explain Like operator ?
Answer : The LIKE operator is used in a WHERE clause to search for a specified pattern in a column.
SELECT * FROM emp_details WHERE emp_name LIKE '%jeet';
& SELECT * FROM emp_details WHERE emp_name NOT LIKE '%jeet';
 





No comments:

Post a Comment