Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


ETL DATA TESTING


ETL DATA TESTING

Author
Message
komal145
komal145
Old Hand
Old Hand (303 reputation)Old Hand (303 reputation)Old Hand (303 reputation)Old Hand (303 reputation)Old Hand (303 reputation)Old Hand (303 reputation)Old Hand (303 reputation)Old Hand (303 reputation)

Group: General Forum Members
Points: 303 Visits: 896
I have source side stored procedure.Using which i need to do analysis and write test cases.
In the stored procedure , they are updating data after wrting the stored procedure.Do any one know how to write testcases for update statments.

Komal
bitbucket-25253
bitbucket-25253
SSCertifiable
SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)SSCertifiable (5.7K reputation)

Group: General Forum Members
Points: 5695 Visits: 25280
To be honest I do not know of any "Standard" test procedure as you are requesting. But you can do a great deal of "testing", checking for "good practices" by examining the T-SQL statements. I would for example.

1. Each SP should include a TRY CATCH block - if some mistakes exist the TRY CATCH can be coded to return a appropriate error message.

2. Each SP should (in my opinion) have a BEGIN / COMMIT / ROLL BACK transaction. To some extent makes each SP check itself and "undo" errors. Try reading this
http://www.sqlteam.com/article/introduction-to-transactions

and
http://www.codeproject.com/KB/database/sqlservertransactions.aspx

3. Visual examination to insure that each update SP has the appropriate WHERE clause. (MOST IMPORTANT)

Hope this gets you started.

If everything seems to be going well, you have obviously overlooked something.

Ron

Please help us, help you -before posting a question please read

Before posting a performance problem please read
Jamie Ingram-729524
Jamie Ingram-729524
SSC Veteran
SSC Veteran (243 reputation)SSC Veteran (243 reputation)SSC Veteran (243 reputation)SSC Veteran (243 reputation)SSC Veteran (243 reputation)SSC Veteran (243 reputation)SSC Veteran (243 reputation)SSC Veteran (243 reputation)

Group: General Forum Members
Points: 243 Visits: 407
Hi,
Remember SEAT for testing.

Table A
(
Column1 varchar(4),
Column2 int
)


Setup
Select a row of data to be updated.
eg
Select Column1, Column2 from A where Column1 Is Null


Evaluate
Run the test/code

Insert into A_Changes
Select Column1, Column2 from A where Column1 Is Null
go
Update A Set Column1 = 'TEST' where Column1 Is Null


Assert
Select *
from A
inner join A_Changes
on Column2 = Column2

Tear down (Clean up)

Drop table A_Changes


Cheers

Jamie

We are the pilgrims, master.
We shall go always, a little further.

Steve Jones
Steve Jones
SSC-Dedicated
SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)

Group: Administrators
Points: 36162 Visits: 18751
As Jamie wrote. Have a specific, curated set of data. Know the opening state, make the change, query for the end state, which you should know.

To do this right, you should have multiple cases, NULLS, blanks, negatives, etc. Test how your code handles a variety of beginning cases, with rules for how things should end up.

Note that you won't catch everything at once. Write a few cases you know, but add tests as you discover new issues.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search