Pastey Crate Component Classification#

Pastey Crate Component Classification
status: valid
security: NO
safety: ASIL_B
tags: pre-existing, software-component, classification, Rust, proc-macro
version: 0
Classification of Pastey Crate as a software component in the context of S-CORE.

Crate Version: 0.2.3
Additional documentation considered:

Step 1: Determine (P): the uncertainty of the Processes applied#

Apply the process measures to determine (P).
The result of a process measure shall have as outcome [HE, PE, NE]
- HE: High Evidence
- PE: Partly Evidence but Manageable
- NE: No Evidence
Table 5 Determine (P)#

Id

Indicator for applying process

Result

Rationale for result

1

Are rules, state-of-the art processes applied for the design, implementation and verification?

PE

The project follows standard Rust open-source practices.

CI verifications include:

  • test suite (4 Rust versions: nightly, beta, stable, 1.54)

  • Code Coverage generation with LLVM-based tools (strickly 100% line coverage is required for pull request approval)

  • MSRV check

  • Documentation generation

  • Clippy linting strict warnings enforced (-Dwarnings)

  • Miri UB detection

  • dependency staleness checks

  • CHANGELOG entries for new features and bug fixes in CHANGELOG.md

  • Maintaining GitHub issues for all kind of new development.

This is a small-size proc-macro so relevant details are in the crate documentation, which includes usage, feature overview, brief detail of macro, APIs and use-cases examples.

2

Are requirements available?

PE

As this is small size procedural macro crate so functional requirements are partially captured in crate documentation as expected macro behaviors (identifier pasting, case modifiers, env! support, raw mode, replace modifier) with each feature explanation. (crate documentation - https://docs.rs/pastey/0.2.3/pastey/)

3

Are specifications for functionalities and properties available (architecture)?

PE

It is small procedural macro so crate documentation contains the partially specifications for functionalities and their properties through feature descriptions, usage examples, and modifier tables.

4

Are design specifications available?

PE

It is small crate structure with one public interface so it does not required UML/Class diagram but all the relevant details are part of crate document.

5

Are configuration specification and data available, if applicable?

HE

Not applicable.

The crate does not use any runtime configuration, environment-based settings, or configuration files. So no configuration specification is applicable or needed.

6

Are verification measures including tests and reports available?

HE

Comprehensive test suite exists, test files covering unit tests, integration tests. (test suite - https://github.com/AS1100K/pastey/tree/master/pastey-test-suite) (test suite result can be generated by creating a pull request e.g. - https://github.com/AS1100K/pastey/pull/30/checks or by running tests locally with cargo test command)

An LLVM-based code coverage report is generated and available at provided CI link, with 100% function coverage, 100% line coverage, and 100% branch coverage. (coverage report can be generate by creating a pull request e.g. - https://github.com/AS1100K/pastey/pull/30/checks)

(P=1) shall be selected when none of the determined process measures indicate PE or NE.
(P=2) shall be selected when at least one of the determined process measures indicate PE or NE, but the gaps evaluated are acceptable, means
the risk of systematic faults due to these gaps is sufficiently low or manageable by mitigating the gaps.
(P=3) in all other cases.

Pastey crate is determined as P = 2

Step 2: Determine (C): the uncertainty of finding systematic faults based on the Complexity#

Apply the complexity measures to determine (C).
The result of a complexity measure shall have as outcome [NH, HM, NM]
- NH: Not High
- HM: High but Manageable
- NM: high and Not Manageable
Table 6 Determine (C)#

Id

Indicator for high Complexity

Complexity measure Tool

Result

Number

1

High amount of Lines of Code

Lines of Code (without comments) (generated code is excluded, e.g. ProtoCmpl)

NH

917 (Excluding tests)

2

Unsafe code used / total unsafe code

Count:
  • LoUC+N: lines of unsafe code with safety note

  • LoUC : lines of unsafe code, no safety note

NH

0 (No unsafe code)

3

Test exists / Coverage (Function, Line)
(maybe better: testability, but how to measure?)

Existing Tests Coverage

NH

Comprehensive test suite with LLVM-based code coverage report available. With this PR https://github.com/AS1100K/pastey/pull/28, code coverage is -

  • 100% function coverage

  • 100% line coverage

  • 100% branch coverage

(coverage report can be generate by creating a pull request e.g. - https://github.com/AS1100K/pastey/pull/30/checks or by running tests locally with cargo test command)

4

High amount of public function interfaces

Number of public function interfaces

NH

1 (pastey macro has only 1 function)

5

High amount of function parameters

Number of parameters

NH

1 (TokenStream is the only parameter for proc macro)

(C=1) shall be selected when none of the determined complexity measures indicate HM or NM.
(C=2) shall be selected when at least one of the determined complexity measures indicate HM or NM, but the gaps evaluated are acceptable, means
the risk of systematic faults due to these gaps is sufficiently low in the context of S-CORE or manageable by mitigating the gaps.
(C=3) in all other cases.

Pastey crate is determined as C = 1

Step 3: Determine (CLAS_OUT): the classification outcome#

Select CLAS_OUT depending on the determined values of (C) and (P)

P=1

P=2

P=3

C=1

Q

Q

QR

C=2

QR

QR

QR

C=3

QR

QR

NQ

Pastey crate is classified as CLAS_OUT= Q, as it has P = 2 and C = 1.

Step 4: Document all results and rationale for choosing (P) and (C) and (CLAS_OUT)#

Resuts:
- P = 2 (Partly Evidence but Manageable) due to some process measures indicating PE, but the gaps are acceptable and manageable, as the crate is small size procedural macro with comprehensive documentation and testing practices in place.
- C = 1 (Not High) as all complexity measures indicate NH.
- CLAS_OUT = Q (Qualified) based on the combination of P = 2 and C = 1 according to the classification criteria.

Step 5: Based on (CLAS_OUT) select the activities#

Pastey crate is classified as CLAS_OUT= Q.

As soon as the change request containing this is in status “Accepted”, the module safety plan for the component development is adapted based on the following: (select according to above result)
- Q: Follow the processes for qualification of software components in a safety context.
- QR: Follow the process for pre-existing software architectural elements
- NQ: Do no use this element in safety context

Additional notes: Traceability: End-to-end traceability has been established using the LOBSTER tool within the score-crates repository. Although unit test results are not currently displayed in the generated reports due to a known limitation in Rust test result parsing (https://github.com/bmw-software-engineering/lobster/issues/589), all necessary traceability links are properly maintained. These include mappings between requirements, design elements, failure modes, control measures, and corresponding tests.

Toolchain Assurance: The crate is built and tested using the certified Ferrocene toolchain, which is maintained as part of the score_rust_toolchain repository. This ensures compliance with safety and reliability standards expected for Rust-based development.

Use of Standard Library Components in Pastey: The Pastey crate uses certified Rust core library components(https://github.com/AS1100K/pastey/pull/37), with limited usage of std::env, these modules are required to support environment variable handling within Pastey macros. Since they are sourced from the same certified toolchain, and use the same underlying components, their usage is considered safe and compliant within the crate.

Assessment reference document (template used) : https://eclipse-score.github.io/process_description/main/folder_templates/modules/module_name/component_name/docs/component_classification.html