News: Free Database Browser for Targeted Testing
The full article with illustrations is at http://datastorm.sourceforge.net/motivation.html Data Storm is a free open source data base browser. While there are millions of data base browsers freely available online, Data Storm is different as it can be launched directly from within your Java code. This enables you to see and modify data that otherwise may not be available to you. The primary reason for creating Data Storm is to make test driven development (TDD) easier, when test involve databases. An often used technique is after executing a test case, to roll-back the data base. Frameworks such as Spring natively support this strategy. The roll-back happens irregardless of an error or succesful execution of the test case. The biggest draw back of this testing approach is that should a test case fail it can be very difficult to resolve the problem as you cannot see the data involved with the executing code. Did the test fail because no rows were inserted, or is the load() flawed? Or maybe its the constraints on the load() that prevents it from finding the order (maybe only non-closed orders are found, or orders after year 2000,...). Resolving such simple problems can be very tedious indeed due to the lack of access to the underlying data. * Since the transaction is automatically rolled back at the end of the test an ordinary database browser cannot inspect the data. * Since during the execution of a test, all database inserts, deletes and updates happens in an isolated transaction, an ordinary database browser cannot inspect the data available to the test method. * Temporarily turning off the automatic roll-back after testing, can easily invalidate your existing reference data in the data base, hence requiring subsequent restoration (which may easily be quite time consuming). Solution Data Storm was invented to put the fun back into xUnit testing (at least for tests involving a database. It is simply a database viewer, that uses the same transaction as your tests, hence it has access to display or even modify your data! Launching requires the following code to be inserted just before the assertXX() that fails. The variable connection refers to your database connection established within your test code. new DataStorm().show( connection ); Which when executed presents you with a window showing the actual content of the database.
- Posted by: carlo santos
- Posted on: June 18 2008 19:27 EDT
- Re: Free Database Browser for Targeted Testing by Thomas Mueller on June 23 2008 10:13 EDT
- Re: Free Database Browser for Targeted Testing by Anjan Bacchu on June 23 2008 12:13 EDT
- Data Storm, a different database browser by carlo santos on June 24 2008 14:48 EDT
This sounds like a fun feature. Are you planning to patent it? If not I will try to implement it as well in 'my' browser based database tool.
This sounds like a fun feature. Are you planning to patent it? If not I will try to implement it as well in 'my' browser based database tool.Hi There, I have felt the same needs several times while doing junit testing. I'm sure others have felt similar needs. The only reason why I didn't come up with such a GUI was because I was lazy to do one :-) All the same, Thanks for developing such a tool. java developers need more such contributions from the community :-) BR, ~A
Hi Anjan Thanks for your kind words. What feature(s) would you like to see in the next release then to make the tool even better? ;-) kasper
I'm not sure what you mean by patenting the ideaWhat I meant is: do you plan to patent the idea of allowing to open a database browser using an existing connection? Many patents are based on ideas that are not nearly as smart...or how I could pursue such an endeavour. Any hints? ;-)Sorry, I don't understand what you mean here?The jar is ultra-smallYes, 52 KB is small.What feature(s) would you like to see in the next releaseAn autocomplete feature would be nice. Regards, Thomas
Thank you Kasper. I posted a blog item frustrated in such a situation : http://anjanb.wordpress.com/2007/09/07/jdbc-why-doesnt-oracles-driver-support-read_uncommitted/ More and more dbunit/dao testers need to have this tool. I will use it in my next Dao development and get back to you with feedback on features.
Hi Thomas. I'm not sure what you mean by patenting the idea or how I could pursue such an endeavour. Any hints? ;-) That being said, I think Data Storm is a very different kind of DB browser - which shouldn't really come as a surprise given its tailored for a specific purpose. * The jar is ultra-small and its using SWT to have a fast and responsive GUI. When tests are failing, the last thing I want to do is to sit and wait for SWING to paint itself (shudder) * The ability to inline state from the test code into the SQL being fired I think is quite cunning but also pose problematic in terms of say externally persisting queries. I have some ideas in this regard, but they are far from the standard "save" option seen in normal DB browsers * Data Storm is quite new and not that feature rich at the moment. I want to extend it, but I also wanted to share its present state with others to see if other people would find the tool useful. As soon as emails/messages starts rolling in, I promise exciting releases ;-)