Questions tagged [database-testing]
84 questions
52
votes
8 answers
How to do database unit testing?
I have heard that when developing application which uses a database you should do database unit testing.
What are the best practices in database unit testing? What are the primary concerns when doing DB unit testing and how to do it "right"?

juur
- 5,633
- 10
- 32
- 36
23
votes
5 answers
How to create unit tests against non in-memory database such as MySQL in Play framework, with resetting to known state?
I want to create unit tests that cover code that use relational database in Play framework 2.1.0. There are many possibilities for this and all cause problems:
Testing on in-memory H2 database
Play framework documentation proposes to run unit tests…

kolen
- 2,752
- 2
- 27
- 35
21
votes
2 answers
Stored procedures and unit testing
Does anybody know of a framework (or methodology) to unit test stored procedures just using SQL and be able to produce a reasonable report as to what has passed and what has failed (something similar to CPPUnit)?

Ed Heal
- 59,252
- 17
- 87
- 127
11
votes
4 answers
Best tool for unit testing in MySQL
I've been doing a lot of sproc programming in MySQL lately.
And I must say that I like it. A lot.
However debugging these babies sucks.
Anyone know of any tools that can put some happiness in My MySQL debugging?

Johan
- 74,508
- 24
- 191
- 319
10
votes
6 answers
Database integration tests
When you are doing integration tests with either just your data access layer or the majority of the application stack. What is the best way prevent multiple tests from clashing with each other if they are run on the same database?

Garry Shutler
- 32,260
- 12
- 84
- 119
10
votes
1 answer
Does SQL Server support in-memory database?
I have basically a testing scenario, where I
Create database
Fill it with some data
Execute the business logic to be tested, which modifies the data. I don't own the business logic implementation or the DB schema. I must test what is already…

Liero
- 25,216
- 29
- 151
- 297
7
votes
2 answers
PHPUnit: Multiple datasets on database testing
Is it possible to load multiple flat xml datasets on PHPUnit to load lots of fixtures?
We are writing a rather complex application and the xml dataset is getting pretty big, so I would like to slip it into 2-3 xml.
Here is the current code for a…

paul.ago
- 3,904
- 1
- 22
- 15
6
votes
0 answers
How to perform unit testing on Postgres using SQLAlchemy in Windows?
I am working on a Flask app for APIs and created few Flask-SQLAlchemy models.
I have written a function which takes a list of dictionaries and insert them into Postgres database model tables as rows using Flask-SQLAlchemy.
It's inserting the data…

Underoos
- 4,708
- 8
- 42
- 85
5
votes
1 answer
Rails databases, why use same DBMS for development and production?
I really can't seem to find an accurate explanation on why you should use the same database in development as in production. I personally love using sqlite3 in development (it's light, easy to use, and has a sweet sqlite browser GUI tool), then use…

Spencer Hire
- 735
- 3
- 14
- 32
5
votes
1 answer
How to test flyway migration?
Usually migration script is simple like adding new column or so and if applications if deployed then everything is ok. but sometimes there is some complex logic involved that should be tested. what is the recommended approach?

piotrek
- 13,982
- 13
- 79
- 165
5
votes
3 answers
Load and Performance Testing of a Database
This is the first time, my team has asked me to do some testing on Database which I have no clue how to approach. By testing on database I mean, I need to see how fast it can insert records into it. And till what pressure it can handle. Just like…

arsenal
- 23,366
- 85
- 225
- 331
5
votes
2 answers
Using unit tests and a test database
How would I use NUnit and a test database to verify my code? I would in theory use mocks (moq) but my code is more in maintenance shape and fix it mode and I don't have the to setup all the mocks.
Do I just create a test project, then write tests…

cdub
- 24,555
- 57
- 174
- 303
5
votes
3 answers
JUnit Database Testing and Ordering of Tests
I think its common for database tests to include CRUD operations. So these functions modify the database making the expected vales change: eg. if I test that a SELECT returns 2 rows, if a delete test runs 1st, I might just get a failure. Similar to…

Jiew Meng
- 84,767
- 185
- 495
- 805
4
votes
3 answers
Complete db schema transformation - how to test rewritten queries?
Our database is poorly designed all the way around (we inherited it). I've reworked the schema to something useable and maintainable. Quite a few tables and columns have been dropped, many columns have moved and most tables and columns have been…

Paul
- 19,704
- 14
- 78
- 96
4
votes
3 answers
PHPUnit/DBUnit Handle Timestamp Column
I am trying to use PHPUnit/DBUnit to test my Zend Framework DbTable models. I am getting tripped up with tables that have a timestamp.
I am trying to use assertDataSetsEqual to compare an the actual results of an insert to the expected results. Of…

bconrad
- 402
- 4
- 14