Download presentation
Presentation is loading. Please wait.
Published byReginald Bishop Modified over 8 years ago
2
What is DB Testing ? Testing at the Data Access Layer Need for Testing DB Objects Common Problems that affect the Application Should Testers Know Databases Writing Test Cases to Test Databases Testing Tools Examples
3
Database Testing includes Testing for Data Integrity, Data Validity, Data manipulation. Database Objects can be tables, views, stored procedures, indexes etc Time taken for Retrieval of Records from the Database Time for Query Execution
4
Client Layer – Is responsible for the presentation of data, receiving user events and controlling the user interface. Application Layer - Business-objects that implement the business rules "live" here, and are available to the client-tier Data Layer : This tier is responsible for data storage
5
Testing the Front End / GUI / Client Layer Testing the Business Logic Layer Testing the Database Reviewing E/R Diagrams Reviewing the Database Designs Reviewing the Tables, views, stored procedures etc
6
Data is stored in the tables Stored Procedures will handle the Insertion, deletion & Updation & Retrieval of Information from the Database No Testing/Improper testing will result in missing critical application functionality
7
Traditionally all the data testing is done at the GUI Level Corruption of data can occur at any layer We must present verification of application correctness as data travels through the system.
8
Data corruption Occurs due to poor design Redundant data Hidden duplicate records (same customer added twice with different primary keys). Inconsistent data Data records added to the same database through multiple applications can add inconsistent data.
9
Validate the table naming conventions Validate the column naming conventions To check if the correct datatype is selected for a column To check the consistency in datatypes for columns common across tables To ensure the usage of correct field width
10
To ensure consistency in field width for columns common across tables Existence of a primary key on a table Existence of a foreign key on a table Validity of check constraints Validity of default constraints Check for presence of indexes on a column
11
Check for Unique indexes Existence of non-clustered indexes Existence of clustered indexes Note the time of execution of queries Note the time of compilation of queries
12
Evaluate the query execution plan Note the time of execution of stored procedures Note the time of compilation of stored procedures Evaluate the query execution plan Denormalize the tables Normalize the tables
13
SQL TunerSQL Tuner : Embaradero Eases the complexity of writing high-performance SQL code by providing built-in help for writing syntactically correct SQL, and by assisting in every aspect of complex tuning efforts.
14
Datatect Datatect : Banner Software Generate a variety of realistic test data to RDBMS including Oracle, Sybase, SQL Server, and Informix DB Stress DB Stress : Utility for stress testing the server parts of information systems and applications, as well as DBMSs and servers themselves.
15
Database Opensource Test Suite The Database Opensource Test Suite (DOTS) is a set of test cases designed for the purpose of stress-testing database server systems in order to measure database server performance and reliability.
16
DBMonster DBMonster is an application to generate random data for testing SQL database driven applications under heavy load.
17
[Test] public void ColumnTypeIsNotDeprecated() { const string cmdText = @"SELECT t.name AS tableName, c.name AS columnName, ty.name AS columnType FROM sys.tables t JOIN sys.columns c ON c.object_id = t.object_id JOIN sys.types ty ON ty.system_type_id = c.system_type_id AND ty.user_type_id = c.user_type_id WHERE ty.name = 'text' OR ty.name = 'ntext' OR ty.name = 'image' OR ty.name = 'datetime'";. Assert.That(deprecatedColumns, Is.Empty, "Column types are deprecated (text, ntext, image, datetime). Use varchar(max), nvarchar(max), varbinary(max) and datetime2(0) instead."); }
18
ALTER PROCEDURE TryItOut. AS BEGIN DECLARE @sum INT; SELECT @sum = 1 + 2; EXEC tSQLt.AssertEquals 3, @sum; END GO Video: http://www.youtube.com/watch?v=1w9X- WzcFz0 (tsSQLt)http://www.youtube.com/watch?v=1w9X- WzcFz0
19
What Database Testing includes? What Database Objects can by tested? How many layers exists in a Application? What pproblems can happened if Database Testing is Ignored? What we can Test at the DB Level? (Min 3)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.