Important: From January 2013, DBFit has moved and the new home is http://benilovj.github.com/dbfit. This page is outdated and will no longer be updated.
DbFit is a set of FIT fixtures which enables FIT/FitNesse tests to execute directly against a database. This enables developers to manipulate database objects in a relational tabular form, making database testing and management much easier then with xUnit-style tools. The library is free to use, released under GNU GPL.
- Regression testing for queries and SQL statements
- Functional testing for stored procedures and functions
- Automatic transaction control and various short-cuts to make writing test scripts easier and more efficient
- Support for DB2, Oracle, SQL Server (java and .net versions), MySql 5 and Derby (only java)
For more details, see DbFit pages on fitnesse.info.
After introducing FitNesse into a big .NET project, I found that we were still lacking test-coverage for a lot of DB (legacy) code, and that DB developers have a long feedback loop, so they were not really benefiting from TDD. FitNesse was a good solution because it enabled DB developers to write functional tests much easier than in pl/sql based unit testing libraries, and without getting Java developers involved to write those as JUnit tests. Although FitNesse is typically used for acceptance tests, the combination of FitNesse+DbFit filled the testing gap for our DB code with excellent results. In fact, as the natural DB interface is relational, FitNesse tables allow writing database tests much more efficiently than using function-centered unit testing libraries. For a more detailed view into the background of DbFit, see Fighting the Monster.
- Enable managing database state from FitNesse as an utility for integration tests involving databases, by .Net and Java developers
- Enable the use of FitNesse for effective database acceptance and unit testing by DB developers (with no .Net/Java knowledge)
The first group mainly needs reusable fixtures which they can use, either directly on the page or embedded in their project-specific fixtures, and will not mind digging into a bit of Java/.Net code. But the other group must not be made to wait for Java/.Net developers to do effective TDD. So the project is taking a dual approach – developing test fixtures which will be reusable and extendable, but also developing one arch-test fixture which can control the connection, transactions and test flow in a fitlibrary flow mode. So Java/.Net developers can utilise the fixtures directly, and DB developers will be able to utilise the test fixtures through the over-arching fixture control.
See other FitNesse resources on this site
For support and to send questions, comments and ideas, join the DbFit discussion group on google groups. Comments are no longer enabled on this page.