Component Testing for C++ overview

Component Testing for C++

Component Testing for C++ is a fully integrated feature of HCL OneTest Embedded that uses object-oriented techniques to address automated testing of C++ embedded and native software.

Object-oriented testing does not mean that the Component Testing for C++ feature is designed solely for testing object-oriented languages. Whether the target application is object-oriented or not, Component Testing for C++ adapts to the environment.

In fact, Component Testing for C++ can be used for:

  • Software feature tests,

  • Component integration tests,

  • Software validation,

  • Non-regression tests.

Component Testing for C++ supports ISO/IEC 14882:1998.

Overview

Basically, Component Testing for C++ interacts with your source code through a scripting language called C++ Test Script Language. You use the HCL OneTest Embedded GUI or command line tools to set up your test campaign, write your test scripts, run your tests and view the test results. Object Testing's mode of operation is twofold:

  • C++ Test Driver scripts describe a test harness that stimulates and checks basic I/O of the code under test.

  • C++ Contract Check scripts, which instrument the code under test, verifying behavioral assertions during execution of the code.

Note: Contract Check is part of the Component Testing for C++ feature. However, contract check scripts can also be used in application nodes, as a Runtime Analysis feature.

When the test is executed, Component Testing for C++ compiles both the test scripts and the source under test, then instruments the source code and generates a test driver. Both the instrumented application and the test driver provide output data which is displayed within HCL OneTest Embedded.

How Component Testing for C++ Works

When a test node is executed, the Test Compiler (atoprepro) compiles both the test scripts and the source under test. This preprocessing creates an .ots file. The resulting source code generates a test driver.

If any Runtime Analysis tools are associated with the test node, then the source code is also instrumented with the Instrumentor (attolcpp) tool.

The test driver, TDP, stubs and dependency files all make up the test harness.

The test harness interacts with the source code under test and produces test results. Test execution creates a .tdf file.

The .ots and .tdf files are processed together the Component Testing Report Generator (atopospro). The output is the .xrd report file, which can be viewed and controlled in the HCL OneTest Embedded GUI.

Of course, these steps are mostly transparent to the user when the test node is executed in the HCL OneTest Embedded GUI.

Related Topics

Using Test Features | Manually Creating a Test or Application Node