SWE.4 Software Unit Verification 軟體單元驗證

ASPICE 標準解讀 — 軟體工程流程

David Lin 顧問筆記
ASPICE標準解讀
4 min readMay 7, 2020

--

流程目的(Process Purpose)

The purpose of the Software unit Verification Process is to verify software units to provide evidence for compliance of the software units with the software detailed design and with the non-functional software requirements.

軟體單元驗證流程的目的是驗證軟體單元並提供軟體單元與軟體細部設計及非功能性軟體需求相符合的證據。

流程結果(Process Outcome)

成功實作軟體單元驗證流程,其相應的結果如下:

  1. [Outcome 1]制定一個軟體單元驗證策略(包含回歸測試策略),並據此驗證軟體單元
  2. [Outcome 2]根據軟體單元驗證策略制定軟體單元驗證準則,該準則適用於提供證據證明軟體單元符合軟體細部設計和非功能性需求。
  3. [Outcome 3]根據軟體單元驗證策略及已定義的軟體單元驗證準則,驗證軟體單元並記錄驗證結果
  4. [Outcome 4]建立軟體單元(軟體架構設計)、驗證準則(軟體單元驗證)與驗證結果(軟體單元驗證)的一致性與雙向可追溯性
  5. [Outcome 5]總結軟體單元驗證結果並與相關單位溝通

基礎實踐(Base Practices)

SWE.4.BP1: Develop software unit verification strategy including regression strategy.
SWE.4.BP1: 制定軟體單元驗證策略包含回歸測試策略
[Outcome 1]

Develop a strategy for verification of the software units including regression strategy for re-verification if a software unit is changed. The verification strategy shall define how to provide evidence for compliance of the software units with the software detailed design and with the non-functional requirements.

制定一個軟體單元驗證策略,包含當軟體單元被修改後要進行重新驗證的回歸測試策略。軟體單元驗證策略應定義如何提供證據證明軟體單元符合軟體細部設計及非功能性的(軟體)需求。

NOTE 1: Possible techniques for unit verification include static/dynamic analysis, code reviews, unit testing etc.

備註1: 單元驗證的技術包含:靜態/動態分析、程式碼審查、單元測試等...

SWE.4 軟體單元驗證需要證明的範圍

SWE.4.BP2: Develop criteria for unit verification.
SWE.4.BP2: 制定單元驗證準則
[Outcome 2]

Develop criteria for unit verification that are suitable to provide evidence for compliance of the software units, and their interactions within the component, with the software detailed design and with the non-functional requirements according to the verification strategy. For unit testing, criteria shall be defined in a unit test specification.

根據單元驗證策略制定單元驗證準則,該準則適用於提供證據證明軟體單元及其在組件中互動符合軟體細部設計和非功能性需求。針對單元測試,(驗證)準則應被定義在單元測試規格書中。

NOTE 2: Possible criteria for unit verification include unit test cases, unit test data, static verification, coverage goals and coding standards such as the MISRA rules.
NOTE 3: The unit test specification may be implemented e.g. as a script in an automated test bench.

備註2: 單元驗證準則包含:單元測試案例、單元測試資料、靜態驗證、覆蓋範圍和程式設計標準(例如: MISRA規則)
備註3: 單元測試規格書可被執行(例如: 用於自動化測試平台中的腳本)

SWE.4 制定單元準則(criteria)與工作產出(work product)的關係

SWE.4.BP3: Perform static verification of software units.
SWE.4.BP3: 對軟體單元執行靜態驗證
[Outcome 3]

Verify software units for correctness using the defined criteria for verification. Record the results of the static verification.

使用定義的驗證準則來驗證軟體單元的正確性。記錄靜態驗證的結果。

NOTE 4: Static verification may include static analysis, code reviews, checks against coding standards and guidelines, and other techniques.
NOTE 5: See SUP.9 for handling of non-conformances.

備註4: 靜態驗證可包含靜態分析、程式碼審查、檢查(程式碼)與程式設計標準與準則、其他技術。
備註5: 有關不符合項目的處理,請參見SUP.9。

SWE.4.BP4: Test software units.
SWE.4.BP4: 測試軟體單元
[Outcome 3]

Test software units using the unit test specification according to the software unit verification strategy. Record the test results and logs.

根據軟體單元驗證策略,使用單元測試規格書對軟體單元進行測試,並記錄測試結果與日誌。

NOTE 6: See SUP.9 for handling of non-conformances.

備註6: 有關不符合項目的處理,請參見SUP.9

SWE.4.BP5: Establish bidirectional traceability.
SWE.4.BP5: 建立雙向追溯性
[Outcome 4]

Establish bidirectional traceability between software units and static verification results. Establish bidirectional traceability between the software detailed design and the unit test specification. Establish bidirectional traceability between the unit test specification and unit test results.

建立軟體單元與靜態驗證結果的雙向追溯性。建立軟體細部設計與單元測試規格書的雙向追溯性。建立單元測試規格書與單元測試結果的雙向追溯性。

NOTE 7: Bidirectional traceability supports coverage, consistency and impact analysis.

備註7: 雙向追溯性支援覆蓋性、一致性和影響分析。

SWE.4 建立雙向追溯性的最完整範圍

SWE.4.BP6: Ensure consistency.
SWE.4.BP6: 確保一致性
[Outcome 4]

Ensure consistency between the software detailed design and the unit test specification.

確保軟體細部設計與單元測試規格書的一致性。

NOTE 8: Consistency is supported by bidirectional traceability and can be demonstrated by review records.

備註8: 一致性可以透過雙向追溯性來支持,且可以透過審查紀錄來體現。

SWE.4.BP7: Summarize and communicate results.
SWE.4.BP7: 總結和溝通測試結果
[Outcome 5]

Summarize the unit test results and static verification results and communicate them to all affected parties.

總結單元測試結果及靜態驗證結果並與相關單位溝通。

NOTE 9: Providing all necessary information from the test case execution in a summary enables other parties to judge the consequences.

備註9: 統整並提供測試案例執行的所有必要資訊將能讓其他單位判斷結果。

工作產出(Output Work product)

08–50 測試規格書 [Outcome 2]
08-52 測試計劃書 [Outcome 1]
13-04 溝通紀錄 [Outcome 5]
13-19 審查記錄 [Outcome 3,4]
13-22 追溯記錄 [Outcome 4]
13-25 驗證結果 [Outcome 3,5]
13-50 測試結果[Outcome 3,5]
15–01 分析報告[Outcome 3]

感謝閱讀本文章!

如果你對文章內容有任何問題,請隨時與我聯絡。
if you found any question in the article, please feel free to contact me.

email: linchewing@gmail.com

--

--

David Lin 顧問筆記
ASPICE標準解讀

現任國際標準輔導顧問及評鑑師;在這裡,分享一些產業新知、趨勢以及標準的解讀與看法。更多資訊請參考:https://linchew.com