ADL2 Runtime Design Notes

The ADL2 runtime design is built around the Test Environment Toolkit and its Java Language binding.  This document describes the classes that are provided by this runtime, and generally how these classes should be used by the generated tests.

It is divided into three parts:

  1. The ADLTest Class
  2. The ADLTestCase Class
  3. The ADLProductSet Class
The general philosophy of execution in this design is that the generated test instantiates an ADLtest object by calling its constructor. The generated test then calls the addParameter method for each of the TDD test variables in the test, registering them with the system. It can then do any additional cleanup that it wants to. Finally, the generated code should call the main of the ADLTest object.

The main of the ADLTest object in turn begins a TET test session and passes the command line arguments to TET for processing.  From here, TET takes over.  TET reports certain configuration information to the results file (journal), and then executes the invocable components that have been selected on the command line.  Each of these invocable components is a test data instance. The TET test driver (in the class ADLTestCase) calls the runTestInstance method of the ADLTest object for each requested invocable component. Once all of the ICs have been executed, it performs some clean up and exits.

Within each invocable component, the model for test execution goes something like the following:

Call the appropriate factories to do setup
Report values returned from each factory through infoline method
Preserve call state variables
Call ACO(s)
    Call infoline to report out assertion under test
    If sub-expression breakdown requested, call infoline with
    value of each sub-expression
    after each assertion, call assertionResult to report result
call relinquish functions as needed

That's about it. The other methods of the ADLTest class are there for use by user supplied code in the assertions, the prolog, or the epilogue.

The ADLTestCase Class

This class is the main class for the interface with TET. This class must be instantiated by the test case, but its methods are purely internal.  It relies upon an instance of the ADLTest class (or a child thereof) and its methods to access the generated tests. While its methods are public, they are not ever accessed by the generated tests.  The methods are:
 

The ADLTestCase Constructor

The ADLTestCase constructor method takes an ADLTest object as an argument.
 

The max_ic and min_ic methods

Return the lowest and highest numbered invocable components to the JET IC driver.
 

The run_ic method

Executes the test purposes in an invocable component.  In our case, there is only one test purpose.
 

The tp_run method

Executes a specific test purpose within the invocable component.  In our case, it merely calls the runTestInstance method of the ADLTest class with the test data instance number to execute.

The ADLTest Class

This class is the master class for ADL-generated test cases. It needs to be extended by the actual generated test case. The methods in this class are the only methods the generated test cases are expected to use.
 

addParameter

Adds information about a TDD test variable to the test data set for this test run. Should be called during initialization by the generated test for each of the test variables in the test data set.

assertionResult

Used by the generated test to report intermediate results to the TET runtime on a per-assertion basis. The aggregate result of the assertion is determined after the test run by the TET runtime.

result

Can be called to post a specific result if needed. User by assertionResult as well. Maybe should be made private.

infoline

Can be called to output information to the journal.

setblock

Used to break down subsections of journal information in the TET journal.  In our case, we will use blocks to identify data specific to each assertion. assertionResult calls setblock after posting the result for the assertion and outputting information about that intermediate result to the journal.

getNumInstances

Reports the number of test data instances given the cross product of the registered parameters.

runTestInstance

Executes a specific test data instance.  Calls the provide factories for the registered parameters, then calls the ACO run method passed in to the ADLTest constructor during initialization by the generated code. Finally, calls the relinquish functions if appropriate.

getvar

Retrieves the value of TET execution configuration variables from the environment. User for dynamic configuration of tests. Used by the system to, for instance, determine if the user wants to have subexpression breakdown turned on.

The ADLProductSet Class

This class is used internally to manage the structure of the test data set that is provided by the TDD and TDD factories.  It is accessed through methods in the ADLTestCase class. It is never called by anyone except runTestInstance, addParameter, and getNumInstances above.