Results 1 to 3 of 3

Thread: Test cases for testing databases & stored procedures

  1. #1
    Junior Member
    Join Date
    Feb 2007
    Answers
    3

    Test cases for testing databases & stored procedures

    How to write test cases for testing databases, especially for testing and writing test cases for stored procedures. any real time database testers. please answer me.


  2. #2
    Junior Member
    Join Date
    Jul 2006
    Answers
    18

    Re: Test cases for testing databases & stored procedures

    The Stored Procedure to Test

    In an ad hoc production environment you might just create your back-end database on the fly with the Enterprise Manager program. But it is much better to write a SQL database creation script so you can recreate the database whenever you need to. (Although you can generate database creation scripts in Enterprise Manager from existing databases, the resulting code is usually clunky.) The script in Figure 3 creates a database named dbProseware, then creates a table named tblEmployees, and a user-defined stored procedure called usp_empStatusCode.

    After checking to make sure that the database doesn't already exist, I create a database named dbProseware and a table named tblEmployees. Next, I insert some developer data—data used during the development process to be able to perform some basic functionality testing.

    The last part of the script creates the stored procedure, usp_empStatusCode, that we'll be testing. It accepts an employee ID and returns 0 if the ID is not valid, 1 if the employee has any termination date (meaning they are not currently employed), 2 if the employee was hired before January 1, 2000, and 3 if the employee was hired after January 1, 2000. Note that this stored procedure is not necessarily an example of good coding technique, but I wanted to keep the code short.

    If your background is primarily in procedural programming, you probably tend to think of SQL stored procedures as quite a bit like functions in a traditional programming language. But SQL stored procedures are significantly different from regular functions because in most cases they have a logical dependency on a table or other database object. In this example, notice that the return value from the usp_empStatusCode stored procedure depends completely on the data in table tblEmployees. This fact makes testing SQL stored procedures somewhat different from testing regular functions.


  3. #3

    Re: Test cases for testing databases & stored procedures

    Can you help me write test cases?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact