AddThis Social Bookmark Button

Listen Print

A Unit Testing Framework for Oracle PL/SQL-- What's New

by Steven Feuerstein
03/20/2001

utPLSQL Update:
20 March 2001

utPLSQL version 1.5.6 is now available for download and installation! This release of the only unit testing framework for PL/SQL offers a range of significant new features, including:

  • Radically Improved Documentation: I know; that's what I said about 1.5.4, too. But it's true! Chris Rimmer, a utPLSQL contributor, took it upon himself to do a complete make-over and, believe me, he is lots better at designing documentation than I (Steven Feuerstein) am. Enjoy!

  • Revamped installation procedure: You may not notice much of a difference (well, you run utplsql_install.sql instead of install.sql to install the software), but the installation procedure is now 100% generated thanks to another "open source" utility I have procedured called OraShare. It won't make much of a difference to you, but it will help me maintain my install and deinstall scripts as utPLSQL expands. For more information on OraShare, check out the Oracle Professional newsletter or drop me a note.

  • Improved Functionality: There are new utAssert assertion routines so that you can, for example, check to see whether an exception was raised as expected. The utGen package now generates unit test packages that are much more structured and flexible. Most exciting of all (but still undocumented!) are some new overloadings of the utGen.testpkg procedure that let you pass in a "grid" of test case argument values from a file or string. This brings us closer to 100% of ready-to-go unit test packages, at least for functions that have all IN arguments (what can I say? I am still working on it!).

Here is an example. I create a "dummy" package and then generate a UTP for that package, specifying two test cases. Try it out. You'll like it!


CREATE OR REPLACE PACKAGE genall
IS
   PROCEDURE proc1 (
      val1   IN       NUMBER,
      val2   IN       DATE,
      val3   IN OUT   VARCHAR2,
      val4   IN       BOOLEAN
   );

   FUNCTION func1 (
      val1   IN       NUMBER,
      val2   IN       DATE,
      val3   IN OUT   VARCHAR2,
      val4   IN       BOOLEAN
   )
      RETURN BOOLEAN;
END;
/

DECLARE
   utc   VARCHAR2 (1000)
      := 
'#program name|test case name|message|arguments|result|assertion type
func1|allOK|allOK|1;12/15/1990;abc;true|true|eq
func1|vars|vars|!abc;!sysdate;abc;||isnull';
BEGIN
   utgen.testpkg_from_string ('genall',
      utc,
      output_type_in   => utgen.c_file,
     dir_in           => 'c:\temp'
   );
END;

utPLSQL Update:
7 November 2000

utPLSQL version 1.5.4, released just a month after the initial announcement of this unit-testing framework for Oracle PL/SQL, offers a range of significant new features, including:

  • Universal Oracle Availability: You can now use utPLSQL in Oracle7 (7.3.4 and above), Oracle8, and Oracle8i. The first release of utPLSQL was available only for Oracle8i. The installation script automatically detects the Oracle version and adjusts the source code appropriately. This means that utPLSQL can now be used by virtually all PL/SQL development organizations worldwide.

  • Radically Improved Documentation: The documentation set has been completely revamped and expanded, utilizing HTML to make the information more accessible, providing many more examples, and offering a Getting Started guide with four easy steps to using utPLSQL.

  • Improved Functionality: Error handling has been improved to make it easier to resolve problems (usually compile errors with the test packages). Clearer test-result displays allow developers to more easily verify success and identify test failures.

  • GNU Public License: utPLSQL is now made available under the GPL license.


Return to The utPLSQL Project