gtest
status: draft
tags: tool_management
safety_affected: YES
security_affected: YES
tcl: LOW
version: 1.15.0

GoogleTest (GTest) Verification Report#

Introduction#

Scope and purpose#

GoogleTest (GTest) is a C++ testing framework developed by Google to support the creation of robust, maintainable, and portable tests. It is designed to help developers write tests by offering a rich set of assertions, test fixtures, and test discovery mechanisms. GTest is compatible with various platforms.

Inputs and outputs#

Inputs: Software sources (C++), GTest-based test files (C++)
Outputs: Test binary, Test report (txt, json, xml).
GTest overview

Fig. 16 GTest overview#

Available information#

Installation and integration#

Installation#

To add the GTest Bazel dependency to your project or module, include the following line in your MODULE.bazel file:
bazel_dep(name = "googletest", version = "1.15.0")
Bazel will fetch from the Bazel Central Registry (BCR): https://registry.bazel.build/modules/googletest

Integration#

Integrated in bazel.

Environment#

Requires C++ compiler and bazel build environment.

Safety evaluation#

This section outlines the safety evaluation of GTest for its use within the S-CORE project.

Table 56 Safety evaluation#

Malfunction identification

Use case description

Malfunctions

Impact on safety?

Impact safety measures available?

Impact safety detection sufficient?

Further additional safety measure required?

Confidence (automatic calculation)

1

Run tests and generate test report

Fails to load input files

GTest fails to load provided file even if file is present and accessible.

yes

(implicit) Check test run status

yes

no

high

2

Run tests and generate test report

Fails to write result to file

GTest was not able to save results in file(s).

yes

(implicit) Check test run status

yes

no

high

3

Run tests and generate test report

Fails to collect results of the test(s)

GTest was not able to collect results of executed test.

no

no

yes

no

high

4

Run tests and generate test report

Fails to detect an existing error

GTest fails to detect the presence of existing errors.

yes

no

no

yes (qualification)

low

5

Run tests and generate test report

Fails to execute the test

GTest fails to execute specific test from the test plan

no

no

yes

no

high

6

Run tests and generate test report

Indicates presence of a non-existing error

GTest indicates the presence of errors that do not exist.

no

no

yes

no

high

7

Run tests and generate test report

Produces wrong test report

GTest fails to save correct test result in test report.

yes

Review test report

yes

no

high

Security evaluation#

This section outlines the security evaluation of GTest for its use within the S-CORE project.

Table 57 Security evaluation#

Threat identification

Use case description

Threats

Impact on security?

Impact security measures available?

Impact security detection sufficient?

1

TBD

TBD

TBD

TBD

TBD

Result#

GTest requires qualification for use in safety-related software development according to ISO 26262.

Tool Qualification#

Based on method: validation of the software tool.

Requirements and testing aspects#

Tool requirements are derived from official documentation: https://google.github.io/googletest

GTest is an open-source tool and does not provide formal, vendor-defined requirements. Therefore, the testing team is responsible for identifying the specific GTest functionality used in the project. Based on this, requirements for the utilized features must be derived from the available documentation and GTest validated against defined requirements.