views:

168

answers:

3

I am not sure whether this has been asked before; I did a few searches but nothing appropriate showed up. OK, now my problem:

I want to migrate an old application to a different programming language. The only requirement we have is to keep the database structure stable. So no changes in my database schema. For the rest of the application I am basically reimplementing everything from scratch without reusing old code.

My Idea: in order to verify my new code was to let users do certain actions or workflows, capture the state of the database before that and after that and then maybe create unit tests with the help of this data. Does anyone know an elegant solution to keep track of these changes? Copying the database (>10GB) is pretty expensive. I also can't modify the code of the old application in which the users will be performing these sample actions. I have to keep it on the database level.

My database is Oracle 10g.

+2  A: 

You could capture the old application behavior with a trace and then validate the changes against your new code. But, honestly, trying to write a new application by capturing the data modifications it makes and the imitating that will be a very difficult task as the inputs and the outputs to the original application are not guaranteed to be stateless (that is, the old application might do the same thing the first 1,000,000 times it is given a certain set of inputs and do something completely different on the 1,000,001st run.)

Your best bet is to start over with the business requirements and use the old application and a functional reference.

JP Alioto
You're right, but I'm not only relying on data gathered by observing the old program. It's just a way to get more insight into the old application and maybe find things that have been overlooked at the requirements engineering.
sebastiangeiger
+2  A: 

Take a look at Oracle Flashback Queries.

It enables to execute queries which return past data. The timeframe is limited, but it can be very useful.

FWH
flashback queries have definitely saved my butt on a few occasions.
Peter Recore
+1  A: 

In 10g the only way is to do with FLASHBACK queries.in 11g we can do this with RAT(Real Application Testing). RAT is quite useful for this senarios and also for load and volume testing.

Govind