blob: 3dedf00fdb6d3a5867cffd6f87bed5f78214c068 [file] [log] [blame]
Gyorgy Szingc805f112022-11-25 11:53:08 +01001Verification methodology
2========================
3
4This page discusses discusses verification tools and techniques used by the project.
5
6
7Static Checks
8-------------
9
10This verification step checks quality by examining the source code. The project currently uses two tools which are
11discussed in the chapters below.
12
13Checkpatch
14''''''''''
15
16`Checkpatch`_ is a tool developed and maintained by the Linux Kernel community. It can look for errors related to:
17
18 - C and C++ coding style
19 - spelling mistakes
20 - git commit message formatting
21
Gabor Tothc3078602024-07-29 11:04:16 +020022Please find the configuration of this tool in the :download:`TS repository.<../../../.checkpatch>` but do not forget
23to set ``CODESPELL_FILE`` variable in the environment to the local copy of the `codespell dictionary v2.3.0`_.
Gyorgy Szingc805f112022-11-25 11:53:08 +010024
25Cppcheck tool
26'''''''''''''
27
28`CppCheck`_ is a C/C++ static analysis tool. It can detect code depending on implementation defined behavior, and
29dangerous coding constructs and thus it verifies coding guidelines.
30
31Please find the configuration of this tool in the :download:`TS repository.<../../../.cppcheck>`
32
33Build verification
34------------------
35
36The :ref:`Build test runner` captures reference build configurations for all TS build products and can be used to verify
37these.
38
39Runtime verification
40--------------------
41
42During the runtime versification step various test and demo executables are executed on the host PC and/or on target
43platforms.
44
45Tests are targeting three different environment types:
46
47 - ``arm-linux``: test executables to be run from Linux user-space on the target.
48 - ``pc-linux``: executables to run on the host PC. These tests have a lower verification level, as the binary is likely
49 not running on an arm target. Portability issues in the source may hide error or trigger false alarms. In turn
50 this type of test is cheap,
51 - ``sp`` and ``opteesp``: test executables targeting these environments run in the SWd and server as:
52
53 - test payloads to help exercise trusted services
54 - test payload to help platform porting
55
56Each of these test applications manifest as a "deployment" in trusted services. For more details please see the
57:ref:`Deployments` section.
58
59Compliance testing
60''''''''''''''''''
61
62The project hosts deployment helping compliance testing. For more information please refer to
63:ref:`Platform Certification`.
64
Gyorgy Szing2a95ac92024-10-24 19:59:23 +020065Measuring Quality of testing
66''''''''''''''''''''''''''''
67
68The primary metric to measure runtime testing quality is code coverage. The project uses two methods to measure code
69coverage:
70
71 - "Host side" coverage measurement, where code coverage is measured using Unit Tests and Component Test executed on
72 the build host.
73
74 The measurement relies on GCCs `-ftest-coverage` compilation switch and the lcov tool. In order to include
75 coverage data of PSA client code and of service providers, `libpsats` and `libts` have to be built using
76 the `DebugCoverage` build type. If the build type override is not used, the build system will automatically build
77 and use the appropriate binaries.
78
79 - Coverage measurement on the target. This feature is only supported by the :ref:`AEM FVP` platform and uses
80 `qa-tools`_.
81
82Coverage measurement is automated in the CI, which is not publicly accessible yet.
83
Gyorgy Szingc805f112022-11-25 11:53:08 +010084------------------
85
86.. _`Checkpatch`: https://docs.kernel.org/dev-tools/checkpatch.html
87.. _`CppCheck`: https://cppcheck.sourceforge.io/
Gabor Tothc3078602024-07-29 11:04:16 +020088.. _`codespell dictionary v2.3.0`: https://raw.githubusercontent.com/codespell-project/codespell/v2.3.0/codespell_lib/data/dictionary.txt
Gyorgy Szing2a95ac92024-10-24 19:59:23 +020089.. _`qa-tools`: https://gitlab.arm.com/tooling/qa-tools
Gyorgy Szingc805f112022-11-25 11:53:08 +010090
91*Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.*
92
93SPDX-License-Identifier: BSD-3-Clause