DO Qualification Kit: Polyspace Code Prover Tool Qualification Plan
DO Qualification Kit: Polyspace Code Prover Tool Qualification Plan
www.mathworks.com
www.mathworks.com/sales_and_services
User community:
www.mathworks.com/matlabcentral
Technical support:
www.mathworks.com/support/contact_us
Phone:
508-647-7000
Revision History
September 2013
March 2014
October 2014
March 2015
September 2015
Contents
1 Introduction ...................................................................................................................................... 1-1
2 Tool Overview and Identification .................................................................................................... 2-1
2.1 Polyspace Code Prover Product Description ........................................................................... 2-2
2.2 Polyspace Code Prover Product Identifier............................................................................... 2-3
3 Tool Operational Requirements ....................................................................................................... 3-1
4 Certification Considerations ............................................................................................................. 4-1
4.1 Requirements for Qualification ............................................................................................... 4-2
4.2 Certification Credit .................................................................................................................. 4-3
Table FM.A-5, OO.A-5, MB.A-5 (2) Source Code Complies with Software Architecture .... 4-5
Table FM.A-5, OO.A-5, MB.A-5 (3) Source Code Is Verifiable ............................................ 4-6
Table FM.A-5, OO.A-5, MB.A-5 (6) Source Code Is Accurate and Consistent ..................... 4-6
Table FM.A-6 (1) Executable Object Code Complies with High-Level Requirements .......... 4-8
Table FM.A-6 (2) Executable Object Code Is Robust with High-Level Requirements .......... 4-9
Table FM.A-6 (3) Executable Object Code Complies with Low-Level Requirements ......... 4-10
Table FM.A-6 (4) Executable Object Code Is Robust with Low-Level Requirements ......... 4-11
Table FM.A-7 (5-8) Verification Coverage of Software Structure is Achieved ................... 4-13
Table FM.A-7 (9) Verification of Property Preservation between Source Code and Object
Code ...................................................................................................................................... 4-13
5 Tool Development Life Cycle Tool Developer ............................................................................. 5-1
6 Tool Development Life Cycle Tool User ...................................................................................... 6-1
6.1 Planning................................................................................................................................... 6-2
6.2 Requirements ........................................................................................................................... 6-3
6.3 Verification ............................................................................................................................. 6-4
7 Additional Considerations ................................................................................................................ 7-1
7.1 Independence ........................................................................................................................... 7-2
7.2 Customer Bug Reporting ......................................................................................................... 7-3
7.3 Protection Mechanisms ........................................................................................................... 7-4
8 Tool Life Cycle Data ........................................................................................................................ 8-1
9 Schedule ........................................................................................................................................... 9-1
vi
1 Introduction
This document is the Tool Qualification Plan (reference DO-330 Section 10.1.2) for the
following capabilities of the Polyspace Code Prover Criteria 2 TQL-4 tool.
Prove absence of certain run-time errors and dead code in C and C++ code
Calculation of range information for variables and function return values
Identification of variables that exceed specified range limits
Identified shared variables and protected variables
1-2
Polyspace Code Prover proves the absence of overflow, divide-by-zero, out-of-bounds array
access, and certain other run-time errors in C and C++ source code. It produces results without
requiring program execution, code instrumentation, or test cases. Polyspace Code Prover uses
static analysis and abstract interpretation based on formal methods. You can use it on
handwritten code, generated code, or a combination of the two. Each operation is color-coded to
indicate whether it is free of run-time errors, proven to fail, unreachable, or unproven.
Polyspace Code Prover also displays range information for variables and function return values,
and can prove conditions under which variables exceed specified range limits. Results can be
published to a dashboard to track quality metrics and ensure conformance with software quality
objectives. Polyspace Code Prover can be integrated into build systems for automated
verification.
Key Features
Additionally, you can use Polyspace Code Prover to check coding rules. The coding rules
qualification credit taken for Polyspace Bug Finder applies to Polyspace Code Prover because
both products use the same components.
Given a source program P written in source programming language L, you want to compute
statically (without specific input data) and automatically a conservative model of the future
dynamic, run-time behavior of P. You also want to extract from this model predictions about the
possible occurrences of run-time errors and sources of nondeterminism (for static verification)
as well as data and control flow information.
The present document is derived from the High-Level Specification of Polyspace Code Prover,
and serves as a criterion for functional validation testing.
2-2
Version (Release)
Tool Vendor
DO Qualification Kit
2-3
2-4
3-2
4 Certification Considerations
This section describes certification considerations for the Polyspace Code Prover verification
tool.
SDD Report
Can the tool insert an error into the airborne software or fail to detect an
Yes1
existing error in the software within the scope of its intended usage?
Will the output of the tool not be verified as specified in Section 6 of DO-178C, Yes
DO-278A, DO-331, DO-332 or DO-333?
Are processes of DO-178C, DO-278A, DO-331, DO-332 or DO-333
Yes
eliminated, reduced, or automated by the use of the tool? Will you use output
from the tool to meet an objective or replace an objective of DO-178C, DO278A, DO-331, DO-332 or DO-333, Annex A or Annex C?
1 The
Given that the answer to all the preceding questions is yes, Polyspace Code Prover must be
qualified.
To determine the qualification type (Criteria 1, Criteria 2, or Criteria 3), you must answer the
following questions about the tool.
Question
1.
2.
Is the tool output part of the airborne software, such that the output can
insert an error into the software?
Could the tool fail to detect an error in the airborne software and is the
tool also used to justify the elimination or reduction of either of the
following:
Verification processes other than that automated by the tool.
SDD Report
No
Yes
Yes
The Polyspace Code Prover will be used to reduce object code verification processes in addition
to automating source code verification processes, thus eliminating a verification process not
automated by the tool. Because the answer to the preceding first question is no and the second
question is yes, it must be qualified as a Criteria 2 tool following the DO-330 tool qualification
process for TQL-4.
4-2
Because Polyspace Code Prover is a formal methods tool, as defined in DO-333, that
supplement becomes applicable for Tables FM.A-5, FM.A-6, and FM1-7 objectives.
When using Polyspace Code Prover to verify code developed from a Design Model, as
defined in DO-331, that supplement becomes applicable for Table MB.A-5 objectives.
When using Polyspace Code Prover to verify C++ code that uses object-oriented
techniques, as defined in DO-332, that supplement becomes applicable for Table
OO.A-5 objectives.
The following table lists the certification credit (see DO-331, DO-332, or DO-333 Annex A or
Annex C Objectives) required for the Polyspace Code Prover. The table and section references
are:
DO-331
DO-332
DO-333
MB prefix
OO prefix
FM prefix
Objective
DO-331,
DO-332 or
DO-333
Reference
Credit Taken
(in conjunction with other tools)
Table
FM.A-5
MB.C-5
Table
FM.A-5
MB.C-5
Table
FM.A-5
MB.C-5
Table
FM.A-5
MB.C-5
Table
FM.A-5
MB.C-5
FM.6.3.4.a
FM.6.3.4.b
FM.6.3.4.e
FM.6.3.4.c
4-3
Annex A
or C
Table
Objective
DO-331,
DO-332 or
DO-333
Reference
Table
FM.A-5
MB.C-5
Table
FM.A-5
MB.C-5
Table
FM.A-6
MB.C-6
Table
FM.A-6
MB.C-6
Table
FM.A-6
MB.C-6
Table
FM.A-6
MB.C-6
Table
FM.A-7
MB.C-7
Table
FM.A-7
MB.C-7
Table
FM.A-7
MB.C-7
Table
FM.A-7
MB.C-7
Table
FM.A-7
MB.C-7
Table
OO.A-5
OO.C-5
Table
OO.A-5
OO.C-5
Table
OO.A-5
OO.C-5
FM.6.2.1
FM.6.7.c
FM.6.7.b
FM.6.7.c
FM.6.7.d
FM.6.7.c
FM.6.7.b
FM.6.7.c
FM.6.7.2.a
FM.6.7.2.b
FM.6.7.2.c
FM.6.7.1.c
Credit Taken
(in conjunction with other tools)
OO.6.3.4.c
4-4
Annex A
or C
Table
Objective
DO-331,
DO-332 or
DO-333
Reference
Credit Taken
(in conjunction with other tools)
Table
MB.A-5
MB.C-5
Table
MB.A-5
MB.C-5
Table
MB.A-5
MB.C-5
MB.6.3.4.b
MB.6.3.4.c
The following sections describe how the listed objectives can be partially or totally achieved
using Polyspace Code Prover results.
4-5
4-6
MB.6.3.4.f: Accuracy and consistency: The objective is to determine the correctness and
consistency of the source code, including stack usage, memory usage, fixed-point arithmetic
overflow and resolution, floating-point arithmetic, resource contention and limitations, worstcase execution timing, exception handling, use of uninitialized variables, cache management,
unused variables, and data corruption due to task or interrupt conflicts. The compiler (including
its options), the linker (including its options), and some hardware features may have an impact
on the worst-case execution timing and this impact should be assessed.
Polyspace Code Prover helps to identify exhaustively:
Unused variables
Unused constants
Type consistency issues
Type conversions leading to underflow or overflow
4-7
Real and integer input variables should be considered using valid boundary values.
For time-related functions, such as filters, integrators, and delays, multiple iterations of
the code should be performed to check the characteristics of the function in context.
For state transitions, analyses should be developed to consider the transitions possible
during normal operation.
For software requirements expressed by logic equations, the normal range cases should
verify the variable usage and the Boolean operators.
Formal methods can be used to verify the absence of some error types listed above, as described
in FM.6.7, item f. Additionally, testing will be required to verify the software integration in
target hardware.
With respect to objective FM.6.7.c, Polyspace Code Prover helps to identify exhaustively:
Uninitialized variables
Parameter passing errors
Data corruption, especially global data
Inadequate end-to-end numerical resolution
4-8
With respect to objective FM.6.7.c, Polyspace Code Prover helps partially to identify:
With respect to objective FM.6.7.b, Polyspace Code Prover helps to identify exhaustively:
Detection of arithmetic faults (see details in the Polyspace Code Prover documentation)
Detection of violation of array limits
Detection of overflows
4-9
With respect to objective FM.6.7.b, Polyspace Code Prover helps to identify partially:
With respect to objective FM.6.7.c, Polyspace Code Prover helps to identify exhaustively:
Uninitialized variables
Parameter passing errors
Data corruption, especially global data
Inadequate end-to-end numerical resolution
With respect to objective FM.6.7.c, Polyspace Code Prover helps partially to identify:
Real and integer input variables should be considered using valid boundary values.
For time-related functions, such as filters, integrators, and delays, multiple iterations of
the code should be performed to check the characteristics of the function in context.
4-10
For state transitions, analyses should be developed to consider the transitions possible
during normal operation.
For software requirements expressed by logic equations, the normal range cases should
verify the variable usage and the Boolean operators.
Formal methods can be used to satisfy this objective, as described in FM.6.7.f. Typical errors to
consider include:
With respect to objective FM.6.7.d, Polyspace Code Prover helps to identify exhaustively:
Detection of arithmetic faults (see details in the Polyspace Code Prover documentation)
Detection of violation of array limits
Detection of overflows
Inadequate end-to-end numerical resolution
With respect to objective FM.6.7.d, Polyspace Code Prover helps to identify partially:
4-11
For loops where the loop count is a computed value, formal analysis cases should be
developed to attempt to compute out-of-range loop count values, and thus demonstrate
the robustness of the loop-related code.
A check should be made to ensure that protection mechanisms for exceeded frame times
respond correctly.
For time-related functions such as filters, integrators and delays, formal analysis case
should be developed for arithmetic overflow mechanisms.
For state transitions, formal analysis cases should be developed to provoke transitions
that are not allowed by the software requirements.
With respect to objective FM.6.7.b, Polyspace Code Prover helps to identify exhaustively:
Detection of arithmetic faults (see details in the Polyspace Code Prover documentation)
Detection of violation of array limits
Detection of overflows
With respect to objective FM.6.7.b, Polyspace Code Prover helps to identify partially:
With respect to objective FM.6.7.c, Polyspace Code Prover helps to identify exhaustively:
Uninitialized variables
Parameter passing errors
Data corruption, especially global data
Inadequate end-to-end numerical resolution
4-12
With respect to objective FM.6.7.c, Polyspace Code Prover helps to identify partially:
(2) Formal analysis of Executable Object code can be used to satisfy the objectives if
the following conditions are satisfied:
Formal evidence demonstrates that the formal model of the source code satisfies
the requirements.
4-13
Complimentary analysis shows the property preservation between the source code
and the EOC. By verifying the correctness of the translation of source to object
code, formal analysis performed at the source code level against high or low-level
requirements can be used to infer correctness of the Executable Object code
against high- or low-level requirements. This is similar to the way coverage metrics
gained from source code can be used to establish the adequacy of tests to verify the
target system. If directly traceable to source code statements, then additional
verification should performed to establish property preservation.
Polyspace Code Prover analysis is used only to take credit for detection of specific error types,
as described in the previous sections. Testing of the executable object code against the high- and
low-level requirements is still required to fully satisfy the objectives of FM.A-6. To demonstrate
preservation of properties between the source and object code, a traceability analysis between
the source and object code needs to be accomplished to demonstrate that additional code that is
not directly traceable to source code is not inserted. Additionally, tests can be used to show that
properties are preserved between low-level requirements and executable object code.
4-14
for MathWorks tools being qualified to TQL-4, as defined in DO-178C and DO-330. The DO
Qualification Kit: Tool Life Cycle Process document provides information about the tool
development life cycle, including:
5-2
6.1 Planning
The Plan for Software Aspects of Certification (PSAC) or Plan for Software Aspects of
Approval (PSAA) for TBD Project calls out that Polyspace Code Prover will be qualified as a
Criteria 2 TQL-4 tool, as defined in DO-178C and DO-330.
This document provides the Tool Qualification Plan for Polyspace Code Prover.
6-2
6.2 Requirements
The Tool Requirements for the Polyspace Code Prover are defined as the Operational
Requirements (ORs) and Language Specific Requirements (LSRs) in:
Polyspace Code Prover Tool Requirements, R2015b
The Tool Operational Requirements for the Polyspace Code Prover are defined as HLRs in:
Polyspace Code Prover Tool Operational Requirements, R2015b
The Polyspace Code Prover Theoretical Foundation is described in:
Polyspace Code Theoretical Foundation, R2015b
For traceability between the High-Level Requirements (HLRs), Operational Requirements
(ORs) and Language Specific Requirements (LSRs), see:
qualkitdo_codeprover_HLR_OR_LSR_Trace.xlsx
Instructions for installing the tool and minimum hardware requirements are at the
MathWorks Documentation Center, R2015b.
Installation
6-3
6.3 Verification
Requirements-based test procedures will be developed from the Tool Operational Requirements
by MathWorks. A subset of these tests will be provided to the tool user to execute in the
installed environment. This subset of tests partially covers each requirement of the tool, and
provides confidence in the tool operation in the installed environment.
The test cases and procedures for Polyspace Code Prover are documented in:
Polyspace Code Prover Test Cases and Procedures, R2015b
To access the theoretical foundation and tool operational requirements documents, on the
MATLAB command line, type qualkitdo to open the Artifacts Explorer. The documents
are in Polyspace Code Prover.
The tool-user will:
Review the test cases and procedures and the corresponding documentation for
applicability to the project under consideration
Configure the test cases and procedures and the corresponding documentation in a
configuration management system
Run the test cases and procedures in the installed environment
Review the test results
Configure the test results and the corresponding documentation in a configuration
management system
6-4
7 Additional Considerations
7.1 Independence
Polyspace Code Prover is used to verify the output of an unqualified development tool,
Embedded Coder. Therefore, for Polyspace Code Prover qualification, the user needs to
demonstrate the independence of Polyspace Code Prover and Embedded Coder development
(DO-330, FAQ D.7).
The DO Qualification Kit: Polyspace Code Prover Independence Analysis document provides
an independence analysis, including:
7-2
7-3
7-4
The following table shows the life cycle data provided for Polyspace Code Prover. The table
maps the documents and artifacts to DO-330 life cycle data items.
Polyspace Code Prover Life Cycle Data
Data
Available/
Submit
DO-330
Documents/Artifacts
Reference
Section
10.1.1
Submit
Available
Available
Section
10.1.4
Tool Configuration
Management Plan
Available
Section
10.1.5
Available
Section
10.1.6
Tool Requirements
Standards
Tool Design Standards
Section
10.1.2
Section
10.1.3
Tool Environment
Configuration Index
Submit
Section
10.1.11
Available
Section
10.1.12
8-2
Data
Available/
Submit
DO-330
Documents/Artifacts
Reference
Tool Configuration
Management Records
Tool Quality Assurance
Records
Tool-Specific Information
in SECI
Tool Requirements
Available
Available
Section
10.1.13
Section
10.1.14
Section
10.1.17
Section
10.2.1
Section
10.2.2
Available
Available
Tool Operational
Requirements
Submit
Submit
Available
Available
Available
Submit
Section
10.2.3
Section
10.2.4
Sections
12.2.3.c(2),
12.2.3.2
Section
10.3.1
Section
10.3.2
Section
10.3.3
10.2.5
8-3
Data
Available/
Submit
DO-330
Documents/Artifacts
Reference
Test Results
Available**
Section
10.3.4
10.2.6
Artifacts referenced in
qualkitdo_codeprover_qualification
report_tor.txt
qualkitdo_codeprover_qualification
report_misrac.txt
qualkitdo_codeprover_qualification
report_misracpp.txt
qualkitdo_codeprover_qualification
report_jsf.txt
qualkitdo_codeprover_qualification
report_code_metrics.txt
Available
Section
10.2.7
qualkitdo_codeprover_HLR_OR_LSR_tr
ace.xlsx
Matrix_jsf_rules_checker.txt
Matrix_limitation_Cpp.txt
Matrix_limitation_C.txt
Matrix_misra_Cpp.txt
Matrix_misra_C.txt
Matrix_norme_Cpp.txt
Matrix_norme_C.txt
Matrix_opreq_Cpp.txt
Matrix_opreq_C.txt
Available
FAQ D.7
Section
10.1.16
Section
10.1.15
Notes:
** To be created by tool-user
The tool-user must deliver data marked Submit to the certification authorities. Data marked
Available must be available at the tool-users or tool vendors site for inspection by the
certification authorities.
8-4
9 Schedule
<Insert tool schedule here.>