Tuesday, August 15, 2017

Database testing



Useful tools for Database testing

-todo-- http://www.seleniumeasy.com/selenium-tutorials/database-testing-example-with-selenium-using-java

DATAGRIP:    https://www.jetbrains.com/datagrip/
dbforge:   https://www.devart.com/dbforge/sql/studio/


Database testing is a test type in which data manipulation, integrity, data comparison etc operations can be verified.
Database testing is a subset of functional testing & performance testing.
We can conduct database testing manually and also automated.
Data Integrity: Data is stored in correct place.
Ex: Name and ID values interchanged while saving in DB, so Integrity error.

Database scenarios:
1. Add record
2. Update record
3. Delete record
4. Data Integrity
5. Data Authentication
6. Data Comparision - (front end data with backend data)
7. Data Comparision - (two databases)
8. Data Comparision different data sources (Database vs Excel)
9. Data Backup
10. Data Recovery

Parts of Database: data and schema

Schema: Datastructures in the database is called as Schema.
Table, Columns, Stored Procedure, Views, Functions, Trigger are the parts of the schema.
Stored Procedure : Contains Input and Output
Functions: Contains only Input, No Output



Schema testing:
·         Table: Table name should be meaningful name short/long
·         Contains all necessary columns.
·         Correct keys
·         Unique information - no duplicate
·         unnecessary columns
·         Columns: Correct data type, data size, Name constraints and relationship( Ex Foreign key)
·         View:
·         Stored Procedure : exec storeprocedureName 'param1' 'param2'
·         Functions

Data testing:
·         Is data correct w.r.t Source(UI, other), complete, unambiguous, unique and fresh ?
·         Source: User Entered in UI / XML / another database
·         Column - Is the data format(correct space, characters, capitalization) correct and not truncated ?
do the keys match ?

Database testing challenges
·         large size - scope the test items, test according to database test plan(Ex: newly created)
·         Incorrect / scaled-down database - Test production database(or copy with or without obfuscation)
·         Many companies they take copy of production database and hide sensitive database ( Ex. Credit card information ) , where ever sensitive we can use null
·         Frequent changes:
·         Analyze impact, re-design tests and re-test impacted objects

Database testing approach
·         Gather database requirements
·         Create test scenarios against each requirement
·         Test schema, data and test scenarios
·         Negative testing
·         Performance testing for throughput and response times.
·         Security testing – user has restricted access and try to access
·         Use SQL queries(faster) or query builder(slower method)
·         Organize tests into test suites.
·         Automate tests as far as possible. We can run as a batch one after the other.

Database test plan:
·         Introduction – db name and application
·         Scope – Important items, in scope, out of scope
·         Test approach – list of test and approaches.
·         Test environment – database copy, server, tools
·         Test activates and schedule –requirements analysis, test design test execution, results analysis and reporting
·         Responsibilities – Test lead, tester
·         Deliverable – Test queries, bug reports, tested db
·         Risks – mitigation and contingency plans


Sample database test plan:


2 Video
https://www.youtube.com/watch?v=1ozPUHBfseY
https://www.udemy.com/framework-development-with-selenium-csharp-advanced/

https://www.youtube.com/watch?v=CjNqKlTluxc
https://www.youtube.com/watch?v=1ozPUHBfseY
https://www.youtube.com/watch?v=md_x6Yr2fgM
--
 https://www.youtube.com/watch?v=sRaPFn9ZQDs





No comments:

Post a Comment

JMeter Simple Controller

  Simple Controller is just a  container  for user request.