diff --git a/docs/pastey/docs/component_classification.rst b/docs/pastey/docs/component_classification.rst new file mode 100644 index 0000000..a233c4c --- /dev/null +++ b/docs/pastey/docs/component_classification.rst @@ -0,0 +1,233 @@ +.. + # ******************************************************************************* + # Copyright (c) 2026 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +Pastey Crate Component Classification +========================================== + +.. document:: Pastey Crate Component Classification + :id: doc__pastey_crate_comp_class + :status: valid + :safety: ASIL_B + :security: NO + :realizes: wp__sw_component_class + :tags: pre-existing, software-component, classification, Rust, proc-macro + + +| Classification of Pastey Crate as a software component in the context of S-CORE. +| +| Repository: https://github.com/as1100k/pastey +| Documentation: https://docs.rs/pastey/0.2.1/pastey/ +| Crate Version: 0.2.1 +| Additional documentation considered: +| https://crates.io/crates/pastey + + +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 + +.. list-table:: Determine (P) + :header-rows: 1 + + * - 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.1/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 + +.. list-table:: Determine (C) + :header-rows: 1 + + * - 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) + +.. list-table:: + :header-rows: 1 + :widths: 20 20 20 20 + + * - + - 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 +| + +Assessment reference document (template used) : https://eclipse-score.github.io/process_description/main/folder_templates/modules/module_name/component_name/docs/component_classification.html \ No newline at end of file