Why we need backend testing?

0
173
Spread the love
  • 28
  • 34
  • 28
  • 35
  •  
  •  
  •  
  • 12
  •  
  •  
    137
    Shares

Why backend testing tutorial is important?
Why back end testing is important?
Why we need backend testing tutorial

In general, we are using client-server architecture for most of our software designs (backend testing tutorial). In that case, data provided in the front end gets stored in backend and during the retrial , it fetches current data that is stored. So common question may arise, why need back end testing? read tutorial.

Database is a collection of interconnected files on server storing information(may not be same data always). Database testing is a layered approach consisting user interface(UI),business layers,data access layers,database layer etc.

Database testing
Database testing

Data is considered a collection of relations-

  1. Relational schema
  2. Relational states
  3. Tables
  4. Types
  5. Attributes
  6. Constraints

why we need backend testing?

        • During transactions, servers may go to the error state. Simple front end validation can not dig and find the error behind it. The front end may give faulty message of confirmation about data save but in the background, it might not have saved.
        • It provides a clear message to the performance tuning team during performance testing. Also leads to an activity called query optimization on which turns to be an important aspect in providing a response. It is not black-box testing though.
        • Many server processes are monitored by another process. It may crash, may restart. In that time system may go to unresponsive state. Until we dig into those details, we can not see them happening and can not find the route cause of them.
        • This activity makes sure that the data integrity like saying the front end is designed to accept the predefined number of characters for fields.
      input type='text' Size='50'name='someName'

      But assume the database is designed to hold only 30 characters. In that case, data may be lost. Testing data on boundaries will reveal the fact about data loss.

      • Many times it is seen, the client is catching (maybe the client’s browser) user input and submitting the same to the server. Using proper database testing ensures that there is no caching effect happening. (No data corruption).
      • The data storage logic can be tested via backend testing.
      • A good back end testing minimizes the load on front end testing.
      • When the database is used in a distributed model. Many threads or applications may try to update the database. We need to ensure that the thread-safety or concurrency about the database. A strongly designed database can remove all these deadlock related issues.

Backend testing (follow tutorial) is more of Server-side testing or database testing.

Aspects of Database testing

  • Does the database perform all operations correctly?
  • Is concurrent access handled and managed correctly?
  • Is the system fault-tolerant?
  • Overall does the system is behaving as intended?

Traditional Vs Database program

Traditional program has functions and they are imperative in nature. Whereas the database program has also functions but they are declarative in nature.

traditional vs database program
traditional vs database program

The Databases may be:

  • DB2
  • SQL Server
  • MySQL
  • Oracle
  • FlatFile
  • MongoDB
backend testing tutorial

The could of

  • Structured data
  • Unstructured data

Database testing mainly includes validation of:

  • Schema
  • data or Database tables
  • Column
  • keys
  • Indexes
  • Storage
  • Procedures
  • Triggers
  • Database server validation
  • Data duplication

In back end testing GUI component is optional. We can directly pass data by service, GUI or as a request via browsers. The data sending can be done using XML or JSON or we can use SQL queries. After the data have been pushed, the same can be verified using the following:

  • SQL Queries
  • Log files
  • Debugging

What are the types of Database testing?

Database testing can be divided into four major parts:

  • Structured data testing
  • Unstructured data testing
  • Functional testing
  • Non-functional testing

Every transaction we perform on the database must follow the ACID principle.

A-Atomicity–  Transactions are nothing or all. If a single part of the transaction fails, it means the entire transaction has failed or if all parts of the transaction pass, then it will pass.
C-Consistency– Only valid data is saved.
I-Isolation– Transactions do not affect each other.
D-Durability– written data will not be lost.

How to test ACID?

  1. Prepare the environment having transactions.
  2. Run a test.
  3. Check for the positive scenario.
  4. Validate the result.
  5. Report the findings.
  6. For negative test make one sub transaction failed.
  7. Validate the result.
  8. Report the findings.

Structured data testing and unstructured data testing

Structured data testing or unstructured data testing involves the validation of the elements inside data repository(storage for data) which can not be manipulated directly by the user.

Schema Testing

Schema Testing is a type of testing that ensures that the mapping of schema(s)  are correct for front end and back end.

  • Validation of the various schema towards associated with the database.Many a times mapping with back end and front end fail.
  • Un-mapped tables/ views/columns need to be double verified.
  • Heterogeneous databases need to be in sync with the overall application.

ANT with DBUnit is very good for testing of mappings.SQL server allows users to query and check the schema of databases.

Database table/Column testing

  • To check if the front end and back end mappings of the fields and columns are compatible and proper.
  • Validate the length and naming convention of database fields are proper and they are as per requirement specification (datatypes and filed length).
  • Validation of un-mapped or unused database tables/columns or derived column.
  • Validate if the user is able to provide desired user inputs as described by the business.

Keys and Indexes testing

Keys and Indexes testing consists of the followings:

  1. Check for the primary key and composite key.
  2. Check for foreign keys
  3. What constraints have been designed in the table?
  4. Check if the reference for foreign keys is valid. (Maybe the other tables are not valid or it is not indexed yet).
  5. Check the primary key datatype is same for both the table (When used as a foreign key).
  6. Confirm proper naming convention is followed.
  7. Check for the size and length of the required fields and indexes.
  8. Confirm cluster index and non-cluster index for a given table.

Shared procedures testing

Shared procedures testing involves the below :

  1. Manually look for the coding standards.
  2. Exceptions and error handling in database level.
  3. Check for coverage (all possible conditions, loops, user data etc).
  4. Use of train operation while fetching data.
  5. Manual execution should give the desired output to the end-user with the desired resource.
  6. Manual execution should update/modify the tables.
  7. Invocation of triggers should be proper by stored procedures.
  8. Validation of unused shared procedures. (finding out zombie procedures).
  9. validation of Null usage as key business rules.
  10. Stored procedures/functions need to be executed successfully when the database is blank.
  11. Validation of overall integration of the stored procedure modules.

Trigger Testing

Trigger testing covers the following validations:

  1. If the coding conventions are followed.
  2. If the trigger can execute the data manipulation(DM)operations.
  3. The update/rollback mechanism.

DB Server Validation

DB Server Validation check the below points

  1. Validate the database server configuration as per business needs.
  2. Checks for authorization levels of actions.
  3. Check the load on the server or allowed user transactions.

Functional DB Testing

Functional DB Testing covers the followings:

  • Checking of Null values
  • Length of each field (is size sufficient?)
  • The similar name for similar fields across tables.
  • Fields and their correctness
  • Field level validations.

Data Integrity and Consistency

Data Integrity and Consistency checks the followings to be validated:

  1. If the data is logically organized
  2. The correctness of data.
  3. The presence of unnecessary data.
  4. If the trim operation is performed when reading from front end application.
  5. The transaction is permitted as per business rules.
  6. If the commit is happening after every transaction successfully.
  7. The rollback mechanism is working fine.
  8. If all the transactions are happening as per requirement design procedures.

What are popular tools to test database testing?

  1. Data Factory
  2. Data Generator
  3. Turbo Data
  4. Test Data Generation
  5. AETG

What is the prerequisite of Data testing?

Test engineers need to have strong command on queries, database servers, Preferably they should be from ETIL domain.

Don't miss out!
Subscribe To Newsletter

Receive top technical news, lesson ideas, travel tips and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

Spread the love
  • 28
  • 34
  • 28
  • 35
  •  
  •  
  •  
  • 12
  •  
  •  
    137
    Shares

LEAVE A REPLY

Please enter your comment!
Please enter your name here