473,385 Members | 1,342 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Database testing with automated verifications of your modifications ?

Can anyone recommend a good framework (preferably open source) that can
be used for database testing ?

The thing I want to be able to do is the following:
(1) Define the expected database changes that I want my following code
to trigger
(2) Take a snapshow of the database before my test code starts
(3) Execute my code being tested
(4) Verify that all the changes have been done to the database

In other words, I am looking for a component that can be used in a
similar way as some mock object frameworks where you record the
expected methods that should be invoked by your code, but instead I
want to record the expected database changes that will be triggered by
my code.

To further explain what I mean, here is a code sample of the kind of
feature I would wish:

string connectionString = "...";
DatabaseTester oDatabaseTester = new DatabaseTester(connectionString);
oDatabaseTester.AddExpectation(new RowsInserted("tableName1", 3)); // 3
rows is expected to become inserted to table "tableName1"
oDatabaseTester.AddExpectation(new RowsDeleted("tableName2", 4));// 4
rows is expected to become deleted from table "tableName2"
oDatabaseTester.AddExpectation(new UpdatedRow("tableName3",
"columnName1", "newValue", "123"));
// the value of the column "columnName1" will get the value "newValue"
at the row with the primarykey "123" in the table "tableName3"
oDatabaseTester.MakeSnapShotOfTheDatabase(); // the content of the
database will be stored internally in the DatabaseTester class

// the code that should cause the above changes to the database (for
example NHibernate code or whatever)

oDatabaseTester.VerifyAllExpectationsHaveBeenMetSi nceTheSnapshot();

/Tom

Aug 30 '06 #1
1 1281
to*************@bloglines.com a écrit :
Can anyone recommend a good framework (preferably open source) that can
be used for database testing ?
For Oracle databases, you can use utPLSQL
(http://utplsql.oracledeveloper.nl/), which is a PL/SQL unit testing
framework. You can write ADO .NET code to call the utPLSQL package
functions if you want to drive your tests from .NET (or better, a .NET
unit testing framework, like NUnit).
But you will have to write specific code to take a snapshot, undo
changes, check for modifications.

I think have once read about a similar framework for SQL Server, but
you will have to

I am pretty sure that no framework exist that target as little as 2
databases, every system being so largely different...

Mathieu Cartoixa
Aug 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tim Lesher | last post by:
I'm writing a database helper class that represents records in a SQL database as objects. I want to be able to instantiate the objects (from the database), play with their values locally, then...
346
by: rkusenet | last post by:
http://biz.yahoo.com/rc/040526/tech_database_marketshare_1.html Interesting to see that database sales for windows is more than Unix.
3
by: windandwaves | last post by:
Dear All I am looking at publishing an MS Access Database under an open license. That means that I will make it freely available on my website, that anyone can use it, but that no-one can...
11
by: D. Yates | last post by:
Hi, In an effort to improve my own code and try to teach others that I work with that unit testing IS MANDATORY. I'm interested in examples of unit testing that other people are using. How...
3
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database...
5
by: Slant | last post by:
Here's a question that most will have different answers to. I'm just dying to find a solution that seems halfway automated!! There really are two seperate issues which might be answered by the...
18
by: Andrew Wan | last post by:
I have been developing web applications with ASP & Javascript for a long time. I have been using Visual Studio 2003.NET. While VS2003 is okay for intellisense of ASP & Javascript, it's still not...
4
by: David | last post by:
Hi list. Do test-driven development or behaviour-driven development advocate how to do higher-level testing than unit testing? types of testing: unit integration system
4
by: jehugaleahsa | last post by:
Hello: What is the best way to test my methods that hit a database? I believe tests should be as automated as possible. However, I'm not sure how I can test against a database since changes...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.