Markup metadata

11 Markup metadataThe simplest definition of metadata is that it is data about data. Metadata might be very useful. As for the markup there was some metadata embedded: id, small description of assertion, link to test. During the markup transfer I realized that more metadata would be very helpful. In the new version of specification there were several kinds of assertions:

  • old:
    non-changed text, tests do not need any changes;
  • oldToBeChanged:
    text changed, tests do need to be changed;
  • new:
    totaly new text, new tests needed;
  • newWritten:
    new text, but tests already exist (because the test development process began as soon as the draft spec was avaliable);
  • newWrittenToBeChanged:
    new text, tests exist, draft spec changed, so the tests need to be changed or existing tests are not enough.

Adding this kind of data to the markup would greatly simplify the future work – the test development. Because just by looking at an assertion in the spec one can easily say if more tests are needed or several should be updated.

With the given markup architecture is was decided to use the title attribute in a-href tag (the second anchor). So the markup would look like:

<a name=assertionID><!– shord description as html comment –>
assertion statement here
<img src=”pics/assert.gif”><a href=”path to test” title=assertType>test ID which is the same as assertion ID</a>

The title attribute can be viewed in a browser as a hint.

JLS3 html Markup metadata

JLS3 html code Markup metadata



, , , , , , , , , ,
       

    Markup transfer – nightmare or a piece of cake?

    train Markup transfer   nightmare or a piece of cake?
    The whole process of creating a markup and developing tests is time consuming. And when it seems that the work is done, a new version of spec is released. What happens next? Of course there is a need of a new version of the test suite. New tests must be written and the old ones updated or even deleted.

    The best way to start is to do the markup. This task can be devided into two subtasks:

    • transfer old markup from previous spec to the new spec (this is needed because many tests were already  written, they are linked to spec id’s, reusing all possible tests is a good idea);
    • markup new and updated assertions.

    Transferring the markup is simple enough to do it by hand:

    1. Find the markup tag in the old spec.
    2. Find the best place to insert the tag in the new version of spec.
    3. Insert the tag.

    If there are only 10 assertions – this work is a piece of cake. But if there are thousands it is a hard job that should be automated. The hardest part is to find a new proper place for markup tags. It’s hard just because the spec was changed. For JLS2 to JLS3 migration process the flollowing alrorithm was used:

    Each assertion is rounded with html anchors. Both of them should be transferred using such algorithm.

    Hin 1t: if some tag is transfered, there is a great possibility, that next tag in old spec will be positioned after the one that is transfered.

    Hint 2: algorithm should check that the second anchor should be positioned after the first one and not too far from it.

    1. Look at the text before and after tag in old spec. Find it in the new spec. If one of them72s Markup transfer   nightmare or a piece of cake? wasn’t changed – the answer is found. usually the length should be 1-2 sentances, at least 60 characters long. If none or several sentances found – skip this step.
    2. Try to do the same as in (1), but remove all html tags from the near text that surrounds the tag. If none found – skip this step.
    3. Try the adopt algorithm, which tries to find similar text in the new spec.
      a. Use steps (1) and (2), but desrease the length of the searching text in a loop until the sentance is found or the length is too short. The practical work showed that this number shouldn’t be less than 20.
      b. If steps (1) and (2), or (3a) found several sentances increase the length of the text to search until the text is found in the new spec or the upper limit (f.e. 140 chars) is reached. Use hints to find the best matching text.

    Adopt algorithm could be used with both ignoring html tags and taking advantage of them. Algorithm is valid for specs written in plain text, html or xml.

    This algorithm was implemented in JLS2->JLS3 markup transfer tool. 84% of the markup tags were transfered automatically. The rest of them were done manually.



    , , , , , ,