Coverage file format » History » Version 5
Viktoria Kopach, 10/24/2014 06:49 PM
1 | 1 | Viktoria Kopach | h1. Format of the file that contains coverage info |
---|---|---|---|
2 | |||
3 | Coverage is described in XML. |
||
4 | |||
5 | <pre> |
||
6 | <?xml version="1.0" encoding="UTF-8"?> |
||
7 | <coverageInfo> |
||
8 | <reqcoverage qid="unique_id_of_requirement_or_test_purpose"> |
||
9 | <covered_by uri="path_to_covering_element" [hits="1"]/> |
||
10 | </reqcoverage> |
||
11 | <reqcoverage qid="unique_id_of_requirement_or_test_purpose"> |
||
12 | <covered_by uri="path_to_covering_element"/> |
||
13 | </reqcoverage> |
||
14 | <error [name="error_name"] testuri="uri_of_covered_by_element" [uri="link_to_error_description"]> |
||
15 | [<violates qid="unique_id_of_requirement_or_test_purpose"/>]* |
||
16 | [<description [format="error_description_format"]>error_description</description>] |
||
17 | </error> |
||
18 | </coverageInfo> |
||
19 | </pre> |
||
20 | |||
21 | Here: |
||
22 | |||
23 | Square brackets denote optional parameters. |
||
24 | |||
25 | - +*coverageInfo*+ - can be only one instance in the file. It contains multiple XML-elements *reqcoverage* (one or more) and *error* (can be absent, one or more). |
||
26 | |||
27 | 2 | Viktoria Kopach | - +*reqcoverage*+ - child-element for *coverageInfo*. Should be specified for every covered Requality-element. (Uncovered nodes are not specified at all.) Contains nested XML-elements *covered_by* (one or more). Every nested *covered_by* element should match one test procedure or test. *reqcoverage* element has attribute *qid*. |
28 | 1 | Viktoria Kopach | - +*qid*+ - is *user-visible-name(element)* or *qualifying-id(element)* of the covered element: |
29 | |||
30 | * *user-visible-name(element)* - is element name (if exists, i.e. if for this element name field in Properties view is not empty), |
||
31 | otherwise it is specified as user-visible-name(element.parent)/id, i.e. first specify user-visible-name of parent element, then specify element id (use ''/'' as delimeter). |
||
32 | For example: |
||
33 | "TR-FMF-01-01-002/TR-FMF-01-01-002_T01" |
||
34 | |||
35 | * *qualifying-id(element)* - is full path to the element beginning with root node (Requirements), ''/'' is used as a delimeter. |
||
36 | For example: |
||
37 | "Requirements/01/MyRequirement01" |
||
38 | |||
39 | 2 | Viktoria Kopach | - +*covered_by*+ - child element for *reqcoverage*. There could be several *covered_by* elements inside *reqcoverage*, it depends on how many test rocedures or tests cover corresponding Requality-element. Every *covered_by* element matches one covering Requality-element. *covered_by* has attributes: *uri* and *hits*. |
40 | 1 | Viktoria Kopach | - +*uri*+ - is attribute of *covered_by* XML-element, it specifies a path to the test described in this *covered_by*-element: |
41 | * if it is described a coverage of test purposes by test procedures then here *uri* is a path to test procedure step. |
||
42 | ** If test procedure is situated in the same project thep the path is specified without protocol, for example: |
||
43 | "/TestProcedures/01/TestStep04" |
||
44 | Here 01 - test procedure id, 04 - test procedure step number. |
||
45 | 3 | Viktoria Kopach | ** If test procedure is situated on the other Requality project then path looks like: |
46 | 1 | Viktoria Kopach | "requality://ProjectName/TestProcedures/01/TestStep04" |
47 | 3 | Viktoria Kopach | Where ProjectName is a name of the project where test procedure is situated. |
48 | 1 | Viktoria Kopach | |
49 | 3 | Viktoria Kopach | * if it is described a coverage of test purposes by test then here *uri* is a path to test. For example: |
50 | 1 | Viktoria Kopach | "file:///home/user/work/test1.c#12" |
51 | 3 | Viktoria Kopach | |
52 | - +*hits*+ - attribute of *covered_by* XML-element, it is optional. Indicates how many times this *reqcoverage* requirement is linked to in *covered_by* test. |
||
53 | |||
54 | - +*error*+ - element to describe error resulting from the test. Includes one *description* element with error description. Includes one or more optional *violates* elements if it is possible to define which exactly requirements are violated by this error. *error* element has attribute *testuri* and two optional attributes: *name* and *uri*. |
||
55 | - +*testuri*+ - path to test described in *covered_by* element |
||
56 | 4 | Viktoria Kopach | - +*name*+ - optional parameter, it is used to show displayed error name. If error name is not defined then "error"+error_index_number is used as *name*. |
57 | 3 | Viktoria Kopach | - +*uri*+ - optional parameter, path to file with more information about the error. |
58 | |||
59 | - +*violates*+ - optional element, corresponds to requirementthat is violated by the error.Every *violates* element corresponds to one violated requirement. *violates* element has attribute *qid*. If *violates* is not defined the error will not be shown in a report. |
||
60 | - +*qid*+ - is *user-visible-name(element)* or *qualifying-id(element)* of covered element(for more details see description of *reqcoverage* element above). |
||
61 | |||
62 | - +*description*+ - optional element, text description of the error. Has optional attribute *format*. |
||
63 | - +*format*+ - format of error description. Can be "html" or "plain". In case of "plain" all html tags will be shown as plain text. |
||
64 | 5 | Viktoria Kopach | - +*error_description*+ is a text of error description. For "html" format it is allowed to use html tags for text formatting. |
65 | 3 | Viktoria Kopach | |
66 | Example of file that contains coverage info: |
||
67 | |||
68 | <pre> |
||
69 | <?xml version="1.0" encoding="UTF-8"?> |
||
70 | <coverageInfo> |
||
71 | <reqcoverage qid="TR-FMF-01-01-001/TR-FMF-01-01-001_T02"> |
||
72 | <covered_by uri="/TestProcedures/01/TestStep05" hits="1"/> |
||
73 | </reqcoverage> |
||
74 | <reqcoverage qid="TR-FMF-01-01-001/TR-FMF-01-01-001_T01"> |
||
75 | <covered_by uri="/TestProcedures/01/TestStep03" hits="1"/> |
||
76 | </reqcoverage> |
||
77 | <reqcoverage qid="TR-FMF-01-01-001"> |
||
78 | <covered_by uri="/TestProcedures/01/TestStep01" hits="1"/> |
||
79 | </reqcoverage> |
||
80 | <reqcoverage qid="TR-FMF-01-01-002/TR-FMF-01-01-002_T01"> |
||
81 | <covered_by uri="/TestProcedures/01/TestStep02" hits="1"/> |
||
82 | </reqcoverage> |
||
83 | <reqcoverage qid="TR-FMF-01-01-006"> |
||
84 | <covered_by uri="/TestProcedures/01/TestStep04" hits="1"/> |
||
85 | </reqcoverage> |
||
86 | </coverageInfo> |
||
87 | </pre> |