background image
<< Packed Array and Structure Display | C++ Contract-Check Script >>
<< Packed Array and Structure Display | C++ Contract-Check Script >>

C++ Testing Overview

Test RealTime - User Guide
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.
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 Test RealTime.
How Component Testing for C++ Works
When a test node is executed, the Component Testing 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 features 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 Test RealTime GUI.
Of course, these steps are mostly transparent to the user when the test node is
executed in the Test RealTime GUI.
C++ Testing Overview
C++ Test Nodes
The project structure of the Rational Test RealTime GUI uses
test nodes
to represent
your Component Testing test harness.
Test nodes created for Component Testing for C++ use the following structure
·
C++ Test Node: represents the Component Testing for C++ test harness
·
<script>
.otc: is the Contract-Check test script
·
<script>
.otd: is the test driver script
·
<source>
.cpp: is the source file under test
164