Вы находитесь на странице: 1из 4

Database Testing

What is Database testing? Database testing involves some in depth knowledge of the given application and requires more defined plan of approach to test the data. Database testing means to check the software database connection and also weather it retrive the desire output by firing so query Check for data quality, accuracy, reliability through the standard procedure defined by the organization. In DB Testing, basically all the events like Add, Delete, Update, Modify etc...check for connections

Key issues include: Data base testing basically include the following. 1)Data validity testing. 2)Data Integrity testing 3)Performance related to data base. 4)Testing of Procedure, triggers and functions. 5)Data Manipulation and updates For doing data validity testing you should be good in SQL queries For data integrity testing you should know about referential integrity and different constraint. For performance related things you should have idea about the table structure and design. For testing Procedure triggers and functions you should be able to understand the same. What we check in DB testing? In DB testing we need to check for, 1. The field size validation 2. Check constraints. 3. Indexes are done or not (for performance related issues) 4. Stored procedures 5. The field size defined in the application is matching with that in the db. 3. How to Test database in Manually? Explain with an example Ans : Observing that operations, which are operated on front-end is effected on back-end or not. The approach is as follows : While adding a record the front-end check back-end that addition of record is effected or not. So same for delete, update Ex: Enter employee record in database the front-end and check if the record is added or not to the backend(manually).

How to Test Stored Procedure? Testing the Stored Procedures is the good one.we are passing the Input parameters and easily get the result(output) fast compare to testing the tough business logic in front end. In SQL server we r using exec {procedure Name} input1,input2..

What is way of writing testcases for database testing?


1. First of all you have to understand the functional requirement of the application throughly. 2. Then you have to find out the back end tables used, joined used between the tables, cursors used (if any), tiggers used(if any), stored procedures used (if any), input parmeter used and output parameters used for developing that requirement. 3. After knowing all these things you have to write the testcase with different input values for checking all the paths of SP. One thing writing testcases for backend testing not like functinal testing. You have to use white box testing techniques.

Stages involved in DB testing? verify the data in the database w.r.t frontend transactions verify the constraint (primary key,forien key ....) verify the performance of the procedures verify the triggrs (execution of triggers) verify the transactions (begin,commit,rollback) how can we carry out DB testing manually?

If we are using SQL server then open the SQL query analyzer and write the queries to retrieve the data. Then verify whether the expected result is correct or not. IF not the data is not inserted into database. We can play with queries to insert, update and delete the data from the data base and check in the front end of the application. IF it is Oracle then open the SQL plus and follow the same procedure. Most of the time we find invalid data. Same way we can test the stored procedure in sql query analyzer and check the result. We can play with queries to insert, update and delete the data from the data base and check in the front end of the application.

Is a "A fast database retrieval rate" a testable requirement?


No.Unless and until it has been mentioned in the requirement. It should say like 'A DB retrival rate of 5 micro sec'.Normal retrival can be checked The SQL JOIN statement is used to combine the data contained in two relational database tables based upon a common attribute. Basically there are two types of Joins 1. Inner Join An inner join is a join that selects only those records from both database tables that have matching values. Records with values in the joined field that do not appear in both of the database tables will be excluded from the query. One or more fields can serve as the join fields. 2. Outer Join Outer Join has 2 types further. 2a. Right Outer Join : 2b. Left Outer Join An outer join selects all of the records from one database table and only those records in the second table that have matching values in the joined field. In a left outer join, the selected records will include all of the records in the first database table. In a right outer join, the selected records will include all records of the second database table. One or more fields can serve as the join fields.

How do you test whether a database in updated when information is entered in the front end?

It depend on your application interface.. 1. If your application provides view functionality for the entered data, then you can verify that from front end only. Most of the time Black box test engineers verify the functionality in this way. 2. If your application has only data entry from front end and there is no view from front end, then you have to go to Database and run relevant SQL query.

Queries???

Now suppose i have 50 records of employee table. 1) I want to find the person who is having 22nd highest salary. 2)i want to delete a person with postion number 39 with comminsion < 100 3) Update rec no 45?
select emp_id,emp_name, sal from employee a where &n = (select count(distinct(salary)) fromemployee b where a.sal <=b.sal) &n=22 ( U will be asked to enter the number and then enter for which record u want to retrieve) a.sal <=b.sal (this can be used to retrieve max record) a.sal >=b.sal( this can be used to retrieve min record)

Write a query to find the second largest value in a given column of a table

Select Max(sal) from Emp where Sal < (select Max(sal) from Emp

Вам также может понравиться