Testing Environment + TestData + QA Setup

M

MS Techie

I'm looking for a good strategy to save my data that I use for testing. I
made a set of good test data, and backed it up. I write my programs,
and do a round of testing on Database, and then when I want to start fresh
again, I need to do restore from my test data backup.

One way to achieve this would be DROP THE DATABASE and RESTORE THE PREVIOUS
VERSION OF the DATABASE for every new test.. This would be quite a costly
operation , since it would take a lot of system resources and lot of system
IO and is not the most effective way to do it. (Imagining that there are
around 100 tests and for each test ,dropping and restoring the database might
not be a good idea)

Another approach to this would be to write .sql scripts which delete the
data and then reload the intial data freshly.

Another approach to this would be to maintain a history table for each table
in the database and whenever there is a change in the particular database
table due to DATABASE OPERATIONS (DML) like CREATE, RESTORE , UPDATE ,
DELETE , then depending on the entry in the history table, we can rollback
that particular operation. For this the history table has to record , what
kind of operation has taken places (like whether the user is doing a UPDATE
or CREATE or DELETE etc) and then try to reverse (rollback) that particular
operation.

Another approach to this problem would be that we change all the stored
procedures to include a BEGIN TRAN ,COMMIT TRAN and ROLLBACK TRAN statements
and include an extra parameter in the stored procedures like isCommitTrue ( a
boolean variable ) and depending on the value of that parameter isCommitTrue
like 1 or 0 , either commit the transaction or rollback the transaction.

Just curious what the recommened strategy for restoring test data is to
start anew!
 
J

Jeroen Mostert

MS said:
I'm looking for a good strategy to save my data that I use for testing. I
made a set of good test data, and backed it up. I write my programs,
and do a round of testing on Database, and then when I want to start fresh
again, I need to do restore from my test data backup.
This has nothing to do with C#. Try microsoft.public.sqlserver.server instead.

I'll give you some fast advice here, though: unless your database is so
large that restoring just takes up too much time to do the tests at all,
save yourself a lot of headaches with clever solutions that pose a large
risk of making your test non-representative of the production situation and
just restore the database from scratch. You can minimize the number of
restores by grouping unrelated tests, and use recovery points for smaller
restores. See the backup and restore documentation for mor information.
 
M

MS Techie

Hi,
I have the following question on
"WebSite or WebApplication in C# for TDD Approach ? Unit Testing Using VS
2005 Team Edition"

When Following a TDD Approach, where in we write a test for the web
application , which option is better. Is it better to use a

1. Create a new WebApplication Project
2. Create a new WebSite option

Because if I use a WebApplication, then only 1 dll gets created for all the
webpages. When I create a test project (right click and select the option
"Create Tests") and create a new unit test, When I run the application, I get
the message, web.config has changed. How do I tackle this situation. Do I
need to set some attributes in web.config for this ?

If I create a new WebSite ,then for every page it creates a dll . When I
right click and select the option to "Create Test" , I dont get a new Test
Project created automatically.

I am using Visual Studio 2005 Team Edition for Software Developers. Please
suggest me the best option for this version of Visual Studio and dont suggest
me VS 2008 since my company has already brought VS 2005 edition licenses.

Thanks in Advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top