Articles, tutorials, videos and tools to perform software testing for database development (Oracle, MySQL, SQLServer, PostgeSQL, NoSQL, etc.)
In this blog post, Nicolas Frankel explains how to perform unit testing on a database using DBUnit, Spring and TestNG. DbUnit is a JUnit extension for database-driven projects that, among other things, puts your database into a known state between test runs. This is an excellent tool to avoid the issues that can occur when one test case corrupts the database and causes subsequent tests to fail. DbUnit has also the ability to export and import your database data to and from XML datasets.
This blog post explains how to perform unit testing of MySQL stored procedures. A stored routine is a set of SQL statements that can be stored in the server. Once this has been done, clients don’t need to keep reissuing the individual statements but can refer to the stored routine instead. To perform unit testing on stored procedures, you can use utMySQL, an open source unit test framework for MySQL stored procedures. This post provides a step by step process on how to create the test code in utMySQL which is also a stored procedure, run it and verify the results.
Running your SQL Server database unit tests within the scope of a single transaction allows you to roll back any changes that the test enacted after the test ends. This article propose a step by step approach to achieve this goal. You start to create a transaction in your Transact-SQL test script that uses BEGIN TRANSACTION and ROLLBACK TRANSACTION. Then you will create a transaction for a single test method in a test class and then a transaction for all test methods in a given test class.
In this blog post, Jens Schauder shares some tips based on experience to improve the testing of database code. People seem to understand the need to test their code, but apparently this is not yet the case for the the database code, because database tests tend to be slow, interdependent and hard to maintain
This blog post discusses the problem of testing the database code. It describes some of the problems and proposes possible partial solutions to this testing issue based on Hibernate and JUnit.
Apache JMeter is a performance testing tool which is entirely written in Java. Any application that works on request/response model can be load tested with JMeter. A relational database is not an exception: receives sql queries, executes them and returns the results of the execution. This post shows you how easy it is to set up test scenarios with the graphical user interface of JMeter.
This article overviews the importance of, and strategies for, regression testing relational databases. If your organization considers data to be a corporate asset and/or you’re implementing mission-critical functionality within your databases, shouldn’t you have a database testing strategy in place?