GTest

Name: GTest
Tool Provider:

Google

Supported Standards: ISO26262
Description:

gtest (also known as Google Test) is a multi-platform unit testing and mocking library (also known as Google Mock) for the C++ programming language.

The unit test functionality provides a wide range of fatal and nonfatal assertions, whereas the mocking functionality provides a declarative syntax for defining mocks.

Use Cases:
Release:

October 3, 2019

Description:

Latest official release v1.10.0

Environment:

The tool can be executed on different environments. The tool user should ensure that the tool was qualified in same or similar environment.

Release:

August 31, 2018

Description:

Latest official release v1.8.1

Environment:

The tool can be executed on different environments. The tool user should ensure that the tool was qualified in same or similar environment as it is used.

Description:

Latest official release v1.11.0

Environment:

The tool can be executed on different environments. The tool user should ensure that the tool was qualified in same or similar environment.

Safety-Impact: yes
Inputs:
  • Implemented test cases:

    C/C++ files which contain gtest unit tests.

Outputs:
  • Console Output:

    The test report which is produced by gtest on the console.

  • Return Code:

    The return code which is returned by the test executable after all tests were executed. If all tests were PASSED, the return code needs to be 0, otherwise it must be 1.

  • Unit test reports:

    Test Reports in different formats (XML / JSON ) which contain the results of the executed test cases.

Features:
  • Fatal Assertions:

    Assertions that can lead to the termination of the test

  • GMock Matchers:

    A gMock matcher is basically a predicate that knows how to describe itself. It can be used with the macros ASSERT_THAT(value, matcher) and EXPECT_THAT(value, matcher). For example, `StartsWith(prefix)` is a matcher that matches a string starting with `prefix`

  • GMock mocking:

    Mocking functionality provided by GMock.

  • Non Fatal Assertions:

    Assertions that do NOT lead to the termination of the test

Potential errors:
# Error Safety-Impact Mitigations for detections/avoidance Final detection/avoidance probability
1 [Fatal Assertions] Fatal Macros do not behave as expected

A successful test result is reported, although assertion fails or an exception occurs.

impact_true HIGH
2 [Fatal Assertions] Macros report successful assertion as failed test result

A failed test result is reported by macros, although the result of the assertion was successful.


Comment:

This error has no impact on safety of the product because it will cause unintended failed test cases. This will lead to further analysis of the failure.

impact_false
/
HIGH
3 [GMock Matchers] GMock Matcher wrongly determines that provided argument(s) do NOT match.

GMock Matchers wrongly determine that argument does NOT match to provided matcher.


Comment:

This error has no impact on safety of the product because it will cause unintended failed test cases. This will lead to further analysis of the failure.

impact_false
/
HIGH
4 [GMock Matchers] GMock Matcher wrongly determines that provided argument(s) match.

GMock Matchers wrongly determine that argument matches the provided matcher.

impact_true HIGH
5 [GMock mocking] GMock mocking does not behave as expected

Either not all actions are performed or mocked methods are called with another frequency as set in the expectation, but the result is PASS.

impact_true HIGH
6 [Non Fatal Assertions] Macros report successful assertion as failed test result

A failed test result is reported by macros, although the result of the assertion was successful.


Comment:

This error has no impact on safety of the product because it will cause unintended failed test cases. This will lead to further analysis of the failure.

impact_false
/
HIGH
7 [Non Fatal Assertions] Non Fatal Macros do not behave as expected

Non Fatal Macros report a successful test result, although assertion fails or an exception occurs within a macro argument.

impact_true HIGH
Description:

The QKit is a standard Validas QKit using QST and TAU that automatically executes the qualification tests in the user environment.

This qualification kit covers the Gtest tool and the use case considered is: Run Gtest

Details on the planning and tests are removed for confidentiality reasons.

Qualfication method:

VALIDAS_QKIT

Identifications:
Use Cases:
Description:

This testsuite contains tests for use case described in the model

Flags: Has Requirements Based Tests , Has Negative Tests , Has Boundary Tests , Has Equivalence Tests , Has Error Guessing Tests
# tests: 2584
Errors:
  • Fatal Macros do not behave as expected
  • GMock Matcher wrongly determines that provided argument(s) match.
  • GMock mocking does not behave as expected
  • Non Fatal Macros do not behave as expected