From version 4.2 DBTestDriven framework supports dynamic runtime fake objects creation.
Framework allows developer to create custom fake objects to replace dependencies in the database code, and allow developers supplement current existing functionality, at runtime, with predefined testable behavior and then verify code interactions in a unit test.

This functionality is very powerful, and it means that you can tell your fake objects, for each individual test, how to behave, and then verify expected and actual code behavior.

STUB and MOCK are two kinds of pretend objects that create a copy or a clone, based on the original procedure that already exist in a database, with following similarities and differences between two pretend objects:

STUB   MOCK
STUB is the copy of original procedure that has the same signature and intended to be used side by side with original. STUB procedure have following qualities: Different MOCK is a replacement of the original stored procedure that allows user to inject-new and override existing functionality without explicitly introducing changes to existing database code. MOCK procedure will have following qualities:
STUB will have same signature as original procedure, including parameter default values and direction for output parameters Same MOCK will have same signature as original procedure, including parameter default values and direction for output parameters
STUB will have different name from the original procedure. Different MOCK will have the same name as the original procedure.
The original procedure will be renamed with unique name and preserved in the database. The new name for the original stored procedure can be found in the DBTD_TBL_PRETEND_OBJECT table Original Name column
STUB will only run the code that specified in the v_StubSQL parameter Different MOCK can be configured to run SQL code from original stored procedure or substitute an old code with new one that can be executed: BEFORE, AFTER or INSTEAD-OF an original procedure code
STUB will record information about each procedure call, together with the supplied parameter values for each individual procedure execution. Data will be stored in the DBTD_TBL_PRETEND_OBJECT_LOG and DBTD_TBL_PRETEND_OBJECT_PARAM_LOG tables Same MOCK will record information about each procedure call, together with the supplied parameter values for each individual procedure execution.  Data will be stored in the DBTD_TBL_PRETEND_OBJECT_LOG and DBTD_TBL_PRETEND_OBJECT_PARAM_LOG tables
Error will occur if database already have procedure with the name specified in the v_STUBProcName parameter Different  
Error occur if database does not have original procedure with the name specified in the v_OriginalProcName parameter Same Error occur if database does not have original procedure with the name specified in the v_ProcName parameter
DBTestDriven framework will track STUB execution for each individual unit test run Same DBTestDriven framework will track STUB execution for each individual unit test run