Saving the db state for bug reproduction and tests

  • Thread starter Thread starter George Homorozeanu
  • Start date Start date
G

George Homorozeanu

We are developing a .net database driven application. The application is
already quite complex and uses at time aprox. 150 data tables stored in the
MSSQL 2000 database server. Our application has multiple modules. Some
customers already use some modules while we currently developing more
modules.



The problem that we are starting to have is the difficulty to save the
database state in case of a bug. We need the database state in order to
reproduce and correct the bug and also to write and run some tests to be
sure the bug never occurs.



The simplest way is to use the MS SQL 2000 database back-up functionality.
Another way could be to use SQL Server Tools (like Red Gate, etc.)



I am also a student and I tried to find some answers in the academic field
(books, asking some other students/assistants) but nothing to find. It seems
that a solution can only be found in practice. That's why I ask the people
who had this kind of problem to help me to get closer to a solution. How are
you resolving this kind of problems? Which tools can be used to automate
this process?



Any ideas, literature, links could help me a lot.



Thanks,



George Homorozeanu.
 
George Homorozeanu said:
We are developing a .net database driven application. The application is
already quite complex and uses at time aprox. 150 data tables stored in
the MSSQL 2000 database server. Our application has multiple modules. Some
customers already use some modules while we currently developing more
modules.

The problem that we are starting to have is the difficulty to save the
database state in case of a bug. We need the database state in order to
reproduce and correct the bug and also to write and run some tests to be
sure the bug never occurs.
[snip]

Hi George,

150 tables sounds like a lot. I can only assume your data model is a good
one.

As far as saving state goes, the first thing that comes to my mind is :
1. Remove all unnecessary data if possible
2. Detach the DB
3. Copy the MDF & LDF files
4. When you want to test it, copy the saved originals
5. Attach new files
6. Run your tests
7. Delete the test files when finished

But a far better way would be to recreate the same scenario in a unit test,
it would probably be alot smaller & faster.

Good luck, I hope this helps.

Regards,
John
 
Back
Top