Reference Manual For QP/C++ 8.1.5
Loading...
Searching...
No Matches
Systematic Capability Viewpoint

Observability Viewpoint

Design Viewpoint


[SDS_QP_SC]

Design viewpoint: Systematic Capability (SC).

Purpose

The Systematic Capability Viewpoint defines how the QP/C++ Framework design applies the techniques and measures required to achieve the desired systematic capability, defined as the measure of the confidence that the systematic safety integrity of the software meets the requirements of the specified SIL ([IEC 61508] SIL-3, [IEC 62304] Class-C, and [ISO 26262] ASIL-D). This viewpoint addresses only design-level concerns that is, the internal design principles, modeling methods, coding constraints, and structural techniques used to prevent, detect, or control systematic faults within the QP/C++ Framework itself.

Remarks
Application-level responsibilities, integration constraints, and fault-reaction obligations are defined elsewhere (Systematic Capability section of the Safety Manual SSM_QP).

Design Views

The design views in this viewpoint is aligned with the design-time techniques applied in QP/C++ to meet SIL-3/Class-C/ASIL-D expectations. These techniques correspond to IEC 61508-3 Annex A and Annex C recommendations and are implemented directly in the framework's design.

The following Table SDS-TBL-A4 provides a structured, SIL-dependent set of recommendations for software design and implementation techniques that help prevent, detect, or control systematic faults in safety-related software. It is part of the Annex A technique tables (A.1A.5), which collectively guide developers toward achieving the required Systematic Capability (SC) for a given Safety Integrity Level (SIL-3 in this case).

Table SDS-TBL-A4: Design Techniques/Measures for QP/C++ Framework component for SIL-3
([IEC 61508-3:2010] Table A.4).
Technique/Measure(*) IEC 61508
Ref.
SIL 3 QP/C++ Design View
1a Structured methods C.3.1 HR see choice 1b(<i>) & (</i>*)
1b Semi-formal methods Table B.7 HR View: Semi-Formal Methods
1c Formal design and refinement methods B.2.2 C.2.4 R see choice 1b(*)
2 Computer-aided design tools B.3.5 R not used
3 Defensive programming C.2.5 HR Design View: Defensive Programming
4 Modular approach Table B.9 HR View: Modular Approach
5 Design and coning standards C.2.5
Table B.1
HR View: Design and Coding Standards
6 Structured programming C.2.7 HR Design View: Structured Programming
7 Use of trusted/verified software elements (if available) C.2.10 HR Design View: Trusted/Verified Elements
8 Forward traceability between the software safety requirements specification and software design C.2.11 HR Design View: Design Traceability

NOTE 1 See [IEC 61508-3:2010] Table C.4
NOTE 2 There is still debate about the suitability of OO software development for safety-related systems. See [IEC 61508-7:2010] Annex G for guidance on object-oriented architecture and design.
NOTE 3 The references (which are informative, not normative) "B.x.x.x", "C.x.x.x" in column ("Ref.") indicate detailed descriptions of techniques given in Annexes B and C of [IEC 61508-3:2010].

(*) Alternative or equivalent techniques/measures are indicated by a letter following the number. It is intended that only one of the alternative or equivalent techniques/measures should be satisfied. The choice of alternative technique should be justified by the properties, given in [IEC 61508-7:2010] Annex C, desirable in the particular application.

(<i></i>) Group 1, "Structured methods". Use measure 1a only if 1b is not suited to the domain for SIL-3+4

View: Semi-Formal Methods

Regulatory background
The following Table SSRS-TBL-B7 provides a set of recommended semi-formal methods with their recommendation levels for SIL-3. Semi-formal methods are more rigorous than informal descriptions but less strict than fully formal methods.

Table SSRS-TBL-B7: Semi-formal techniques/measures for QP/C++ Framework for SIL-3 ([IEC 61508-3:2010] Table B.7).
Technique/Measure(*) IEC 61508
Ref.
SSIL 3
(#)
Requirements for
QP/C++ component
1 Logic/function block diagrams see NOTE 1 HR [SDS_QP_SFM_01]
2 Sequence diagrams see NOTE 2 HR [SDS_QP_SFM_02]
3 Data flow diagrams C.2.2 R not used
4a Finite state machines/state transition diagrams B.3.2 HR [SDS_QP_SFM_04A]
4b Timed Petri nets B.3.3 HR see choice 4a(*)
5 Entity-relationship-attribute data models B.2.4.4 R not used
6 Message sequence charts C.2.14 R see 2 "Sequence diagrams"
7 Decision/truth tables C.6.1 HR [SDS_QP_SFM_07]
8 UML C.3.12 R [SDS_QP_SFM_08]

NOTE 1 Logic/function block diagrams and sequence diagrams as described in IEC 61131-3

NOTE 2 See IEC 61508-3 Table C.17

NOTE 3 In the reference columns (entitled Ref), the informative references "B.x.x.x", "C.x.x.x" refer to descriptions of techniques in [IEC 61508-7:2010] Annexes B and C, while "Table A.x", "Table B.x" refer to tables of techniques in [IEC 61508-3:2010] Annexes A and B.

(*) Appropriate techniques/measures shall be selected according to the safety integrity level. Alternative or equivalent techniques/measures are indicated by a letter following the number. It is intended the only one of the alternative or equivalent techniques/measures should be satisfied. The choice of alternative technique should be justified in accordance with the properties, given in Annex C, desirable in the particular application.


[SDS_QP_SFM_01]

Design view: QP/C++ Framework specification shall apply semi-formal method: logic/function block diagrams (HR).

Description

Logic/function block diagrams (Table B.7 row 1) are a graphical method used to represent control logic by interconnecting standardized function blocks. Each block performs a specific operation (e.g., logic, arithmetic, timing, or control), and the diagram shows how data flows between them. QP/C++ Framework applies various types of logic/function block diagrams in the following figures:

  • Figure SRS-BLK Block diagram showing the context and functional decomposition of a system based on QP/C++ Framework.
  • Figure CONC-AOS Block diagram showing communicating Active Objects in QP.
  • Figure CONC-EVT-SIG Block diagram showing the relationship between Event-Signals and Events.
  • Figure CONC-SM-DIS Block diagram showing the event dispatching to a State Machine in QP/C++ Framework.
  • Figure CONC-EDM Block diagram showing the event delivery mechanisms in the QP/C++ Framework.
  • Figure CONC-QS-SET Block diagram showing typical setup for Software Tracing.
  • Figure CONC-QS-STR Block diagram showing structure of the QP/Spy Software Tracing system.
  • Figure SAS-LAYERS Block diagram showing context of use with layers and QP/C++ Framework interfaces.
  • Figure SDS-OSAL Block diagram showing QP Port implementing OS Abstraction Layer.
  • Figure FSM-SPEX Block diagram showing Spexygen information flow.

Backward Traceability

  • [SAS_QP_SCT_11B] Architectural view: Semi-formal methods in QP/C++ Framework component.

Forward Traceability (truncated to 2 level(s))

  • [SSM_QP_AOU_331] QP/C++ Application should apply semi-formal method logic/function block diagrams.

[SDS_QP_SFM_02]

Design view: QP/C++ Framework specification shall apply semi-formal method: sequence diagrams (HR).

Description

Sequence diagrams (Table B.7 row 2) are a semi-formal graphical method used to represent the temporal order of operations and interactions within a control system. They describe how actions, events, or function blocks are executed step by step, showing the sequence and dependencies between them. This makes them useful for specifying control flows, verifying timing behavior, and ensuring deterministic execution in safety-related applications. QP/C++ Framework applies various types of logic/function block diagrams in the following figures:

  • Figure CONC-SEQ-TH Sequence diagram showing threads interacting (synchronously) with a passive object
  • Figure CONC-SEQ-AO Sequence diagram showing threads interacting (asynchronously) with an Active Object
  • Figure SDS-PUB1 Sequence diagram showing publishing event from a medium-priority Active Object (preemptive scheduler).
  • Figure SDS-PUB2 Sequence diagram showing publishing event WITHOUT scheduler locking (preemptive scheduler).
  • Figure SDS-START Sequence diagram showing QP/C++ Application startup sequence.
  • Figure SDS-POST1 Sequence diagram showing Posting event form ISR to an Active Object.
  • Figure SDS-POST2 Sequence diagram showing Posting event from a lower-priority Active Object to a higher-priority Active Object (preemptive scheduler).
  • Figure SDS-PUB1 Sequence diagram showing Publishing event from a medium-priority Active Object (preemptive scheduler).
  • Figure SDS-PUB2 Sequence diagram showing Publishing event WITHOUT scheduler locking (preemptive scheduler).

Backward Traceability

  • [SAS_QP_SCT_11B] Architectural view: Semi-formal methods in QP/C++ Framework component.

Forward Traceability (truncated to 2 level(s))

  • [SSM_QP_AOU_311B] QP/C++ Application should apply semi-formal methods.
    • [SSM_QP_AOU_331] QP/C++ Application should apply semi-formal method logic/function block diagrams.
    • [SSM_QP_AOU_332] QP/C++ Application should apply semi-formal method sequence diagrams.
    • [SSM_QP_ASR_334A] QP/C++ Application shall apply semi-formal method finite state machines.
    • [SSM_QP_ASR_337] QP/C++ Application shall apply semi-formal method decision/truth tables.
    • [SSM_QP_AOU_338] QP/C++ Application should apply semi-formal method UML.
  • [SSM_QP_AOU_332] QP/C++ Application should apply semi-formal method sequence diagrams.

[SDS_QP_SFM_04A]

Design view: QP/C++ Framework specification shall support semi-formal method: finite state machines (HR).

Description

Finite State Machines (FSMs) (Table B.7 row 4a) are a semi-formal graphical method for modeling the discrete states of a control system and the transitions between them. They represent how a system behaves depending on its current state and external events, with transitions triggered by defined conditions. This approach makes system dynamics explicit, supports deterministic control, and is widely used in safety-related applications to ensure predictable behavior. The QP/C++ Framework internally applies state machine diagrams in its specification. QP/C++ Framework applies state machine diagrams in the following figures:

  • Figure SRS-SM-HSM Hierarchical State Machine diagram with labeled features corresponding to the sub-requirements
  • Figure SDS-EVT-LIFE Sequence diagram showing Mutable Event Life Cycle and Ownership Rules.
  • Figure SDS-SM Sequence diagram showing Example Hierarchical State Machine (a toaster oven).
  • Figure SDS-TE-LIFE Sequence diagram showing Time Event Life Cycle.
Attention
The QP/C++ Framework specification provides strong, built-in support for advanced hierarchical state machines, enabling QP/C++ Applications to apply this highly recommended semi-formal method in accordance with [IEC 61508] and [ISO 26262]. While the QP/C++ Framework does not internally rely on state machines for its own behavior, it delivers the architectural foundations, execution semantics, and modeling discipline that allow applications to implement precise, analyzable, and systematically verifiable state-based behavior. This capability is essential: it empowers application developers to use hierarchical state machines as a rigorous semi-formal technique for specifying control logic, managing mode transitions, and ensuring predictable system behavior under both nominal and degraded conditions.

Backward Traceability

  • [SAS_QP_SCT_11B] Architectural view: Semi-formal methods in QP/C++ Framework component.

Forward Traceability (truncated to 2 level(s))

  • [SSM_QP_AOU_311B] QP/C++ Application should apply semi-formal methods.
    • [SSM_QP_AOU_331] QP/C++ Application should apply semi-formal method logic/function block diagrams.
    • [SSM_QP_AOU_332] QP/C++ Application should apply semi-formal method sequence diagrams.
    • [SSM_QP_ASR_334A] QP/C++ Application shall apply semi-formal method finite state machines.
    • [SSM_QP_ASR_337] QP/C++ Application shall apply semi-formal method decision/truth tables.
    • [SSM_QP_AOU_338] QP/C++ Application should apply semi-formal method UML.
  • [SSM_QP_ASR_334A] QP/C++ Application shall apply semi-formal method finite state machines.
    • [SSM_QP_ASR_410] All application-level state machines shall be well-formed and conform to the state-machine implementation strategy provided in the QP/C++ Framework.

[SDS_QP_SFM_07]

Design view: QP/C++ Framework specification shall support semi-formal method: decision/truth tables (HR).

Description

Decision/truth tables are a semi-formal method for specifying software behavior by exhaustively listing condition combinations and the required system response. They are classified as Highly Recommended (HR) in Table B.7 row 7 because they reduce ambiguity, expose missing cases, and support systematic verification. Decision/truth tables express logic in a structured, tabular form where columns represent input conditions or predicates, rows represent all meaningful combinations of those conditions, and cells define the required action or outcome for each combination. The QP/C++ Framework applies decision/truth tables in the design of the state machine processing algorithms:

  • In the QHsm-style state machine implementation strategy, the hierarchical event-dispatch algorithm evaluates event-state combinations using a well-defined, table-like structure of conditions and outcomes. Each dispatch step corresponds to a row in a conceptual truth table: given (current state, incoming event), the framework deterministically selects the appropriate handler, guard evaluation, and transition path.
  • In the QMsm-style state machine implementation strategy, the automatically generated transition-action tables provide an explicit, analyzable representation of the actions associated with each transition. These tables are a specialized form of decision tables, capturing for every (state, event, guard) combination the exact transition target and the ordered list of actions to be executed.

Backward Traceability

  • [SAS_QP_SCT_11B] Architectural view: Semi-formal methods in QP/C++ Framework component.

Forward Traceability (truncated to 2 level(s))

  • [SSM_QP_AOU_311B] QP/C++ Application should apply semi-formal methods.
    • [SSM_QP_AOU_331] QP/C++ Application should apply semi-formal method logic/function block diagrams.
    • [SSM_QP_AOU_332] QP/C++ Application should apply semi-formal method sequence diagrams.
    • [SSM_QP_ASR_334A] QP/C++ Application shall apply semi-formal method finite state machines.
    • [SSM_QP_ASR_337] QP/C++ Application shall apply semi-formal method decision/truth tables.
    • [SSM_QP_AOU_338] QP/C++ Application should apply semi-formal method UML.
  • [SSM_QP_ASR_337] QP/C++ Application shall apply semi-formal method decision/truth tables.
  • [SDS_QP_ALG_QHsm_dispatch] Design view: QHsm event dispatching
  • [SDS_QP_ALG_QMsm_dispatch] Design view: QMsm Event Dispatching

[SDS_QP_SFM_08]

Design view: QP/C++ Framework specification shall apply semi-formal method: UML (R).

Description

Unified Modeling Language (UML) is recognized as a semi-formal graphical modeling method that can complement IEC 61131-3 control specifications. UML provides standardized diagram types (e.g., class, sequence, state, activity, and timing diagrams) to describe system structure and behavior. In the context of functional safety standards, UML can be used to model software structure (package and class diagrams), event flows (sequence diagrams), state transitions (discrete behavior), and timing (timing diagrams), supporting clarity and consistency due to well-defined, formal semantics. QP/C++ Framework applies the UML notation throughout its documentation. Examples include the following figures:

  • Figure SRS-BLK UML block diagram: showing the context and functional decomposition of a system based on QP/C++ Framework.
  • Figure SDS-CLS UML class diagram showing Core classes in QP/C++ Framework and their relation to QP/C++ Application.
  • Figure SAS-LAYERS UML package diagram showing Context of use with layers and QP/C++ Framework interfaces.
  • Figure SAS-MEM UML composite structure diagram showing Memory allocation in QP/C++ Framework and QP/C++ Application.
  • Figure SRS-USE UML use case diagram: Users and main use cases of QP/C++ Application and QP/C++ Framework.
  • Figure FSM-SDLC UML activity diagram: Software development lifecycle for QP/C++ Framework (the V-model).
  • Figure SSM-SEQ-TH UML sequence diagram showing threads interacting (synchronously) with a passive object
  • Figure SRS-SM-HSM UML state diagram showing Hierarchical State Machine
  • Figure CONC-TE-JIT UML timing diagram showing Jitter of a periodic Time Event expiring every tick

Backward Traceability

  • [SAS_QP_SCT_11B] Architectural view: Semi-formal methods in QP/C++ Framework component.

Forward Traceability (truncated to 2 level(s))

  • [SSM_QP_AOU_311B] QP/C++ Application should apply semi-formal methods.
    • [SSM_QP_AOU_331] QP/C++ Application should apply semi-formal method logic/function block diagrams.
    • [SSM_QP_AOU_332] QP/C++ Application should apply semi-formal method sequence diagrams.
    • [SSM_QP_ASR_334A] QP/C++ Application shall apply semi-formal method finite state machines.
    • [SSM_QP_ASR_337] QP/C++ Application shall apply semi-formal method decision/truth tables.
    • [SSM_QP_AOU_338] QP/C++ Application should apply semi-formal method UML.
  • [SSM_QP_AOU_338] QP/C++ Application should apply semi-formal method UML.

Design View: Defensive Programming

Defensive programming is a design technique that anticipates abnormal, unexpected, or invalid conditions and ensures the software responds safely rather than relying on ideal inputs or perfect operating conditions. According to IEC 61508-7, defensive programming requires the developer to:

  • check assumptions explicitly (e.g., input ranges, state validity, pointer integrity),
  • detect violations early through assertions or equivalent mechanisms,
  • avoid constructs that can lead to undefined or implementation-dependent behavior, and
  • ensure that any detected abnormal condition leads to a predictable, controlled, and safe reaction.

The goal is to prevent systematic faults by making the software robust against misuse, unexpected events, and internal failures, thereby supporting the required systematic capability for the target SIL.


[SDS_QP_SST_03]

Design view: QP/C++ Framework shall apply defensive programming to detect systematic faults in the QP/C++ Application.

Description

The QP/C++ Framework incorporates defensive programming techniques to anticipate, detect, and mitigate systematic faults in the QP/C++ Application. These include explicit checks for invalid states, controlled use of assertions, avoidance of undefined behavior, and strict separation between nominal and fault-handling paths. Defensive programming is applied consistently across state machines, event delivery, and kernel services to ensure predictable behavior under abnormal conditions.

Backward Traceability

  • [SSRS_QP_SREQ_010] QP/C++ Framework component shall apply defensive programming to proactively detect faults in the QP/C++ Application.

Forward Traceability (truncated to 2 level(s))

View: Modular Approach

Regulatory background
The following Table SDS-B9 lists the recommended techniques and measures for software design required by [IEC 61508-3:2010] Table B.9 to achieve SIL-3. The last two columns of the table define how these techniques shall be applied (or avoided) in the design of the QP/C++ Framework and QP Applications.

Table SDS-B9: Modular approach applied to QP/C++ Framework component ([IEC 61508-3:2010] Table B.9).
Technique/Measure(*) IEC 61508
Ref.
SIL 3 Specs for
QP/C++ component
1 Software module size limit C.2.9 HR SDS_QP_MOD_01
2 Software complexity control C.5.13 HR SDS_QP_MOD_01
3 Information hiding/encapsulation C.2.8 HR SDS_QP_MOD_03
4 Parameter number limit / fixed number of subprogram parameters C.2.9 R SDS_QP_MOD_01
5 One entry/one exit point in subroutines and functions C.2.9 HR SDS_QP_MOD_01
6 Fully defined interface C.2.9 HR SDS_QP_MOD_06

In the reference columns (entitled Ref), the informative references "B.x.x.x", "C.x.x.x" refer to descriptions of techniques in [IEC 61508-7:2010] Annexes B and C, while "Table A.x", "Table B.x" refer to tables of techniques in [IEC 61508-3:2010] Annexes A and B.
NOTE 1 [IEC 61508-3:2010] Table C.19
NOTE 2 The references (which are informative, not normative) "B.x.x.x", "C.x.x.x" in column ("Ref.") indicate detailed descriptions of techniques given in Annexes B and C of [IEC 61508-3:2010].
(*) Alternative or equivalent techniques/measures are indicated by a letter following the number. It is intended that only one of the alternative or equivalent techniques/measures should be satisfied. The choice of alternative technique should be justified by the properties, given in [IEC 61508-7:2010] Annex C, desirable in the particular application.

Table SDS-T1: Topics to be covered by modelling and coding guidelines for QP/C++ Framework component ([ISO 26262-6] Table 1 (ASIL-C only)).
Topics ASIL-C Specs for
QP/C++ component
1a Enforcement of low complexity ++ [SDS_QP_MOD_01]
1e Use of established design principles + Table SDS-TBL-A4
1g Use of style guides ++ [SAS_QP_PL_03]

Legend:
++ = Highly Recommended (must justify if not used)
+ = Recommended (no need to justify if not used)


[SDS_QP_MOD_01]

Design view: QP/C++ Framework shall collect metrics and apply HIS limits.

Description

The QP/C++ Framework source code shall collect and adopt the Hersteller Initiative Software (HIS) source code quality metrics and limits ([EMENDA-HIS], [EXIDA-METRICS]), which are stricter and more specific than the recommendations of Table SDS-B9. The following table lists the HIS metrics and the adopted limits (cross-referenced with the modularity recommendations in Table SDS-B9 and Table SDS-T1) in the QP/C++ Framework component:

HIS Metric Purpose IEC 61508 guideline HIS Limits QP/C++ Limits
v(G) McCabe cyclomatic complexity Table-B.9(2) ≤ 10 ≤ 16
PATH Number of Paths Table-B.9(1) ≤ 80 < 99
STMT Number of Statements Table-B.9(1) ≤ 50 ≤ 55
LEVEL Depth of nesting of a function Table-B.9(1) ≤ 4 ≤ 4
CALLS Called Functions Table-B.9(1) ≤ 7 ≤ 7
PARAM Function Parameters Table-B.9(4) ≤ 5 ≤ 7
RETURN Number of return points per function Table-B.9(5) ≤ 1 ≤ 1
GOTO Number of goto Statements Table-B.9(2) 0 0
COMF Comment Density Table-B.9(6) ≥ 0.2 ≥ 0.2
NOMV MISRA HIS Subset violations N/A 0 0
NOMVPR MISRA violations per rule N/A 0 0

Backward Traceability

Forward Traceability (truncated to 2 level(s))

  • [SSM_QP_AOU_321] QP/C++ Application shall collect metrics and apply HIS limits.
  • [SMR_QP_FUNC] QP/C++ function metrics report.
  • [SMR_QP_FILE] QP/C++ file metrics report.

[SDS_QP_MOD_03]

Design view: QP/C++ Framework shall apply information hiding/encapsulation.

Description

Regulatory background
The following Table SDS-G2 lists the recommended techniques and measures for object-oriented software design by [IEC 61508-7:2010] Table G.2 to achieve SIL-3. The last two columns of the table define how these techniques shall be applied (or avoided) in the design of the QP/C++ Framework component.

Table SDS-G2: Object-oriented detailed design applied to QP/C++ Framework and QP/C++ Application ([IEC 61508-7:2010] Table G.2, SIL-3 only).
Recommendation SIL 3 QP/C++ component
G2.1 Classes should have only one objective HR see Single Responsibility
G2.2 Inheritance used only if the derived class is a refinement of its base class HR see Liskov Substitution Principle
G2.3 Depth of inheritance limited by the coding standard HR see Inheritance Depth Limit
G2.4 Overriding of operations (methods) under strict control HR see Operation Overriding
G2.5 Multiple inheritance used only for interface classes HR see No Multiple Inheritance
G2.6 Inheritance from unknown classes NR see No Unknown Inheritance
G2.7 Verification that the reused object-oriented libraries meet the recommendations of this table HR see No Libraries

NOTE 1 In other words: One class is characterized by having one responsibility, i.e., taking care of closely connected data and the operations on these data
NOTE 2 Care is required to avoid circular dependencies between objects.

Single Responsibility

Each based class in QP/C++ encapsulates a single responsibility (e.g., QActive for active objects, QEvt for events, QTimeEvt for timers). This reduces complexity and supports analyzability.

Liskov Substitution Principle

QP/C++ uses a controlled form of inheritance through struct embedding. Derived types (e.g., QActive inheriting QHsm) refine behavior without altering base semantics. No unrelated inheritance is permitted.

Inheritance Depth Limit

The inheritance hierarchy is intentionally shallow (typically 12 levels). This ensures analyzability and prevents excessive coupling.

Operation Overriding

Overriding is limited to state-machine polymorphism (state handlers). All overrides follow strict signature and behavior rules enforced by the framework.

No Multiple Inheritance

Multiple inheritance is prohibited. QP/C++ uses composition instead.

No Unknown Inheritance

All base types are defined within the QP/C++ codebase. No external OO libraries or unknown base classes are used.

No Libraries

QP/C++ Framework shall not use any object-oriented libraries.

Forward Traceability (truncated to 2 level(s))

  • [SSM_QP_AOU_323] QP/C++ Application should apply information hiding/encapsulation.

[SDS_QP_MOD_06]

Design view: QP/C++ Framework shall apply fully defined interface.

Description

Backward Traceability

Forward Traceability (truncated to 2 level(s))

  • [SSM_QP_AOU_326] QP/C++ Application should apply fully defined interface.

View: Design and Coding Standards

Regulatory background
The following Table SDS-B1 provides a SIL-dependent set of recommendations for software architecture design methods. It is the first table in Annex B, which contains the normative/informative technique tables (B.1B.7) that guide developers in selecting appropriate software design, analysis, and verification techniques to achieve the required systematic capability (SC) for SIL-3 in this case.

Table SDS-B1: Design and coding standards of QP/C++ Framework component ([IEC 61508-3] Table B.1).
Technique/Measure(*) IEC 61508
Ref.
SIL 3 Specs for
QP Framework component
1 Use of coding standards to reduce likelihood of errors C.2.6.2 HR SDS_QP_DCS_01
2 No dynamic objects C.2.6.3 HR SDS_QP_DCS_01
3a No dynamic variables C.2.6.3 R see choice 3b(*)
3b Online checking of the installation of dynamic variables C.2.6.4 R SDS_QP_DCS_03B
4 Limited use of interrupts C.2.6.5 HR —
5 Limited use of pointers C.2.6.6 HR SDS_QP_DCS_05
6 Limited use of recursion C.2.6.7 HR SDS_QP_DCS_06
7 No unstructured control flow in programs in higher level languages C.6.2 HR SDS_QP_DCS_07
8 No automatic type conversion C.2.6.2 HR SDS_QP_DCS_08

NOTE 1 Measures 2, 3a, and 5. The use of dynamic objects (for example, on the execution stack or a heap) may impose requirements on both available memory and execution time. Measures 2, 3a, and 5 do not need to be applied if a compiler is used that ensures a) that sufficient memory for all dynamic variables and objects will be allocated before runtime, or which guarantees that in case of memory allocation error, a safe state is achieved; b) that response times meet the requirements.
NOTE 2 See [IEC 61508-3:2010] Table C.11
NOTE 3 The references (which are informative, not normative) "B.x.x.x", "C.x.x.x" in column ("Ref.") indicate detailed descriptions of techniques given in Annexes B and C of [IEC 61508-3:2010].

(*) Alternative or equivalent techniques/measures are indicated by a letter following the number. It is intended that only one of the alternative or equivalent techniques/measures should be satisfied. The choice of alternative technique should be justified by the properties, given in [IEC 61508-7:2010] Annex C, desirable in the particular application.


[SDS_QP_DCS_01]

Design view: QP/C++ Framework shall use of coding standards to reduce likelihood of errors.

Description

The framework adheres to MISRA-C and HIS metrics to ensure predictable, analyzable code.

Forward Traceability (truncated to 2 level(s))


[SDS_QP_DCS_02]

Design view: QP/C++ Framework shall use no dynamic objects.

Description

The framework allocates all objects statically. Dynamic allocation is prohibited.

Forward Traceability (truncated to 2 level(s))

  • [SSM_QP_AOU_405] QP/C++ Application-level concrete Active Objects should be instantiated statically.

[SDS_QP_DCS_03B]

Design view: QP/C++ Framework shall apply online checking of the installation of dynamic variables.

Description

QP/C++ does not allocate dynamic variables internally. However, if the Application uses dynamic memory (e.g., OS services), the Application must perform online checks. This requirement is documented in the Safety Manual.

Forward Traceability (truncated to 2 level(s))


[SDS_QP_DCS_05]

Design view: QP/C++ Framework shall limit the use of pointers.

Description

Pointer usage is restricted to well-defined interfaces (events, state handlers). No pointer arithmetic is used.

Forward Traceability (truncated to 2 level(s))


[SDS_QP_DCS_06]

Design view: QP/C++ Framework shall limit the use of recursion.

Description

Recursion is prohibited. All control flow is iterative and bounded.

Forward Traceability (truncated to 2 level(s))


[SDS_QP_DCS_07]

Design view: QP/C++ Framework shall not use unstructured control flow in programs in higher level languages.

Description

QP/C++ Framework shall not use unstructured control flow. The framework avoids goto, longjmp, and other unstructured constructs.

Forward Traceability (truncated to 2 level(s))


[SDS_QP_DCS_08]

Design view: QP/C++ Framework shall not use automatic type conversion.

Description

QP/C++ Framework shall not use automatic type conversion. Implicit conversions are prohibited. All casts are explicit and justified.

Forward Traceability (truncated to 2 level(s))

Design View: Structured Programming


[SDS_QP_SP_01]

Design view: QP/C++ framework adheres to structured programming principles.

Forward Traceability (truncated to 2 level(s))

Design View: Trusted/Verified Elements


[SDS_QP_TVE_01]

Design view: QP/C++ Framework shall use trusted/verified software elements.

Description

The framework uses only internally developed, verified components. If the Application integrates external libraries (e.g., RTOS), the Application must verify them per SSM obligations.

Forward Traceability (truncated to 2 level(s))

Design View: Design Traceability


[SDS_QP_TR_01]

Design view: QP/C++ Framework code and documentation shall provide traceability.

QP/C++ Framework code and documentation shall provide forward traceability between:

  • Software Safety Requirements (SSRS_QP)
  • Software Architecture Specification ([SAS_QP])
  • Software Design Specification ([SDS_QP])

Traceability ensures that all safety-related design elements are justified by requirements and that all requirements are implemented in the design.

Forward Traceability (truncated to 2 level(s))

Observability Viewpoint