MainMenu

Home Core Java Overview Maven Tutorials

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)

Function Database Testing :-
1). Field is mandatory while allowinf NULL values on that field?
2). Length of each field is of sufficient size?
3). Similar fields have same names across tables?
4). Any Computed fields present in the database?



Also Checking data Integrity and consistency
1). Data is logically well organized.
2). Data is stored in the tables.
3). Any unnecessary data present in the application under test.
4). Data has been stored as per as the requirement with respect to data which has been updated from the user interface.
5). TRIM Operations.
6). Transactions have been performed according to the business requirement specifications and whether the result are correct or not.
7). Data has been properly committed if the transaction has been successfully executed.
8). Data has been roll backed successfully if the transaction has not been executed successfully by the end user.
9). Data has been roll backed at all in the condition that the transaction has not been executed successfully and multiple heterogeneous databases have been involved in the transaction in question.
10). All the transactions have been executed by using the required design procedures as specified by the system business requirements.

Login and User Security
# Application prevents the user to proceed further in the application in case of a
1). Invalid username but valid password.
2). Valid username but invalid password.
3). Invaid unsername and invalid password.
4). Valid username and a valid password.

A). User is allowed to perform only those specific operations which are specified by the business requirements.
B). Data Secured from unauthorized access.
C). Different user roles created with different permissions.
D). Users have required levels of access on the specified Database.
E). Sensitive data like password, credit card numbers are encrypted and not stored as plain text in database.

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.

Non-functional Database testing


1). Risk Quantification
2). Minimum system equipment requirement

Load testing


1).The most frequently used user transactions have the potential to impact the performance of all the other transactions if they are not efficient.
2).At least one non-editing user transaction should be included in the final test suite.
3).The more important transactions that facilitate the core objectives of the system should be included, as failure under load of these transactions has, by definition, the greatest impact.
4).At least one editable transaction should be included so that performance of such transactions can be differentiated from other transactions.
5).The observation of the optimum response time under huge number of virtual users for all prospective requirements.
6).The observation of the effective times for fetching of various records.


Stress testing


1). Significant amount of overhead could be involved in order to determine the state of the database transactions.
2). New test data have to be designed after cleaning up of the old test data.
3). And sql generator is required to transform sql validators in order to ensure the SQL queries are apt for handling the required database test cases.
4). The above mentioned prerequisite ensure that the set-up of the database testing procedure could be costly as well as time consuming.

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