Archive for the ‘To do’ Category

Add persistence support to the kernel

February 9, 2009

We need to incorporate persistence into the tests that document and validate the kernel. Each clazz that can have persistent instances must have a corresponding record clazz. The kernel depends on this behavior (each kernel clazz is loaded from the ZeeStore), and the resulting functionality is a primary aspect of the very reason for Zeetix to exist.

I think (although I’m not sure) that every clazz, even those that do not have persistent instances, should have a corresponding record clazz that describes the clazz itself. There is a potential loop here, which I remember thrashing at for extended periods, about the relationship between instances of MetaclazzRecord, ClazzRecord, and so on.

I have since gotten into a bad habit of not adding transient clazzes (those that I know will never have persistent instances) into the ZeeStore. This will break as soon as we attempt to automatically generate non-python source code for those clazzes, because the ZeeStore will not contain the records needed to construct them.

Meanwhile, I need to document the recipe for creating a new clazz, so that we can add behavior to automate it. My bad habit is a result of the tedium of editing and updating the SQL and record clazzes when I didn’t absolutely need it.

The new tests should validate at least the following existing clazzes:

Kernel.Core.BehaviorRecord
Kernel.Core.BlockRecord
Kernel.Core.ClazzRecord
Kernel.Core.ItRecord

Kernel.ClazzDevelopment.ClazzCreatorRecord
Kernel.ClazzDevelopment.ClazzDefinitionDescriptorRecord

Kernel.CLDT.AdditiveSequenceableCollectionRecord
Kernel.CLDT.ArrayedCollectionRecord
Kernel.CLDT.ArrayJoinRecord
Kernel.CLDT.ArrayRecord
Kernel.CLDT.CollectionRecord
Kernel.CLDT.DictionaryRecord
Kernel.CLDT.KeyedCollectionRecord
Kernel.CLDT.OrderedCollectionRecord
Kernel.CLDT.ReferenceRecord
Kernel.CLDT.SequenceableCollectionRecord
Kernel.CLDT.SetRecord
Kernel.CLDT.SortedCollectionRecord
Kernel.CLDT.SystemDictionaryRecord
Kernel.CLDT.ZeeManyToManyStitchRecord
Kernel.CLDT.ZeeManyToOneStitchRecord
Kernel.CLDT.ZeeOneToManyStitchRecord
Kernel.CLDT.ZeeOneToOneStitchRecord
Kernel.CLDT.ZeePairJoinRecord
Kernel.CLDT.ZeeStitchRecord

Kernel.ZeeStore.ZeeMemoRecord

Perhaps these new tests should be incorporated into the tests for each  Kernel (sub)assembly.

Advertisements

Determine how to test for "Bug Patterns"

February 4, 2009

Certain kinds of bugs tend to be pervasive throughout the framework. In Python, for example, methods must explicitly return a value. How do I write a test that finds and fixes those that don’t?

Example: Each Clazz that has transient attributes should implement the “doTransientAttributeNames” hook. A typical example should look like this:

def doTransientAttributeNames(self):
    answer = [
        'attributeOne',
        'attributeTwo',
        ]
    return answer

I often forget the final line, and this in turn causes a recognizable symptom in the debugger — a “NoneType” exception in It>>allTransientAttributeNames.

How do I write a test that traverses implementors of doTransientAttributeNames and fails for those in which the “return” is missing?

How do I supply a list of hooks that require a return value (not all do) and apply the above test for each hook (in each clazz)?

How do I automatically incorporate this test into the interface specification of a clazz, so that when a new clazz is created this test is automatically applied to it?