3. Creating catalogue of requirements

Now that the requirements have been identified and marked up properly, ReqMarkup tool allows to create a catalogue of requirements. The catalogue contains IDs and textual representations of the requirements on the group of functions under test.

The tests generated for most of T2C targets look for the text of the requirement with a given ID in this catalogue in case of a failure. This is done automatically by T2C API functions and requires no effort of the developer after the catalogue is prepared.

The catalogue can be used for other purposes as well, for instance, by the tools that analyse which requirements were being checked in a given test run and which ones were not.

The current format of a catalogue of requirements is XML-based. A file containing the catalogue begins with an ordinary XML header (<?xml version="1.0"?>). The catalogue has a root element (<requirements>) and one or more <req> elements within the root element. ID of a requirement is specified in the id attribute of the corresponging <req> tag, the body of the latter being the textual representation of the requirement. An example of a simple catalogue of requirements is given below.

<?xml version="1.0"?>
<req id="g_array_new.01">
     Creates a new GArray.
<req id="g_array_new.02">
    If 'zero_terminated' is TRUE, the array shall have 
an extra element at the end which is filled with 0s.
<req id="g_array_new.03">
    If 'clear_' is TRUE, the GArray elements shall be 
automatically cleared to 0 when they are allocated.
<req id="ext.g_array_new.06">
    The size of the array shall be 0 upon creation.
<req id="g_array_free.01">
     Frees the memory allocated for the GArray.
<req id="g_array_free.02">
    If free_segment is TRUE it frees the actual element data as well.
<req id="g_array_free.03.01">
    The function returns the element data if free_segment is FALSE.
<req id="g_array_free.03.02">
    The function returns NULL if free_segment is TRUE.


Sometimes the requirements for a group of functions are specified in more than one HTML file. In this case, ReqMarkup tool can generate the complete catalogue of requirements for the functions from all these files.