Thursday, February 18, 2010

Unit Testing with SQL Developer

December's release of SQL Developer 2.1 has a number of new bells and whistles. Two of the main new features are:

  • Data Model Viewer. This is a free, read only, viewer based on Oracle SQL Developer Data Modeler. With this viewer you can open existing data models as well as generate data models based on your database. The generated data model can not be saved though.
  • Unit Testing. Based on the popular xunit Four Phase Test pattern, this feature makes testing of procedures and functions a breeze. Put simply, it allows one to construct a repository of unit tests cases which includes what one would expect for automated testing: setup, execute, assert result, record results, teardown.
The free Data Model Viewer is a nice introduction to the Data Modeler product which is not free. The unit testing framework though really does mean that the quality of code in the database can be asserted and maintained much easier than previously possible. There is a simple Oracle By Example tutorial on the SQL Developer Unit Test feature available at:

http://www.oracle.com/technology/obe/11gr2_db_prod/appdev/sqldev/sqldev_unit_test/sqldev_unit_test_otn.htm

No comments: