Toad World® Forums

Code Tester 1.9 beta available - time to test object types!


We have posted the first beta of Code Tester 1.9 today.

The major focus for 1.9 is to add support for automated testing of object type methods.
This beta release offers the first glimpse of this functionality; you should now be able
to define tests for constructors, static methods, and member procedures and functions.

You should also very much expect to encounter bugs, as this feature involves substantial
changes to Test Builder, Test Editor and the test code generator.

So if you want to test object type methods, please install and try out this beta version. And then provide us with feedback! But please do not use this in place of your commercial release.

Here are more details on the functionality provided (full Help is still “under construction”):

There are three main areas of enhancement:

  1. Test methods of an object type
  2. Specify values for attributes of object type parameters
  3. Testing the contents of an object type

You will find brief descriptions of each of these areas below.

** Test methods of an object type.

A method is a procedure or function defined in an object type specification. A method can be static, a constructor, or a member (which uses SELF either implicitly or explicitly in its parameter list). Then there are specialized members, such as MAP and ORDER.

When you ask to create a New Test, you will now see object types listed, in addition to packages, procedures and functions. When you pick an object type, all the methods of that type will appear in the drop down at the top of Test Builder. You then pick the method and start defining your tests.

In other words, it works just the same as testing subprograms of packages - but of course there are some differences.

If you are testing a member method, then all the attributes of the type are presented as inputs and possibly outcomes as well (if SELF is IN only, they will not be available as outcomes).

If you are testing a constructor, then we do not show you the attributes, only the parameters.

** Specify values for attributes of object type parameters

Prior to 1.9, if you had a parameter or return of object type, then you could only provide initialization and cleanup code for the input, and then write your own custom code to test the contents of the type. No longer!

Now, if your input or outcome is an object type, you can open the Properties Window for that type and you will see a grid of attributes. You can then assign values to each attribute.

Here are the current limitations on this implementation (and they will remain in place unless we hear loud and widespread complaints):

  1. You cannot specify multiple values (random value generation, lists, queries) for attributes.

  2. If an attribute of the OT is itself a complex type (another OT, a nested table, a varray), then you can only provide initialization and cleanup code to populate that attribute. In other words, the grid of attributes is only supplied for the top level of attributes.

** Testing the contents of an object type

You can now perform equality checks for an object type. That is, does the object type returned by the program match an expected object type?

If you have a MAP or ORDER method defined for the object type, this is always used to do the comparison.

If you do not have a MAP or ORDER method defined for the object type, Code Tester generates an equality comparison function that compares for equality each attribute whose type allows such a comparison. That is, nested object types, varrays, XMLtype attributes will all be ignored.



We found a bug in the 458 build that raised the “Function does notreturn value” when working with object type attributes. So we haveposted a new build.

If you already installed the beta 458 build, you do not have to do a full reinstall. Upgrade just the frontend and then compile the qu_attributes_xp.pkb into the Code Tester repository schema. Only this package body was changed.

Regards, Steven Feuerstein