summaryrefslogtreecommitdiffstats
path: root/eng/req/items.rst
blob: 0c13bb29c75841db8f6ff816a591f0935101055c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
.. SPDX-License-Identifier: CC-BY-SA-4.0

.. Copyright (C) 2019, 2020 embedded brains GmbH (http://www.embedded-brains.de)

.. _ReqEngSpecItems:

Specification Items
===================

The technical specification of RTEMS will contain requirements, specializations
of requirements, :ref:`test procedures <ReqEngTestProcedure>`,
:ref:`test suites <ReqEngTestSuite>`, :ref:`test cases <ReqEngTestCase>`, and
:ref:`requirement validations <ReqEngValidation>`.  These things will be called
*specification items* or just *items* if it is clear from the context.

The specification items are stored in files in :term:`YAML` format with a
defined set of key-value pairs called attributes.  The key name shall match
with the pattern defined by the regular expression
``[a-zA-Z0-9][a-zA-Z0-9-]+``.  In particular, key names which begin with an
underscore (``_``) are reserved for internal use in tools.

Each specification item shall have the following attributes:

enabled-by
    The value shall be a list of expressions.  An expression is an operator
    or an option.  An option evaluates to true if it is included the set of
    enabled options of the configuration.  An operator is a dictionary with
    exactly one key and a value.  Valid keys are *and*, *or*, and *not*:

    * The value of the *and* operator shall be a list of expressions.  It
      evaluates to the *logical and* of all outcomes of the expressions in
      the list.

    * The value of the *or* operator shall be a list of expressions.  It
      evaluates to the *logical or* of all outcomes of the expressions in
      the list.

    * The value of the *not* operator shall be an expression.  It negates
      the outcome of its expression.

    The outcome of a list of expressions without an operator is the
    *logical or* of all outcomes of the expressions in the list.  An empty
    list evaluates to true.  Examples:

    .. code-block:: none

        enabled-by:
        - RTEMS_SMP

    .. code-block:: none

        enabled-by:
        - and:
          - RTEMS_NETWORKING
          - not: RTEMS_SMP

    .. code-block:: none

        enabled-by:
        - and:
          - not: TEST_DEBUGGER01_EXCLUDE
          - or:
            - arm
            - i386

links
    The value shall be a list of key-value pairs defining links to other
    specification items.  The list is ordered and defines the order in
    which links are processed.  There shall be a key *role* with an
    unspecified value.  There shall be a key *uid* with a relative UID to
    the item referenced by this link.  Other keys are type-specific.
    Example:

    .. code-block:: yaml

        links:
        - role: build-dependency
          uid: optpwrdwnhlt
        - role: build-dependency
          uid: ../../bspopts
        - role: build-dependency
          uid: ../start

type
    The value shall be the specification :ref:`item type <ReqEngItemTypes>`.

The following attributes are used in specification items of various types:

.. _ReqEngItemAttrLicense:

SPDX-License-Identifier
    The value should be ``BSD-2-Clause OR CC-BY-SA-4.0``.  If content is
    imported from external sources, then the corresponding license shall be
    used.  Acceptable licenses are BSD-2-Clause and CC-BY-SA-4.0.  The
    copyright holder of the external work should be asked to allow a
    dual-licensing BSD-2-Clause or CC-BY-SA-4.0.  This allows generation of
    BSD-2-Clause licensed source code and CC-BY-SA-4.0 licensed documentation.

.. _ReqEngItemAttrCopyrights:

copyrights
    The value shall be a list of copyright statements of the following formats:

    * ``Copyright (C) <YEAR> <COPYRIGHT HOLDER>``

    * ``Copyright (C) <FIRST YEAR>, <LAST YEAR> <COPYRIGHT HOLDER>``

    See also :ref:`FileHeaderCopyright`.

.. _ReqEngItemTypes:

Item Types
----------

Specification items can have all sorts of *types*.  The selection of types and
the level of detail depends on a particular standard and product model.  We need
enough flexibility to be in line with ECSS-E-ST-10-06 and possible future
applications of other standards.  Each item may have a list of types.  Valid
types are listed below.  This list may change over time.  If new types are
added, then a mapping between types should be specified.  The item types and
their definition is work in progress.  A list of types follows:

* requirement

    * functional - Functional requirements shall describe the behaviour of the
      software product under specific conditions.

        * *capability*

        * *dependability-function*

        * *function*

        * *operational* - Operational requirements shall

            * define the operation modes (e.g. initialization, multitasking, termination),

            * describe the operation modes, and

            * describe the operation mode transitions.

        * *safety-function*

    * non-functional

        * *build-configuration*

        * *constraint*

        * *design*

        * *interface*

        * *interface-requirement*

        * *maintainability*

        * *performance*

        * *portability*

        * *quality*

        * *reliability*

        * *resource*

        * *safety*

* *test-procedure*

* *test-suite*

* *test-case*

* *validation-by-analysis*

* *validation-by-inspection*

* *validation-by-review-of-design*

* *validation-platform*

.. image:: ../../images/eng/req-spec-items.*
    :scale: 70
    :align: center

Requirements
------------

All requirement specification items shall have the following attribute:

rationale:
    The rationale or justification of the specification item.

Build Configuration
-------------------

Build configuration requirements define what needs to be built (libraries,
object files, test executables, etc.) and how (configuration option header
files, compiler flags, linker flags, etc.).  The goal is to generate build
files (Makefile or waf) and content for the Software Configuration File (SCF)
from it.  A YAML scheme needs to be defined for this purpose.

.. _ReqEngInterfaceReq:

Interface Requirement
---------------------

Interface requirements shall describe the high level aspects of interfaces.
The item type shall be *interface-requirement*.

.. _ReqEngInterface:

Interface
---------

.. warning::

    This is work in progress.

Interface items shall specify the interface of the software product to other
software products and the hardware.  The item type shall be *interface*.  The
interface items shall have an *interface-category* which is one of the
following and nothing else:

* *application*: Application interface items shall describe the interface
  between the software product and the application (:term:`API`).  The goal is
  to generate header files with Doxygen markup and user manual documentation
  parts from the application interface specification.

* *application-configuration*: Application configuration items shall define
  parameters of the software product which can be set by the application at
  link-time.  The goal is to generate user manual documentation parts and test
  cases from the application configuration specification.

* *architecture*: Architecture interface items shall define the
  interface between the software product and the processor architecture
  (:term:`ABI`).

* *gcc*: GCC interface items shall define the interface between the software
  product and GCC components such as libgcc.a, libatomic.a, libgomp.a,
  libstdc++.a, etc.

* *hardware*: Hardware interface items shall define the interface between the
  software product and the hardware.

* *newlib*: Newlib interface items shall define the interface between the
  software product and the Newlib (libc.a).

The interface items shall have an *interface-type* which is one of the
following and nothing else:

* *configuration-option*

* *define*

* *enum*

* *function*

* *header*

* *macro*

* *register-block*

* *structure*

* *typedef*

* *union*

* *variable*

.. _ReqEngInterfaceApplicationConfigGroups:

Interface - Application Configuration Groups
--------------------------------------------

The application configuration group items shall have the following attribute
specializations:

SPDX-License-Identifier
    See :ref:`SPDX-License-Identifier <ReqEngItemAttrLicense>`.

appl-config-group-description:
    The value shall be the description of this application configuration group.

appl-config-group-name:
    The value shall be the name of this application configuration group.

copyrights
    See :ref:`copyrights <ReqEngItemAttrCopyrights>`.

interface-type
    The interface type value shall be *appl-config-group*.

link
    There shall be a link to a higher level requirement.

text
    The application configuration group requirement.

type
    The type value shall be *interface*.

.. _ReqEngInterfaceApplicationConfigOptions:

Interface - Application Configuration Options
---------------------------------------------

The application configuration option items shall have the following attribute
specializations:

SPDX-License-Identifier
    See :ref:`SPDX-License-Identifier <ReqEngItemAttrLicense>`.

appl-config-option-constraint
    This attribute shall be present only for *initializer* and *integer*
    type options.  The value shall be a dictionary of the following optional
    key-value pairs.

    custom
        The value shall be a list of constraints in natural language.  Use the
        following wording:

            The value of this configuration option shall be ...

    min
        The value shall be the minimum value of the option.

    max
        The value shall be the maximum value of the option.

    links
        The value shall be a list of relative UIDs to constraints.

    set
        The value shall be the list of valid values of the option.

appl-config-option-default
    This attribute shall be present only for *feature* type options.  The value
    shall be a description of the default configuration in case this boolean
    feature define is undefined.  Use the following wording:

        If this configuration option is undefined, then ...

appl-config-option-default-value
    This attribute shall be present only for *initializer* and *integer*
    type options.  The value shall be an initializer, an integer, or a
    descriptive text.

appl-config-option-description
    For *feature* and *feature-enable* type options, the value shall be a
    description of the configuration in case this boolean feature define is
    defined.  Use the following wording:

        In case this configuration option is defined, then ...

    For *initializer* and *integer* options, the value shall describe the
    effect of the option value.  The description should focus on the average
    use-case.  It should not cover potential problems, constraints, obscure
    use-cases, corner cases and everything which makes matters complicated.
    Add these things to *appl-config-option-constraint* and
    *appl-config-option-notes*.  Use the following wording:

        The value of this configuration option defines ...

appl-config-option-index
    The value shall be a list of entries for the document index.  By default,
    the application configuration option name is added to the index.

appl-config-option-name
    The value shall be the name of the application configuration option.  Use a
    pattern of ``CONFIGURE_[A-Z0-9_]+`` for the name.

appl-config-option-notes
    The value shall be the notes for this option.  The notes should explain
    everything which was omitted from the description.  It should cover all the
    details, special cases, usage notes, error conditions, configuration
    dependencies, and references.

appl-config-option-type
    The value shall be one of the following and nothing else:

    feature
        Use this type for boolean feature opions which have a behaviour in the
        default configuration which is not just that the feature is disabled.

    feature-enable
        Use this type for boolean feature opions which just enables a feature.

    initializer
        Use this type for options which initialize a data structure.

    integer
        Use this type for integer options.

copyrights
    See :ref:`copyrights <ReqEngItemAttrCopyrights>`.

interface-type
    The interface type value shall be *appl-config-option*.

link
    There shall be a link to the application configuration group to which this
    option belongs.

text
    The application configuration option requirement.

type
    The type value shall be *interface*.

.. _ReqEngTestProcedure:

Test Procedure
--------------

Test procedures shall be executed by the Qualification Toolchain.

The test procedure items shall have the following attribute
specializations:

type
    The type value shall be *test-procedure*.

text
    The purpose of this test procedure.

platform
    There shall be links to validation platform requirements.

steps
    The test procedure steps.  Could be a list of key-value pairs.  The key
    is the step name and the value is a description of the actions
    performed in this step.

.. _ReqEngTestSuite:

Test Suite
----------

Test suites shall use the :ref:`RTEMS Test Framework <RTEMSTestFramework>`.

The test suite items shall have the following attribute specializations:

type
    The type value shall be *test-suite*.

text
    The test suite description.

.. _ReqEngTestCase:

Test Case
---------

Test cases shall use the :ref:`RTEMS Test Framework <RTEMSTestFramework>`.

The test case items shall have the following attribute specializations:

type
    The type value shall be *test-case*.

link
    The link to the requirement validated by this test case or no links if
    this is a unit or integration test case.

ref
    If this is a unit test case, then a reference to the :term:`software
    item` under test shall be provided.  If this is an integration test
    case, then a reference to the integration under test shall be provided.
    The integration is identified by its Doxygen group name.

text
    A short description of the test case.

inputs
    The inputs to execute the test case.

outputs
    The expected outputs.

The test case code may be also contained in the test case specification
item in a *code* attribute.  This is subject to discussion on the RTEMS
mailing list.  Alternatively, the test code could be placed directly in
source files.  A method is required to find the test case specification of
a test case code and vice versa.

.. _ReqEngResAndPerf:

Resources and Performance
-------------------------

Normally, resource and performance requirements are formulated like this:

* The resource U shall need less than V storage units.

* The operation Y shall complete within X time units.

Such statements are difficult to make for a software product like RTEMS which
runs on many different target platforms in various configurations.  So, the
performance requirements of RTEMS shall be stated in terms of benchmarks.  The
benchmarks are run on the project-specific target platform and configuration.
The results obtained by the benchmark runs are reported in a human readable
presentation.  The application designer can then use the benchmark results to
determine if its system performance requirements are met.  The benchmarks shall
be executed under different environment conditions, e.g. varying cache states
(dirty, empty, valid) and system bus load generated by other processors.  The
application designer shall have the ability to add additional environment
conditions, e.g. system bus load by DMA engines or different system bus
arbitration schemes.

To catch resource and performance regressions via test suite runs there shall be
a means to specify threshold values for the measured quantities.  The threshold
values should be provided for each validation platform.  How this can be done
and if the threshold values are maintained by the RTEMS Project is subject to
discussion.